﻿//Functions

function ShowEmail(user, domain, anchor) {
    var OutText = '';
    OutText += '<a href="mailto:' + user + '@' + domain + '">';
    if (anchor != '') OutText += anchor;
    else OutText += user + '@' + domain;
    OutText += '</a>';
    document.write(OutText);
}

function ShowEmailBySubject(user, domain, anchor, subject) {
    var OutText = '';
    OutText += '<a href="mailto:' + user + '@' + domain + '?subject=' + subject + '">'
    if (anchor != '') OutText += anchor;
    OutText += '</a>';
    document.write(OutText);
}

function externalLinks() {
    if (!document.getElementsByTagName) return;
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
            anchor.target = "_blank";
    }
}

function doHidePngPopUp(selectedDiv) {
    popdiv = document.getElementById(selectedDiv)
    popdiv.style.visibility = "hidden";
    Seen();
}

/*function popupTimer() { 
var t=setTimeout("document.getElementById('divpopup').style.display = 'block';",3000);
} */
/*-----------------START-PopUpWithCookie----------------------------*/

function showPopUp() {

    popupseen = getCookie('popupseen');
    if (popupseen == null || popupseen == "") {
        setTimeout("document.getElementById('divpopup').style.display = 'block';", 3000);
    }
}

function Seen() {
    popupseen = 'PopUpSeen';
    if (popupseen != null && popupseen != "") {
        setCookie('popupseen', popupseen, 1);
    }
}


function getCookie(c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=");
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1;
            c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1) c_end = document.cookie.length
            return unescape(document.cookie.substring(c_start, c_end));
        }
    }
    return ""
}

function setCookie(c_name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + exdate.toUTCString());
}
/*-----------------END-PopUpWithCookie----------------------------*/


window.onload = externalLinks;


function VirtualnetChat() {
    document.write('<iframe src="chat.aspx" id="chatframe" width="334" height="217" frameborder="0" scrolling="no"></iframe>');
}

//-------------------------------------------------------------------------------------------------------------------------

//Slideshow

/* Ultimate Fade-in slideshow (v2.4)
* Last updated: May 24th, 2010. This notice must stay intact for usage 
* Author: Dynamic Drive at http://www.dynamicdrive.com/
* Visit http://www.dynamicdrive.com/ for full source code
*/

//Oct 6th, 09' (v2.1): Adds option to randomize display order of images, via new option displaymode.randomize
//May 24th, 10' (v2.4): Adds new "peakaboo" option to "descreveal" setting. oninit and onslide event handlers added.

var fadeSlideShow_descpanel = {
    controls: [['x.png', 7, 7], ['restore.png', 10, 11], ['i/loading.gif', 54, 55]], //full URL and dimensions of close, restore, and loading images
    fontStyle: 'normal 11px Verdana', //font style for text descriptions
    slidespeed: 200 //speed of description panel animation (in millisec)
}

//No need to edit beyond here...

//jQuery.noConflict()

function fadeSlideShow(settingarg) {
    this.setting = settingarg
    settingarg = null
    var setting = this.setting
    setting.fadeduration = setting.fadeduration ? parseInt(setting.fadeduration) : 500
    setting.curimage = (setting.persist) ? fadeSlideShow.routines.getCookie("gallery-" + setting.wrapperid) : 0
    setting.curimage = setting.curimage || 0 //account for curimage being null if cookie is empty
    setting.currentstep = 0 //keep track of # of slides slideshow has gone through (applicable in displaymode='auto' only)
    setting.totalsteps = setting.imagearray.length * (setting.displaymode.cycles > 0 ? setting.displaymode.cycles : Infinity) //Total steps limit (applicable in displaymode='auto' only w/ cycles>0)
    setting.fglayer = 0, setting.bglayer = 1 //index of active and background layer (switches after each change of slide)
    setting.oninit = setting.oninit || function () { }
    setting.onslide = setting.onslide || function () { }
    if (setting.displaymode.randomize) //randomly shuffle order of images?
        setting.imagearray.sort(function () { return 0.5 - Math.random() })
    var preloadimages = [] //preload images
    setting.longestdesc = "" //get longest description of all slides. If no desciptions defined, variable contains ""
    for (var i = 0; i < setting.imagearray.length; i++) { //preload images
        preloadimages[i] = new Image()
        preloadimages[i].src = setting.imagearray[i][0]
        if (setting.imagearray[i][3] && setting.imagearray[i][3].length > setting.longestdesc.length)
            setting.longestdesc = setting.imagearray[i][3]
    }
    var closebutt = fadeSlideShow_descpanel.controls[0] //add close button to "desc" panel if descreveal="always"
    setting.closebutton = (setting.descreveal == "always") ? '<img class="close" src="' + closebutt[0] + '" style="float:right;cursor:hand;cursor:pointer;width:' + closebutt[1] + 'px;height:' + closebutt[2] + 'px;margin-left:2px" title="Hide Description" />' : ''
    var slideshow = this
    jQuery(document).ready(function ($) { //fire on DOM ready
        var setting = slideshow.setting
        var fullhtml = fadeSlideShow.routines.getFullHTML(setting.imagearray) //get full HTML of entire slideshow
        setting.$wrapperdiv = $('#' + setting.wrapperid).css({ position: 'relative', visibility: 'visible', background: 'white', overflow: 'hidden', width: setting.dimensions[0], height: setting.dimensions[1] }).empty() //main slideshow DIV
        if (setting.$wrapperdiv.length == 0) { //if no wrapper DIV found
            alert("Error: DIV with ID \"" + setting.wrapperid + "\" not found on page.")
            return
        }
        setting.$gallerylayers = $('<div class="gallerylayer"></div><div class="gallerylayer"></div>') //two stacked DIVs to display the actual slide 
			.css({ position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', background: 'white' })
			.appendTo(setting.$wrapperdiv)
        var $loadingimg = $('<img src="' + fadeSlideShow_descpanel.controls[2][0] + '" style="position:absolute;width:' + fadeSlideShow_descpanel.controls[2][1] + ';height:' + fadeSlideShow_descpanel.controls[2][2] + '" />')
			.css({ left: setting.dimensions[0] / 2 - fadeSlideShow_descpanel.controls[2][1] / 2, top: setting.dimensions[1] / 2 - fadeSlideShow_descpanel.controls[2][2] }) //center loading gif
			.appendTo(setting.$wrapperdiv)
        var $curimage = setting.$gallerylayers.html(fullhtml).find('img').hide().eq(setting.curimage) //prefill both layers with entire slideshow content, hide all images, and return current image
        if (setting.longestdesc != "" && setting.descreveal != "none") { //if at least one slide contains a description (versus feature is enabled but no descriptions defined) and descreveal not explicitly disabled
            fadeSlideShow.routines.adddescpanel($, setting)
            if (setting.descreveal == "always") { //position desc panel so it's visible to begin with
                setting.$descpanel.css({ top: setting.dimensions[1] - setting.panelheight })
                setting.$descinner.click(function (e) { //asign click behavior to "close" icon
                    if (e.target.className == "close") {
                        slideshow.showhidedescpanel('hide')
                    }
                })
                setting.$restorebutton.click(function (e) { //asign click behavior to "restore" icon
                    slideshow.showhidedescpanel('show')
                    $(this).css({ visibility: 'hidden' })
                })
            }
            else if (setting.descreveal == "ondemand") { //display desc panel on demand (mouseover)
                setting.$wrapperdiv.bind('mouseenter', function () { slideshow.showhidedescpanel('show') })
                setting.$wrapperdiv.bind('mouseleave', function () { slideshow.showhidedescpanel('hide') })
            }
        }
        setting.$wrapperdiv.bind('mouseenter', function () { setting.ismouseover = true }) //pause slideshow mouseover
        setting.$wrapperdiv.bind('mouseleave', function () { setting.ismouseover = false })
        if ($curimage.get(0).complete) { //accounf for IE not firing image.onload
            $loadingimg.hide()
            slideshow.paginateinit($)
            slideshow.showslide(setting.curimage)
        }
        else { //initialize slideshow when first image has fully loaded
            $loadingimg.hide()
            slideshow.paginateinit($)
            $curimage.bind('load', function () { slideshow.showslide(setting.curimage) })
        }
        setting.oninit.call(slideshow) //trigger oninit() event
        $(window).bind('unload', function () { //clean up and persist
            if (slideshow.setting.persist) //remember last shown image's index
                fadeSlideShow.routines.setCookie("gallery-" + setting.wrapperid, setting.curimage)
            jQuery.each(slideshow.setting, function (k) {
                if (slideshow.setting[k] instanceof Array) {
                    for (var i = 0; i < slideshow.setting[k].length; i++) {
                        if (slideshow.setting[k][i].tagName == "DIV") //catches 2 gallerylayer divs, gallerystatus div
                            slideshow.setting[k][i].innerHTML = null
                        slideshow.setting[k][i] = null
                    }
                }
            })
            slideshow = slideshow.setting = null
        })
    })
}

fadeSlideShow.prototype = {

    navigate: function (keyword) {
        var setting = this.setting
        clearTimeout(setting.playtimer)
        if (setting.displaymode.type == "auto") { //in auto mode
            setting.displaymode.type = "manual" //switch to "manual" mode when nav buttons are clicked on
            setting.displaymode.wraparound = true //set wraparound option to true
        }
        if (!isNaN(parseInt(keyword))) { //go to specific slide?
            this.showslide(parseInt(keyword))
        }
        else if (/(prev)|(next)/i.test(keyword)) { //go back or forth inside slide?
            this.showslide(keyword.toLowerCase())
        }
    },

    showslide: function (keyword) {
        var slideshow = this
        var setting = slideshow.setting
        if (setting.displaymode.type == "auto" && setting.ismouseover && setting.currentstep <= setting.totalsteps) { //if slideshow in autoplay mode and mouse is over it, pause it
            setting.playtimer = setTimeout(function () { slideshow.showslide('next') }, setting.displaymode.pause)
            return
        }
        var totalimages = setting.imagearray.length
        var imgindex = (keyword == "next") ? (setting.curimage < totalimages - 1 ? setting.curimage + 1 : 0)
			: (keyword == "prev") ? (setting.curimage > 0 ? setting.curimage - 1 : totalimages - 1)
			: Math.min(keyword, totalimages - 1)
        var $slideimage = setting.$gallerylayers.eq(setting.bglayer).find('img').hide().eq(imgindex).show() //hide all images except current one
        var imgdimensions = [$slideimage.width(), $slideimage.height()] //center align image
        $slideimage.css({ marginLeft: (imgdimensions[0] > 0 && imgdimensions[0] < setting.dimensions[0]) ? setting.dimensions[0] / 2 - imgdimensions[0] / 2 : 0 })
        $slideimage.css({ marginTop: (imgdimensions[1] > 0 && imgdimensions[1] < setting.dimensions[1]) ? setting.dimensions[1] / 2 - imgdimensions[1] / 2 : 0 })
        if (setting.descreveal == "peekaboo" && setting.longestdesc != "") { //if descreveal is set to "peekaboo", make sure description panel is hidden before next slide is shown
            clearTimeout(setting.hidedesctimer) //clear hide desc panel timer
            slideshow.showhidedescpanel('hide', 0) //and hide it immediately
        }
        setting.$gallerylayers.eq(setting.bglayer).css({ zIndex: 1000, opacity: 0 }) //background layer becomes foreground
			.stop().css({ opacity: 0 }).animate({ opacity: 1 }, setting.fadeduration, function () { //Callback function after fade animation is complete:
			    clearTimeout(setting.playtimer)
			    try {
			        setting.onslide.call(slideshow, setting.$gallerylayers.eq(setting.fglayer).get(0), setting.curimage)
			    } catch (e) {
			        alert("Fade In Slideshow error: An error has occured somwhere in your code attached to the \"onslide\" event: " + e)
			    }
			    if (setting.descreveal == "peekaboo" && setting.longestdesc != "") {
			        slideshow.showhidedescpanel('show')
			        setting.hidedesctimer = setTimeout(function () { slideshow.showhidedescpanel('hide') }, setting.displaymode.pause - fadeSlideShow_descpanel.slidespeed)
			    }
			    setting.currentstep += 1
			    if (setting.displaymode.type == "auto") {
			        if (setting.currentstep <= setting.totalsteps || setting.displaymode.cycles == 0)
			            setting.playtimer = setTimeout(function () { slideshow.showslide('next') }, setting.displaymode.pause)
			    }
			}) //end callback function
        setting.$gallerylayers.eq(setting.fglayer).css({ zIndex: 999 }) //foreground layer becomes background
        setting.fglayer = setting.bglayer
        setting.bglayer = (setting.bglayer == 0) ? 1 : 0
        setting.curimage = imgindex
        if (setting.$descpanel) {
            setting.$descpanel.css({ visibility: (setting.imagearray[imgindex][3]) ? 'visible' : 'hidden' })
            if (setting.imagearray[imgindex][3]) //if this slide contains a description
                setting.$descinner.empty().html(setting.closebutton + setting.imagearray[imgindex][3])
        }
        if (setting.displaymode.type == "manual" && !setting.displaymode.wraparound) {
            this.paginatecontrol()
        }
        if (setting.$status) //if status container defined
            setting.$status.html(setting.curimage + 1 + "/" + totalimages)
    },

    showhidedescpanel: function (state, animateduration) {
        var setting = this.setting
        var endpoint = (state == "show") ? setting.dimensions[1] - setting.panelheight : this.setting.dimensions[1]
        setting.$descpanel.stop().animate({ top: endpoint }, (typeof animateduration != "undefined" ? animateduration : fadeSlideShow_descpanel.slidespeed), function () {
            if (setting.descreveal == "always" && state == "hide")
                setting.$restorebutton.css({ visibility: 'visible' }) //show restore button
        })
    },

    paginateinit: function ($) {
        var slideshow = this
        var setting = this.setting
        if (setting.togglerid) { //if toggler div defined
            setting.$togglerdiv = $("#" + setting.togglerid)
            setting.$prev = setting.$togglerdiv.find('.prev').data('action', 'prev')
            setting.$next = setting.$togglerdiv.find('.next').data('action', 'next')
            setting.$prev.add(setting.$next).click(function (e) { //assign click behavior to prev and next controls
                var $target = $(this)
                slideshow.navigate($target.data('action'))
                e.preventDefault()
            })
            setting.$status = setting.$togglerdiv.find('.status')
        }
    },

    paginatecontrol: function () {
        var setting = this.setting
        setting.$prev.css({ opacity: (setting.curimage == 0) ? 0.4 : 1 }).data('action', (setting.curimage == 0) ? 'none' : 'prev')
        setting.$next.css({ opacity: (setting.curimage == setting.imagearray.length - 1) ? 0.4 : 1 }).data('action', (setting.curimage == setting.imagearray.length - 1) ? 'none' : 'next')
        if (document.documentMode == 8) { //in IE8 standards mode, apply opacity to inner image of link
            setting.$prev.find('img:eq(0)').css({ opacity: (setting.curimage == 0) ? 0.4 : 1 })
            setting.$next.find('img:eq(0)').css({ opacity: (setting.curimage == setting.imagearray.length - 1) ? 0.4 : 1 })
        }
    }


}

fadeSlideShow.routines = {

    getSlideHTML: function (imgelement) {
        var layerHTML = (imgelement[1]) ? '<a href="' + imgelement[1] + '" target="' + imgelement[2] + '">\n' : '' //hyperlink slide?
        layerHTML += '<img src="' + imgelement[0] + '" style="border-width:0;" />\n'
        layerHTML += (imgelement[1]) ? '</a>\n' : ''
        return layerHTML //return HTML for this layer
    },

    getFullHTML: function (imagearray) {
        var preloadhtml = ''
        for (var i = 0; i < imagearray.length; i++)
            preloadhtml += this.getSlideHTML(imagearray[i])
        return preloadhtml
    },

    adddescpanel: function ($, setting) {
        setting.$descpanel = $('<div class="fadeslidedescdiv"></div>')
			.css({ position: 'absolute', visibility: 'hidden', width: '100%', left: 0, top: setting.dimensions[1], font: fadeSlideShow_descpanel.fontStyle, zIndex: '1001' })
			.appendTo(setting.$wrapperdiv)
        $('<div class="descpanelbg"></div><div class="descpanelfg"></div>') //create inner nav panel DIVs
			.css({ position: 'absolute', left: 0, top: 0, width: setting.$descpanel.width() - 8, padding: '4px' })
			.eq(0).css({ background: 'black', opacity: 0.7 }).end() //"descpanelbg" div
			.eq(1).css({ color: 'white' }).html(setting.closebutton + setting.longestdesc).end() //"descpanelfg" div
			.appendTo(setting.$descpanel)
        setting.$descinner = setting.$descpanel.find('div.descpanelfg')
        setting.panelheight = setting.$descinner.outerHeight()
        setting.$descpanel.css({ height: setting.panelheight }).find('div').css({ height: '100%' })
        if (setting.descreveal == "always") { //create restore button
            setting.$restorebutton = $('<img class="restore" title="Restore Description" src="' + fadeSlideShow_descpanel.controls[1][0] + '" style="position:absolute;visibility:hidden;right:0;bottom:0;z-index:1002;width:' + fadeSlideShow_descpanel.controls[1][1] + 'px;height:' + fadeSlideShow_descpanel.controls[1][2] + 'px;cursor:pointer;cursor:hand" />')
				.appendTo(setting.$wrapperdiv)


        }
    },


    getCookie: function (Name) {
        var re = new RegExp(Name + "=[^;]+", "i"); //construct RE to search for target name/value pair
        if (document.cookie.match(re)) //if cookie found
            return document.cookie.match(re)[0].split("=")[1] //return its value
        return null
    },

    setCookie: function (name, value) {
        document.cookie = name + "=" + value + ";path=/"
    }
}

//-------------------------------------------------------------------------------------------------------------------------

/*!
 * Copyright (c) 2011 Simo Kinnunen.
 * Licensed under the MIT license.
 *
 * @version ${Version}
 */

var Cufon = (function() {

	var api = function() {
		return api.replace.apply(null, arguments);
	};

	var DOM = api.DOM = {

		ready: (function() {

			var complete = false, readyStatus = { loaded: 1, complete: 1 };

			var queue = [], perform = function() {
				if (complete) return;
				complete = true;
				for (var fn; fn = queue.shift(); fn());
			};

			// Gecko, Opera, WebKit r26101+

			if (document.addEventListener) {
				document.addEventListener('DOMContentLoaded', perform, false);
				window.addEventListener('pageshow', perform, false); // For cached Gecko pages
			}

			// Old WebKit, Internet Explorer

			if (!window.opera && document.readyState) (function() {
				readyStatus[document.readyState] ? perform() : setTimeout(arguments.callee, 10);
			})();

			// Internet Explorer

			if (document.readyState && document.createStyleSheet) (function() {
				try {
					document.body.doScroll('left');
					perform();
				}
				catch (e) {
					setTimeout(arguments.callee, 1);
				}
			})();

			addEvent(window, 'load', perform); // Fallback

			return function(listener) {
				if (!arguments.length) perform();
				else complete ? listener() : queue.push(listener);
			};

		})(),

		root: function() {
			return document.documentElement || document.body;
		},

		strict: (function() {
			var doctype;
			// no doctype (doesn't always catch it though.. IE I'm looking at you)
			if (document.compatMode == 'BackCompat') return false;
			// WebKit, Gecko, Opera, IE9+
			doctype = document.doctype;
			if (doctype) {
				return !/frameset|transitional/i.test(doctype.publicId);
			}
			// IE<9, firstChild is the doctype even if there's an XML declaration
			doctype = document.firstChild;
			if (doctype.nodeType != 8 || /^DOCTYPE.+(transitional|frameset)/i.test(doctype.data)) {
				return false;
			}
			return true;
		})()

	};

	var CSS = api.CSS = {

		Size: function(value, base) {

			this.value = parseFloat(value);
			this.unit = String(value).match(/[a-z%]*$/)[0] || 'px';

			this.convert = function(value) {
				return value / base * this.value;
			};

			this.convertFrom = function(value) {
				return value / this.value * base;
			};

			this.toString = function() {
				return this.value + this.unit;
			};

		},

		addClass: function(el, className) {
			var current = el.className;
			el.className = current + (current && ' ') + className;
			return el;
		},

		color: cached(function(value) {
			var parsed = {};
			parsed.color = value.replace(/^rgba\((.*?),\s*([\d.]+)\)/, function($0, $1, $2) {
				parsed.opacity = parseFloat($2);
				return 'rgb(' + $1 + ')';
			});
			return parsed;
		}),

		// has no direct CSS equivalent.
		// @see http://msdn.microsoft.com/en-us/library/system.windows.fontstretches.aspx
		fontStretch: cached(function(value) {
			if (typeof value == 'number') return value;
			if (/%$/.test(value)) return parseFloat(value) / 100;
			return {
				'ultra-condensed': 0.5,
				'extra-condensed': 0.625,
				condensed: 0.75,
				'semi-condensed': 0.875,
				'semi-expanded': 1.125,
				expanded: 1.25,
				'extra-expanded': 1.5,
				'ultra-expanded': 2
			}[value] || 1;
		}),

		getStyle: function(el) {
			var view = document.defaultView;
			if (view && view.getComputedStyle) return new Style(view.getComputedStyle(el, null));
			if (el.currentStyle) return new Style(el.currentStyle);
			return new Style(el.style);
		},

		gradient: cached(function(value) {
			var gradient = {
				id: value,
				type: value.match(/^-([a-z]+)-gradient\(/)[1],
				stops: []
			}, colors = value.substr(value.indexOf('(')).match(/([\d.]+=)?(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)/ig);
			for (var i = 0, l = colors.length, stop; i < l; ++i) {
				stop = colors[i].split('=', 2).reverse();
				gradient.stops.push([ stop[1] || i / (l - 1), stop[0] ]);
			}
			return gradient;
		}),

		quotedList: cached(function(value) {
			// doesn't work properly with empty quoted strings (""), but
			// it's not worth the extra code.
			var list = [], re = /\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g, match;
			while (match = re.exec(value)) list.push(match[3] || match[1]);
			return list;
		}),

		recognizesMedia: cached(function(media) {
			var el = document.createElement('style'), sheet, container, supported;
			el.type = 'text/css';
			el.media = media;
			try { // this is cached anyway
				el.appendChild(document.createTextNode('/**/'));
			} catch (e) {}
			container = elementsByTagName('head')[0];
			container.insertBefore(el, container.firstChild);
			sheet = (el.sheet || el.styleSheet);
			supported = sheet && !sheet.disabled;
			container.removeChild(el);
			return supported;
		}),

		removeClass: function(el, className) {
			var re = RegExp('(?:^|\\s+)' + className +  '(?=\\s|$)', 'g');
			el.className = el.className.replace(re, '');
			return el;
		},

		supports: function(property, value) {
			var checker = document.createElement('span').style;
			if (checker[property] === undefined) return false;
			checker[property] = value;
			return checker[property] === value;
		},

		textAlign: function(word, style, position, wordCount) {
			if (style.get('textAlign') == 'right') {
				if (position > 0) word = ' ' + word;
			}
			else if (position < wordCount - 1) word += ' ';
			return word;
		},

		textShadow: cached(function(value) {
			if (value == 'none') return null;
			var shadows = [], currentShadow = {}, result, offCount = 0;
			var re = /(#[a-f0-9]+|[a-z]+\(.*?\)|[a-z]+)|(-?[\d.]+[a-z%]*)|,/ig;
			while (result = re.exec(value)) {
				if (result[0] == ',') {
					shadows.push(currentShadow);
					currentShadow = {};
					offCount = 0;
				}
				else if (result[1]) {
					currentShadow.color = result[1];
				}
				else {
					currentShadow[[ 'offX', 'offY', 'blur' ][offCount++]] = result[2];
				}
			}
			shadows.push(currentShadow);
			return shadows;
		}),

		textTransform: (function() {
			var map = {
				uppercase: function(s) {
					return s.toUpperCase();
				},
				lowercase: function(s) {
					return s.toLowerCase();
				},
				capitalize: function(s) {
					return s.replace(/(?:^|\s)./g, function($0) {
						return $0.toUpperCase();
					});
				}
			};
			return function(text, style) {
				var transform = map[style.get('textTransform')];
				return transform ? transform(text) : text;
			};
		})(),

		whiteSpace: (function() {
			var ignore = {
				inline: 1,
				'inline-block': 1,
				'run-in': 1
			};
			var wsStart = /^\s+/, wsEnd = /\s+$/;
			return function(text, style, node, previousElement, simple) {
				if (simple) return text.replace(wsStart, '').replace(wsEnd, ''); // @fixme too simple
				if (previousElement) {
					if (previousElement.nodeName.toLowerCase() == 'br') {
						text = text.replace(wsStart, '');
					}
				}
				if (ignore[style.get('display')]) return text;
				if (!node.previousSibling) text = text.replace(wsStart, '');
				if (!node.nextSibling) text = text.replace(wsEnd, '');
				return text;
			};
		})()

	};

	CSS.ready = (function() {

		// don't do anything in Safari 2 (it doesn't recognize any media type)
		var complete = !CSS.recognizesMedia('all'), hasLayout = false;

		var queue = [], perform = function() {
			complete = true;
			for (var fn; fn = queue.shift(); fn());
		};

		var links = elementsByTagName('link'), styles = elementsByTagName('style');

		var checkTypes = {
			'': 1,
			'text/css': 1
		};

		function isContainerReady(el) {
			if (!checkTypes[el.type.toLowerCase()]) return true;
			return el.disabled || isSheetReady(el.sheet, el.media || 'screen');
		}

		function isSheetReady(sheet, media) {
			// in Opera sheet.disabled is true when it's still loading,
			// even though link.disabled is false. they stay in sync if
			// set manually.
			if (!CSS.recognizesMedia(media || 'all')) return true;
			if (!sheet || sheet.disabled) return false;
			try {
				var rules = sheet.cssRules, rule;
				if (rules) {
					// needed for Safari 3 and Chrome 1.0.
					// in standards-conforming browsers cssRules contains @-rules.
					// Chrome 1.0 weirdness: rules[<number larger than .length - 1>]
					// returns the last rule, so a for loop is the only option.
					search: for (var i = 0, l = rules.length; rule = rules[i], i < l; ++i) {
						switch (rule.type) {
							case 2: // @charset
								break;
							case 3: // @import
								if (!isSheetReady(rule.styleSheet, rule.media.mediaText)) return false;
								break;
							default:
								// only @charset can precede @import
								break search;
						}
					}
				}
			}
			catch (e) {} // probably a style sheet from another domain
			return true;
		}

		function allStylesLoaded() {
			// Internet Explorer's style sheet model, there's no need to do anything
			if (document.createStyleSheet) return true;
			// standards-compliant browsers
			var el, i;
			for (i = 0; el = links[i]; ++i) {
				if (el.rel.toLowerCase() == 'stylesheet' && !isContainerReady(el)) return false;
			}
			for (i = 0; el = styles[i]; ++i) {
				if (!isContainerReady(el)) return false;
			}
			return true;
		}

		DOM.ready(function() {
			// getComputedStyle returns null in Gecko if used in an iframe with display: none
			if (!hasLayout) hasLayout = CSS.getStyle(document.body).isUsable();
			if (complete || (hasLayout && allStylesLoaded())) perform();
			else setTimeout(arguments.callee, 10);
		});

		return function(listener) {
			if (complete) listener();
			else queue.push(listener);
		};

	})();

	function Font(data) {

		var face = this.face = data.face, wordSeparators = {
			'\u0020': 1,
			'\u00a0': 1,
			'\u3000': 1
		};

		this.glyphs = (function(glyphs) {
			var key, fallbacks = {
				'\u2011': '\u002d',
				'\u00ad': '\u2011'
			};
			for (key in fallbacks) {
				if (!hasOwnProperty(fallbacks, key)) continue;
				if (!glyphs[key]) glyphs[key] = glyphs[fallbacks[key]];
			}
			return glyphs;
		})(data.glyphs);

		this.w = data.w;
		this.baseSize = parseInt(face['units-per-em'], 10);

		this.family = face['font-family'].toLowerCase();
		this.weight = face['font-weight'];
		this.style = face['font-style'] || 'normal';

		this.viewBox = (function () {
			var parts = face.bbox.split(/\s+/);
			var box = {
				minX: parseInt(parts[0], 10),
				minY: parseInt(parts[1], 10),
				maxX: parseInt(parts[2], 10),
				maxY: parseInt(parts[3], 10)
			};
			box.width = box.maxX - box.minX;
			box.height = box.maxY - box.minY;
			box.toString = function() {
				return [ this.minX, this.minY, this.width, this.height ].join(' ');
			};
			return box;
		})();

		this.ascent = -parseInt(face.ascent, 10);
		this.descent = -parseInt(face.descent, 10);

		this.height = -this.ascent + this.descent;

		this.spacing = function(chars, letterSpacing, wordSpacing) {
			var glyphs = this.glyphs, glyph,
				kerning, k,
				jumps = [],
				width = 0, w,
				i = -1, j = -1, chr;
			while (chr = chars[++i]) {
				glyph = glyphs[chr] || this.missingGlyph;
				if (!glyph) continue;
				if (kerning) {
					width -= k = kerning[chr] || 0;
					jumps[j] -= k;
				}
				w = glyph.w;
				if (isNaN(w)) w = +this.w; // may have been a String in old fonts
				if (w > 0) {
					w += letterSpacing;
					if (wordSeparators[chr]) w += wordSpacing;
				}
				width += jumps[++j] = ~~w; // get rid of decimals
				kerning = glyph.k;
			}
			jumps.total = width;
			return jumps;
		};

	}

	function FontFamily() {

		var styles = {}, mapping = {
			oblique: 'italic',
			italic: 'oblique'
		};

		this.add = function(font) {
			(styles[font.style] || (styles[font.style] = {}))[font.weight] = font;
		};

		this.get = function(style, weight) {
			var weights = styles[style] || styles[mapping[style]]
				|| styles.normal || styles.italic || styles.oblique;
			if (!weights) return null;
			// we don't have to worry about "bolder" and "lighter"
			// because IE's currentStyle returns a numeric value for it,
			// and other browsers use the computed value anyway
			weight = {
				normal: 400,
				bold: 700
			}[weight] || parseInt(weight, 10);
			if (weights[weight]) return weights[weight];
			// http://www.w3.org/TR/CSS21/fonts.html#propdef-font-weight
			// Gecko uses x99/x01 for lighter/bolder
			var up = {
				1: 1,
				99: 0
			}[weight % 100], alts = [], min, max;
			if (up === undefined) up = weight > 400;
			if (weight == 500) weight = 400;
			for (var alt in weights) {
				if (!hasOwnProperty(weights, alt)) continue;
				alt = parseInt(alt, 10);
				if (!min || alt < min) min = alt;
				if (!max || alt > max) max = alt;
				alts.push(alt);
			}
			if (weight < min) weight = min;
			if (weight > max) weight = max;
			alts.sort(function(a, b) {
				return (up
					? (a >= weight && b >= weight) ? a < b : a > b
					: (a <= weight && b <= weight) ? a > b : a < b) ? -1 : 1;
			});
			return weights[alts[0]];
		};

	}

	function HoverHandler() {

		function contains(node, anotherNode) {
			try {
				if (node.contains) return node.contains(anotherNode);
				return node.compareDocumentPosition(anotherNode) & 16;
			}
			catch(e) {} // probably a XUL element such as a scrollbar
			return false;
		}

		// mouseover/mouseout (standards) mode
		function onOverOut(e) {
			var related = e.relatedTarget;
			// there might be no relatedTarget if the element is right next
			// to the window frame
			if (related && contains(this, related)) return;
			trigger(this, e.type == 'mouseover');
		}

		// mouseenter/mouseleave (probably ie) mode
		function onEnterLeave(e) {
			if (!e) e = window.event;
			// ie model, we don't have access to "this", but
			// mouseenter/leave doesn't bubble so it's fine.
			trigger(e.target || e.srcElement, e.type == 'mouseenter');
		}

		function trigger(el, hoverState) {
			// A timeout is needed so that the event can actually "happen"
			// before replace is triggered. This ensures that styles are up
			// to date.
			setTimeout(function() {
				var options = sharedStorage.get(el).options;
				if (hoverState) {
					options = merge(options, options.hover);
					options._mediatorMode = 1;
				}
				api.replace(el, options, true);
			}, 10);
		}

		this.attach = function(el) {
			if (el.onmouseenter === undefined) {
				addEvent(el, 'mouseover', onOverOut);
				addEvent(el, 'mouseout', onOverOut);
			}
			else {
				addEvent(el, 'mouseenter', onEnterLeave);
				addEvent(el, 'mouseleave', onEnterLeave);
			}
		};

		this.detach = function(el) {
			if (el.onmouseenter === undefined) {
				removeEvent(el, 'mouseover', onOverOut);
				removeEvent(el, 'mouseout', onOverOut);
			}
			else {
				removeEvent(el, 'mouseenter', onEnterLeave);
				removeEvent(el, 'mouseleave', onEnterLeave);
			}
		};

	}

	function ReplaceHistory() {

		var list = [], map = {};

		function filter(keys) {
			var values = [], key;
			for (var i = 0; key = keys[i]; ++i) values[i] = list[map[key]];
			return values;
		}

		this.add = function(key, args) {
			map[key] = list.push(args) - 1;
		};

		this.repeat = function() {
			var snapshot = arguments.length ? filter(arguments) : list, args;
			for (var i = 0; args = snapshot[i++];) api.replace(args[0], args[1], true);
		};

	}

	function Storage() {

		var map = {}, at = 0;

		function identify(el) {
			return el.cufid || (el.cufid = ++at);
		}

		this.get = function(el) {
			var id = identify(el);
			return map[id] || (map[id] = {});
		};

	}

	function Style(style) {

		var custom = {}, sizes = {};

		this.extend = function(styles) {
			for (var property in styles) {
				if (hasOwnProperty(styles, property)) custom[property] = styles[property];
			}
			return this;
		};

		this.get = function(property) {
			return custom[property] != undefined ? custom[property] : style[property];
		};

		this.getSize = function(property, base) {
			return sizes[property] || (sizes[property] = new CSS.Size(this.get(property), base));
		};

		this.isUsable = function() {
			return !!style;
		};

	}

	function addEvent(el, type, listener) {
		if (el.addEventListener) {
			el.addEventListener(type, listener, false);
		}
		else if (el.attachEvent) {
			// we don't really need "this" right now, saves code
			el.attachEvent('on' + type, listener);
		}
	}

	function attach(el, options) {
		if (options._mediatorMode) return el;
		var storage = sharedStorage.get(el);
		var oldOptions = storage.options;
		if (oldOptions) {
			if (oldOptions === options) return el;
			if (oldOptions.hover) hoverHandler.detach(el);
		}
		if (options.hover && options.hoverables[el.nodeName.toLowerCase()]) {
			hoverHandler.attach(el);
		}
		storage.options = options;
		return el;
	}

	function cached(fun) {
		var cache = {};
		return function(key) {
			if (!hasOwnProperty(cache, key)) cache[key] = fun.apply(null, arguments);
			return cache[key];
		};
	}

	function getFont(el, style) {
		var families = CSS.quotedList(style.get('fontFamily').toLowerCase()), family;
		for (var i = 0; family = families[i]; ++i) {
			if (fonts[family]) return fonts[family].get(style.get('fontStyle'), style.get('fontWeight'));
		}
		return null;
	}

	function elementsByTagName(query) {
		return document.getElementsByTagName(query);
	}

	function hasOwnProperty(obj, property) {
		return obj.hasOwnProperty(property);
	}

	function merge() {
		var merged = {}, arg, key;
		for (var i = 0, l = arguments.length; arg = arguments[i], i < l; ++i) {
			for (key in arg) {
				if (hasOwnProperty(arg, key)) merged[key] = arg[key];
			}
		}
		return merged;
	}

	function process(font, text, style, options, node, el) {
		var fragment = document.createDocumentFragment(), processed;
		if (text === '') return fragment;
		var separate = options.separate;
		var parts = text.split(separators[separate]), needsAligning = (separate == 'words');
		if (needsAligning && HAS_BROKEN_REGEXP) {
			// @todo figure out a better way to do this
			if (/^\s/.test(text)) parts.unshift('');
			if (/\s$/.test(text)) parts.push('');
		}
		for (var i = 0, l = parts.length; i < l; ++i) {
			processed = engines[options.engine](font,
				needsAligning ? CSS.textAlign(parts[i], style, i, l) : parts[i],
				style, options, node, el, i < l - 1);
			if (processed) fragment.appendChild(processed);
		}
		return fragment;
	}

	function removeEvent(el, type, listener) {
		if (el.removeEventListener) {
			el.removeEventListener(type, listener, false);
		}
		else if (el.detachEvent) {
			el.detachEvent('on' + type, listener);
		}
	}

	function replaceElement(el, options) {
		var name = el.nodeName.toLowerCase();
		if (options.ignore[name]) return;
		if (options.ignoreClass && options.ignoreClass.test(el.className)) return;
		if (options.onBeforeReplace) options.onBeforeReplace(el, options);
		var replace = !options.textless[name], simple = (options.trim === 'simple');
		var style = CSS.getStyle(attach(el, options)).extend(options);
		// may cause issues if the element contains other elements
		// with larger fontSize, however such cases are rare and can
		// be fixed by using a more specific selector
		if (parseFloat(style.get('fontSize')) === 0) return;
		var font = getFont(el, style), node, type, next, anchor, text, lastElement;
		var isShy = options.softHyphens, anyShy = false, pos, shy, reShy = /\u00ad/g;
		var modifyText = options.modifyText;
		if (!font) return;
		for (node = el.firstChild; node; node = next) {
			type = node.nodeType;
			next = node.nextSibling;
			if (replace && type == 3) {
				if (isShy && el.nodeName.toLowerCase() != TAG_SHY) {
					pos = node.data.indexOf('\u00ad');
					if (pos >= 0) {
						node.splitText(pos);
						next = node.nextSibling;
						next.deleteData(0, 1);
						shy = document.createElement(TAG_SHY);
						shy.appendChild(document.createTextNode('\u00ad'));
						el.insertBefore(shy, next);
						next = shy;
						anyShy = true;
					}
				}
				// Node.normalize() is broken in IE 6, 7, 8
				if (anchor) {
					anchor.appendData(node.data);
					el.removeChild(node);
				}
				else anchor = node;
				if (next) continue;
			}
			if (anchor) {
				text = anchor.data;
				if (!isShy) text = text.replace(reShy, '');
				text = CSS.whiteSpace(text, style, anchor, lastElement, simple);
				// modify text only on the first replace
				if (modifyText) text = modifyText(text, anchor, el, options);
				el.replaceChild(process(font, text, style, options, node, el), anchor);
				anchor = null;
			}
			if (type == 1) {
				if (node.firstChild) {
					if (node.nodeName.toLowerCase() == 'cufon') {
						engines[options.engine](font, null, style, options, node, el);
					}
					else arguments.callee(node, options);
				}
				lastElement = node;
			}
		}
		if (isShy && anyShy) {
			updateShy(el);
			if (!trackingShy) addEvent(window, 'resize', updateShyOnResize);
			trackingShy = true;
		}
		if (options.onAfterReplace) options.onAfterReplace(el, options);
	}

	function updateShy(context) {
		var shys, shy, parent, glue, newGlue, next, prev, i;
		shys = context.getElementsByTagName(TAG_SHY);
		// unfortunately there doesn't seem to be any easy
		// way to avoid having to loop through the shys twice.
		for (i = 0; shy = shys[i]; ++i) {
			shy.className = C_SHY_DISABLED;
			glue = parent = shy.parentNode;
			if (glue.nodeName.toLowerCase() != TAG_GLUE) {
				newGlue = document.createElement(TAG_GLUE);
				newGlue.appendChild(shy.previousSibling);
				parent.insertBefore(newGlue, shy);
				newGlue.appendChild(shy);
			}
			else {
				// get rid of double glue (edge case fix)
				glue = glue.parentNode;
				if (glue.nodeName.toLowerCase() == TAG_GLUE) {
					parent = glue.parentNode;
					while (glue.firstChild) {
						parent.insertBefore(glue.firstChild, glue);
					}
					parent.removeChild(glue);
				}
			}
		}
		for (i = 0; shy = shys[i]; ++i) {
			shy.className = '';
			glue = shy.parentNode;
			parent = glue.parentNode;
			next = glue.nextSibling || parent.nextSibling;
			// make sure we're comparing same types
			prev = (next.nodeName.toLowerCase() == TAG_GLUE) ? glue : shy.previousSibling;
			if (prev.offsetTop >= next.offsetTop) {
				shy.className = C_SHY_DISABLED;
				if (prev.offsetTop < next.offsetTop) {
					// we have an annoying edge case, double the glue
					newGlue = document.createElement(TAG_GLUE);
					parent.insertBefore(newGlue, glue);
					newGlue.appendChild(glue);
					newGlue.appendChild(next);
				}
			}
		}
	}

	function updateShyOnResize() {
		if (ignoreResize) return; // needed for IE
		CSS.addClass(DOM.root(), C_VIEWPORT_RESIZING);
		clearTimeout(shyTimer);
		shyTimer = setTimeout(function() {
			ignoreResize = true;
			CSS.removeClass(DOM.root(), C_VIEWPORT_RESIZING);
			updateShy(document);
			ignoreResize = false;
		}, 100);
	}

	var HAS_BROKEN_REGEXP = ' '.split(/\s+/).length == 0;
	var TAG_GLUE = 'cufonglue';
	var TAG_SHY = 'cufonshy';
	var C_SHY_DISABLED = 'cufon-shy-disabled';
	var C_VIEWPORT_RESIZING = 'cufon-viewport-resizing';

	var sharedStorage = new Storage();
	var hoverHandler = new HoverHandler();
	var replaceHistory = new ReplaceHistory();
	var initialized = false;
	var trackingShy = false;
	var shyTimer;
	var ignoreResize = false;

	var engines = {}, fonts = {}, defaultOptions = {
		autoDetect: false,
		engine: null,
		forceHitArea: false,
		hover: false,
		hoverables: {
			a: true
		},
		ignore: {
			applet: 1,
			canvas: 1,
			col: 1,
			colgroup: 1,
			head: 1,
			iframe: 1,
			map: 1,
			noscript: 1,
			optgroup: 1,
			option: 1,
			script: 1,
			select: 1,
			style: 1,
			textarea: 1,
			title: 1,
			pre: 1
		},
		ignoreClass: null,
		modifyText: null,
		onAfterReplace: null,
		onBeforeReplace: null,
		printable: true,
		selector: (
				window.Sizzle
			||	(window.jQuery && function(query) { return jQuery(query); }) // avoid noConflict issues
			||	(window.dojo && dojo.query)
			||	(window.glow && glow.dom && glow.dom.get)
			||	(window.Ext && Ext.query)
			||	(window.YAHOO && YAHOO.util && YAHOO.util.Selector && YAHOO.util.Selector.query)
			||	(window.$$ && function(query) { return $$(query); })
			||	(window.$ && function(query) { return $(query); })
			||	(document.querySelectorAll && function(query) { return document.querySelectorAll(query); })
			||	elementsByTagName
		),
		separate: 'words', // 'none' and 'characters' are also accepted
		softHyphens: true,
		textless: {
			dl: 1,
			html: 1,
			ol: 1,
			table: 1,
			tbody: 1,
			thead: 1,
			tfoot: 1,
			tr: 1,
			ul: 1
		},
		textShadow: 'none',
		trim: 'advanced'
	};

	var separators = {
		// The first pattern may cause unicode characters above
		// code point 255 to be removed in Safari 3.0. Luckily enough
		// Safari 3.0 does not include non-breaking spaces in \s, so
		// we can just use a simple alternative pattern.
		words: /\s/.test('\u00a0') ? /[^\S\u00a0]+/ : /\s+/,
		characters: '',
		none: /^/
	};

	api.now = function() {
		DOM.ready();
		return api;
	};

	api.refresh = function() {
		replaceHistory.repeat.apply(replaceHistory, arguments);
		return api;
	};

	api.registerEngine = function(id, engine) {
		if (!engine) return api;
		engines[id] = engine;
		return api.set('engine', id);
	};

	api.registerFont = function(data) {
		if (!data) return api;
		var font = new Font(data), family = font.family;
		if (!fonts[family]) fonts[family] = new FontFamily();
		fonts[family].add(font);
		return api.set('fontFamily', '"' + family + '"');
	};

	api.replace = function(elements, options, ignoreHistory) {
		options = merge(defaultOptions, options);
		if (!options.engine) return api; // there's no browser support so we'll just stop here
		if (!initialized) {
			CSS.addClass(DOM.root(), 'cufon-active cufon-loading');
			CSS.ready(function() {
				// fires before any replace() calls, but it doesn't really matter
				CSS.addClass(CSS.removeClass(DOM.root(), 'cufon-loading'), 'cufon-ready');
			});
			initialized = true;
		}
		if (options.hover) options.forceHitArea = true;
		if (options.autoDetect) delete options.fontFamily;
		if (typeof options.ignoreClass == 'string') {
			options.ignoreClass = new RegExp('(?:^|\\s)(?:' + options.ignoreClass.replace(/\s+/g, '|') + ')(?:\\s|$)');
		}
		if (typeof options.textShadow == 'string') {
			options.textShadow = CSS.textShadow(options.textShadow);
		}
		if (typeof options.color == 'string' && /^-/.test(options.color)) {
			options.textGradient = CSS.gradient(options.color);
		}
		else delete options.textGradient;
		if (!ignoreHistory) replaceHistory.add(elements, arguments);
		if (elements.nodeType || typeof elements == 'string') elements = [ elements ];
		CSS.ready(function() {
			for (var i = 0, l = elements.length; i < l; ++i) {
				var el = elements[i];
				if (typeof el == 'string') api.replace(options.selector(el), options, true);
				else replaceElement(el, options);
			}
		});
		return api;
	};

	api.set = function(option, value) {
		defaultOptions[option] = value;
		return api;
	};

	return api;

})();

Cufon.registerEngine('vml', (function() {

	var ns = document.namespaces;
	if (!ns) return;
	ns.add('cvml', 'urn:schemas-microsoft-com:vml');
	ns = null;

	var check = document.createElement('cvml:shape');
	check.style.behavior = 'url(#default#VML)';
	if (!check.coordsize) return; // VML isn't supported
	check = null;

	var HAS_BROKEN_LINEHEIGHT = (document.documentMode || 0) < 8;

	document.write(('<style type="text/css">' +
		'cufoncanvas{text-indent:0;}' +
		'@media screen{' +
			'cvml\\:shape,cvml\\:rect,cvml\\:fill,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute;}' +
			'cufoncanvas{position:absolute;text-align:left;}' +
			'cufon{display:inline-block;position:relative;vertical-align:' +
			(HAS_BROKEN_LINEHEIGHT
				? 'middle'
				: 'text-bottom') +
			';}' +
			'cufon cufontext{position:absolute;left:-10000in;font-size:1px;text-align:left;}' +
			'cufonshy.cufon-shy-disabled,.cufon-viewport-resizing cufonshy{display:none;}' +
			'cufonglue{white-space:nowrap;display:inline-block;}' +
			'.cufon-viewport-resizing cufonglue{white-space:normal;}' +
			'a cufon{cursor:pointer}' + // ignore !important here
		'}' +
		'@media print{' +
			'cufon cufoncanvas{display:none;}' +
		'}' +
	'</style>').replace(/;/g, '!important;'));

	function getFontSizeInPixels(el, value) {
		return getSizeInPixels(el, /(?:em|ex|%)$|^[a-z-]+$/i.test(value) ? '1em' : value);
	}

	// Original by Dead Edwards.
	// Combined with getFontSizeInPixels it also works with relative units.
	function getSizeInPixels(el, value) {
		if (!isNaN(value) || /px$/i.test(value)) return parseFloat(value);
		var style = el.style.left, runtimeStyle = el.runtimeStyle.left;
		el.runtimeStyle.left = el.currentStyle.left;
		el.style.left = value.replace('%', 'em');
		var result = el.style.pixelLeft;
		el.style.left = style;
		el.runtimeStyle.left = runtimeStyle;
		return result;
	}

	function getSpacingValue(el, style, size, property) {
		var key = 'computed' + property, value = style[key];
		if (isNaN(value)) {
			value = style.get(property);
			style[key] = value = (value == 'normal') ? 0 : ~~size.convertFrom(getSizeInPixels(el, value));
		}
		return value;
	}

	var fills = {};

	function gradientFill(gradient) {
		var id = gradient.id;
		if (!fills[id]) {
			var stops = gradient.stops, fill = document.createElement('cvml:fill'), colors = [];
			fill.type = 'gradient';
			fill.angle = 180;
			fill.focus = '0';
			fill.method = 'none';
			fill.color = stops[0][1];
			for (var j = 1, k = stops.length - 1; j < k; ++j) {
				colors.push(stops[j][0] * 100 + '% ' + stops[j][1]);
			}
			fill.colors = colors.join(',');
			fill.color2 = stops[k][1];
			fills[id] = fill;
		}
		return fills[id];
	}

	return function(font, text, style, options, node, el, hasNext) {

		var redraw = (text === null);

		if (redraw) text = node.alt;

		var viewBox = font.viewBox;

		var size = style.computedFontSize || (style.computedFontSize = new Cufon.CSS.Size(getFontSizeInPixels(el, style.get('fontSize')) + 'px', font.baseSize));

		var wrapper, canvas;

		if (redraw) {
			wrapper = node;
			canvas = node.firstChild;
		}
		else {
			wrapper = document.createElement('cufon');
			wrapper.className = 'cufon cufon-vml';
			wrapper.alt = text;

			canvas = document.createElement('cufoncanvas');
			wrapper.appendChild(canvas);

			if (options.printable) {
				var print = document.createElement('cufontext');
				print.appendChild(document.createTextNode(text));
				wrapper.appendChild(print);
			}

			// ie6, for some reason, has trouble rendering the last VML element in the document.
			// we can work around this by injecting a dummy element where needed.
			// @todo find a better solution
			if (!hasNext) wrapper.appendChild(document.createElement('cvml:shape'));
		}

		var wStyle = wrapper.style;
		var cStyle = canvas.style;

		var height = size.convert(viewBox.height), roundedHeight = Math.ceil(height);
		var roundingFactor = roundedHeight / height;
		var stretchFactor = roundingFactor * Cufon.CSS.fontStretch(style.get('fontStretch'));
		var minX = viewBox.minX, minY = viewBox.minY;

		cStyle.height = roundedHeight;
		cStyle.top = Math.round(size.convert(minY - font.ascent));
		cStyle.left = Math.round(size.convert(minX));

		wStyle.height = size.convert(font.height) + 'px';

		var color = style.get('color');
		var chars = Cufon.CSS.textTransform(text, style).split('');

		var jumps = font.spacing(chars,
			getSpacingValue(el, style, size, 'letterSpacing'),
			getSpacingValue(el, style, size, 'wordSpacing')
		);

		if (!jumps.length) return null;

		var width = jumps.total;
		var fullWidth = -minX + width + (viewBox.width - jumps[jumps.length - 1]);

		var shapeWidth = size.convert(fullWidth * stretchFactor), roundedShapeWidth = Math.round(shapeWidth);

		var coordSize = fullWidth + ',' + viewBox.height, coordOrigin;
		var stretch = 'r' + coordSize + 'ns';

		var fill = options.textGradient && gradientFill(options.textGradient);

		var glyphs = font.glyphs, offsetX = 0;
		var shadows = options.textShadow;
		var i = -1, j = 0, chr;

		while (chr = chars[++i]) {

			var glyph = glyphs[chars[i]] || font.missingGlyph, shape;
			if (!glyph) continue;

			if (redraw) {
				// some glyphs may be missing so we can't use i
				shape = canvas.childNodes[j];
				while (shape.firstChild) shape.removeChild(shape.firstChild); // shadow, fill
			}
			else {
				shape = document.createElement('cvml:shape');
				canvas.appendChild(shape);
			}

			shape.stroked = 'f';
			shape.coordsize = coordSize;
			shape.coordorigin = coordOrigin = (minX - offsetX) + ',' + minY;
			shape.path = (glyph.d ? 'm' + glyph.d + 'xe' : '') + 'm' + coordOrigin + stretch;
			shape.fillcolor = color;

			if (fill) shape.appendChild(fill.cloneNode(false));

			// it's important to not set top/left or IE8 will grind to a halt
			var sStyle = shape.style;
			sStyle.width = roundedShapeWidth;
			sStyle.height = roundedHeight;

			if (shadows) {
				// due to the limitations of the VML shadow element there
				// can only be two visible shadows. opacity is shared
				// for all shadows.
				var shadow1 = shadows[0], shadow2 = shadows[1];
				var color1 = Cufon.CSS.color(shadow1.color), color2;
				var shadow = document.createElement('cvml:shadow');
				shadow.on = 't';
				shadow.color = color1.color;
				shadow.offset = shadow1.offX + ',' + shadow1.offY;
				if (shadow2) {
					color2 = Cufon.CSS.color(shadow2.color);
					shadow.type = 'double';
					shadow.color2 = color2.color;
					shadow.offset2 = shadow2.offX + ',' + shadow2.offY;
				}
				shadow.opacity = color1.opacity || (color2 && color2.opacity) || 1;
				shape.appendChild(shadow);
			}

			offsetX += jumps[j++];
		}

		// addresses flickering issues on :hover

		var cover = shape.nextSibling, coverFill, vStyle;

		if (options.forceHitArea) {

			if (!cover) {
				cover = document.createElement('cvml:rect');
				cover.stroked = 'f';
				cover.className = 'cufon-vml-cover';
				coverFill = document.createElement('cvml:fill');
				coverFill.opacity = 0;
				cover.appendChild(coverFill);
				canvas.appendChild(cover);
			}

			vStyle = cover.style;

			vStyle.width = roundedShapeWidth;
			vStyle.height = roundedHeight;

		}
		else if (cover) canvas.removeChild(cover);

		wStyle.width = Math.max(Math.ceil(size.convert(width * stretchFactor)), 0);

		if (HAS_BROKEN_LINEHEIGHT) {

			var yAdjust = style.computedYAdjust;

			if (yAdjust === undefined) {
				var lineHeight = style.get('lineHeight');
				if (lineHeight == 'normal') lineHeight = '1em';
				else if (!isNaN(lineHeight)) lineHeight += 'em'; // no unit
				style.computedYAdjust = yAdjust = 0.5 * (getSizeInPixels(el, lineHeight) - parseFloat(wStyle.height));
			}

			if (yAdjust) {
				wStyle.marginTop = Math.ceil(yAdjust) + 'px';
				wStyle.marginBottom = yAdjust + 'px';
			}

		}

		return wrapper;

	};

})());

Cufon.registerEngine('canvas', (function() {

	// Safari 2 doesn't support .apply() on native methods

	var check = document.createElement('canvas');
	if (!check || !check.getContext || !check.getContext.apply) return;
	check = null;

	var HAS_INLINE_BLOCK = Cufon.CSS.supports('display', 'inline-block');

	// Firefox 2 w/ non-strict doctype (almost standards mode)
	var HAS_BROKEN_LINEHEIGHT = !HAS_INLINE_BLOCK && (document.compatMode == 'BackCompat' || /frameset|transitional/i.test(document.doctype.publicId));

	var styleSheet = document.createElement('style');
	styleSheet.type = 'text/css';
	styleSheet.appendChild(document.createTextNode((
		'cufon{text-indent:0;}' +
		'@media screen,projection{' +
			'cufon{display:inline;display:inline-block;position:relative;vertical-align:middle;' +
			(HAS_BROKEN_LINEHEIGHT
				? ''
				: 'font-size:1px;line-height:1px;') +
			'}cufon cufontext{display:-moz-inline-box;display:inline-block;width:0;height:0;text-align:left;text-indent:-10000in;}' +
			(HAS_INLINE_BLOCK
				? 'cufon canvas{position:relative;}'
				: 'cufon canvas{position:absolute;}') +
			'cufonshy.cufon-shy-disabled,.cufon-viewport-resizing cufonshy{display:none;}' +
			'cufonglue{white-space:nowrap;display:inline-block;}' +
			'.cufon-viewport-resizing cufonglue{white-space:normal;}' +
		'}' +
		'@media print{' +
			'cufon{padding:0;}' + // Firefox 2
			'cufon canvas{display:none;}' +
		'}'
	).replace(/;/g, '!important;')));
	document.getElementsByTagName('head')[0].appendChild(styleSheet);

	function generateFromVML(path, context) {
		var atX = 0, atY = 0;
		var code = [], re = /([mrvxe])([^a-z]*)/g, match;
		generate: for (var i = 0; match = re.exec(path); ++i) {
			var c = match[2].split(',');
			switch (match[1]) {
				case 'v':
					code[i] = { m: 'bezierCurveTo', a: [ atX + ~~c[0], atY + ~~c[1], atX + ~~c[2], atY + ~~c[3], atX += ~~c[4], atY += ~~c[5] ] };
					break;
				case 'r':
					code[i] = { m: 'lineTo', a: [ atX += ~~c[0], atY += ~~c[1] ] };
					break;
				case 'm':
					code[i] = { m: 'moveTo', a: [ atX = ~~c[0], atY = ~~c[1] ] };
					break;
				case 'x':
					code[i] = { m: 'closePath' };
					break;
				case 'e':
					break generate;
			}
			context[code[i].m].apply(context, code[i].a);
		}
		return code;
	}

	function interpret(code, context) {
		for (var i = 0, l = code.length; i < l; ++i) {
			var line = code[i];
			context[line.m].apply(context, line.a);
		}
	}

	return function(font, text, style, options, node, el) {

		var redraw = (text === null);

		if (redraw) text = node.getAttribute('alt');

		var viewBox = font.viewBox;

		var size = style.getSize('fontSize', font.baseSize);

		var expandTop = 0, expandRight = 0, expandBottom = 0, expandLeft = 0;
		var shadows = options.textShadow, shadowOffsets = [];
		if (shadows) {
			for (var i = shadows.length; i--;) {
				var shadow = shadows[i];
				var x = size.convertFrom(parseFloat(shadow.offX));
				var y = size.convertFrom(parseFloat(shadow.offY));
				shadowOffsets[i] = [ x, y ];
				if (y < expandTop) expandTop = y;
				if (x > expandRight) expandRight = x;
				if (y > expandBottom) expandBottom = y;
				if (x < expandLeft) expandLeft = x;
			}
		}

		var chars = Cufon.CSS.textTransform(text, style).split('');

		var jumps = font.spacing(chars,
			~~size.convertFrom(parseFloat(style.get('letterSpacing')) || 0),
			~~size.convertFrom(parseFloat(style.get('wordSpacing')) || 0)
		);

		if (!jumps.length) return null; // there's nothing to render

		var width = jumps.total;

		expandRight += viewBox.width - jumps[jumps.length - 1];
		expandLeft += viewBox.minX;

		var wrapper, canvas;

		if (redraw) {
			wrapper = node;
			canvas = node.firstChild;
		}
		else {
			wrapper = document.createElement('cufon');
			wrapper.className = 'cufon cufon-canvas';
			wrapper.setAttribute('alt', text);

			canvas = document.createElement('canvas');
			wrapper.appendChild(canvas);

			if (options.printable) {
				var print = document.createElement('cufontext');
				print.appendChild(document.createTextNode(text));
				wrapper.appendChild(print);
			}
		}

		var wStyle = wrapper.style;
		var cStyle = canvas.style;

		var height = size.convert(viewBox.height);
		var roundedHeight = Math.ceil(height);
		var roundingFactor = roundedHeight / height;
		var stretchFactor = roundingFactor * Cufon.CSS.fontStretch(style.get('fontStretch'));
		var stretchedWidth = width * stretchFactor;

		var canvasWidth = Math.ceil(size.convert(stretchedWidth + expandRight - expandLeft));
		var canvasHeight = Math.ceil(size.convert(viewBox.height - expandTop + expandBottom));

		canvas.width = canvasWidth;
		canvas.height = canvasHeight;

		// needed for WebKit and full page zoom
		cStyle.width = canvasWidth + 'px';
		cStyle.height = canvasHeight + 'px';

		// minY has no part in canvas.height
		expandTop += viewBox.minY;

		cStyle.top = Math.round(size.convert(expandTop - font.ascent)) + 'px';
		cStyle.left = Math.round(size.convert(expandLeft)) + 'px';

		var wrapperWidth = Math.max(Math.ceil(size.convert(stretchedWidth)), 0) + 'px';

		if (HAS_INLINE_BLOCK) {
			wStyle.width = wrapperWidth;
			wStyle.height = size.convert(font.height) + 'px';
		}
		else {
			wStyle.paddingLeft = wrapperWidth;
			wStyle.paddingBottom = (size.convert(font.height) - 1) + 'px';
		}

		var g = canvas.getContext('2d'), scale = height / viewBox.height;

		// proper horizontal scaling is performed later
		g.scale(scale, scale * roundingFactor);
		g.translate(-expandLeft, -expandTop);
		g.save();

		function renderText() {
			var glyphs = font.glyphs, glyph, i = -1, j = -1, chr;
			g.scale(stretchFactor, 1);
			while (chr = chars[++i]) {
				var glyph = glyphs[chars[i]] || font.missingGlyph;
				if (!glyph) continue;
				if (glyph.d) {
					g.beginPath();
					if (glyph.code) interpret(glyph.code, g);
					else glyph.code = generateFromVML('m' + glyph.d, g);
					g.fill();
				}
				g.translate(jumps[++j], 0);
			}
			g.restore();
		}

		if (shadows) {
			for (var i = shadows.length; i--;) {
				var shadow = shadows[i];
				g.save();
				g.fillStyle = shadow.color;
				g.translate.apply(g, shadowOffsets[i]);
				renderText();
			}
		}

		var gradient = options.textGradient;
		if (gradient) {
			var stops = gradient.stops, fill = g.createLinearGradient(0, viewBox.minY, 0, viewBox.maxY);
			for (var i = 0, l = stops.length; i < l; ++i) {
				fill.addColorStop.apply(fill, stops[i]);
			}
			g.fillStyle = fill;
		}
		else g.fillStyle = style.get('color');

		renderText();

		return wrapper;

	};

})());

//-------------------------------------------------------------------------------------------------------------------------

/*!
* The following copyright notice may not be removed under any circumstances.
* 
* Copyright:
* Copyright (c) 1991 Adobe Systems Incorporated.  All Rights Reserved.Barmeno is
* a trademark of H. Berthold AG.
* 
* Manufacturer:
* Adobe Systems Incorporated
*/
Cufon.registerFont({ "w": 195, "face": { "font-family": "Barmeno", "font-weight": 400, "font-stretch": "normal", "units-per-em": "360", "panose-1": "2 0 5 6 5 0 0 2 0 4", "ascent": "275", "descent": "-85", "x-height": "4", "bbox": "-39.5571 -311 306.704 90", "underline-thickness": "18", "underline-position": "-18", "unicode-range": "U+0020-U+007E" }, "glyphs": { " ": { "w": 90 }, "\u00a0": { "w": 90 }, "$": { "d": "83,-241v-45,-2,-54,67,-15,82v5,2,10,6,15,8r0,-90xm96,-16v45,4,57,-56,28,-79v-8,-6,-19,-13,-28,-16r0,95xm13,-194v0,-44,29,-63,70,-66v2,-12,-7,-35,13,-28r0,28v31,4,57,15,62,43v1,7,-7,14,-13,14v-23,-4,-18,-38,-49,-37r0,95v34,17,74,30,74,79v0,45,-31,67,-74,71r0,29v-17,5,-13,-13,-13,-29v-38,-1,-67,-20,-73,-53v-2,-13,18,-21,25,-10v11,18,19,41,48,42r0,-102v-33,-17,-70,-29,-70,-76", "w": 180 }, "%": { "d": "216,-251r-132,250v-7,1,-19,3,-13,-8r131,-244v3,-3,14,-3,14,2xm225,-11v26,-4,26,-43,26,-70v0,-27,-1,-64,-26,-68v-25,3,-26,40,-26,67v0,29,2,65,26,71xm225,-162v67,0,65,165,0,165v-39,0,-48,-39,-48,-82v0,-42,9,-83,48,-83xm60,-107v26,-4,26,-42,26,-69v0,-28,-1,-64,-26,-68v-25,3,-26,40,-26,67v0,28,1,65,26,70xm60,-258v67,5,65,160,0,166v-67,-5,-66,-161,0,-166", "w": 285 }, "&": { "d": "112,-241v-36,-2,-43,49,-20,70v3,5,7,10,12,16v18,-11,41,-23,41,-52v0,-20,-14,-34,-33,-34xm39,-67v-3,40,50,59,75,30v8,-8,14,-19,21,-29r-47,-60v-21,14,-47,27,-49,59xm224,-123v-6,25,-51,9,-61,43r57,76v-4,8,-37,6,-40,-4r-34,-44v-16,26,-33,55,-75,57v-64,3,-81,-82,-37,-116v13,-10,29,-20,43,-29v-14,-20,-29,-34,-29,-64v0,-34,26,-57,66,-56v33,2,58,16,58,50v0,40,-34,53,-58,69r38,47v13,-18,26,-41,56,-42v11,-1,16,5,16,13", "w": 225 }, "(": { "d": "102,-296v-27,39,-50,99,-50,169v0,71,20,125,51,169v-1,9,-8,5,-15,0v-82,-60,-93,-252,-15,-324v7,-7,22,-30,29,-14", "w": 105 }, ")": { "d": "3,42v64,-79,67,-259,-1,-338v16,-16,33,20,44,33v62,70,48,236,-14,291v-7,7,-21,30,-29,14", "w": 105 }, "*": { "d": "42,-244v-4,-17,-36,-5,-35,-27v11,-32,23,15,40,13v15,-10,-13,-51,9,-53v17,4,4,30,6,49v13,14,24,-20,35,-21v16,6,6,29,-10,27v-6,3,-17,4,-17,12v3,15,37,6,35,27v-2,19,-17,7,-21,-1v-5,-4,-10,-13,-17,-13v-18,7,12,47,-11,53v-21,-4,5,-40,-10,-52v-14,0,-19,21,-31,24v-13,-3,-7,-28,6,-26v8,-1,20,-3,21,-12", "w": 112 }, "+": { "d": "169,-94r-68,0r0,68r-22,0r0,-68r-68,0r0,-22r68,0r0,-67r22,0r0,67r68,0r0,22", "w": 180 }, ",": { "d": "41,4v-1,-13,-19,-13,-19,-29v0,-11,10,-18,20,-17v46,6,20,82,-13,86v-20,-8,14,-24,12,-40", "w": 90 }, "-": { "d": "27,-87v-9,1,-7,-18,-4,-25v18,-3,42,0,62,-1v11,-1,6,13,7,22v-13,10,-45,1,-65,4", "w": 112 }, "\u00ad": { "d": "27,-87v-9,1,-7,-18,-4,-25v18,-3,42,0,62,-1v11,-1,6,13,7,22v-13,10,-45,1,-65,4", "w": 112 }, ".": { "d": "45,-42v13,0,23,9,22,23v0,11,-10,21,-22,21v-12,0,-24,-9,-23,-22v0,-14,9,-22,23,-22", "w": 90 }, "\/": { "d": "133,-302v6,-2,23,2,20,11r-127,336v-4,9,-25,1,-21,-9", "w": 157 }, "0": { "d": "97,-16v47,-9,42,-80,42,-134v0,-39,-4,-86,-42,-90v-41,8,-42,62,-42,109v0,50,1,106,42,115xm98,-260v61,6,76,67,76,131v0,67,-14,134,-77,134v-61,0,-76,-64,-76,-131v0,-68,16,-127,77,-134" }, "1": { "d": "33,-187v-14,6,-22,-9,-13,-15v37,-11,72,-25,91,-53v7,-5,16,0,14,8r-1,246v-8,0,-30,6,-30,-5r0,-201v-19,10,-39,16,-61,20" }, "2": { "d": "99,-260v69,-3,80,82,44,128r-81,102r99,0v13,-2,8,15,7,26v0,3,-2,4,-6,4r-140,-1v-5,-1,-2,-7,1,-12v33,-44,72,-90,101,-138v27,-44,-13,-105,-58,-71v-10,8,-16,26,-20,42v-5,8,-21,4,-19,-9v5,-41,28,-69,72,-71" }, "3": { "d": "157,-204v0,30,-19,45,-40,58v31,14,53,35,53,74v0,46,-28,77,-80,77v-39,0,-66,-19,-73,-50v0,-9,8,-17,16,-17v26,9,22,46,60,46v51,0,58,-74,20,-95v-8,-8,-30,-14,-44,-18v-11,-18,27,-16,36,-30v39,-20,11,-95,-36,-71v-15,7,-19,26,-27,39v-5,8,-17,2,-16,-8v4,-37,29,-61,69,-61v36,0,62,21,62,56" }, "4": { "d": "108,-79r0,-124r-66,124r66,0xm139,-79v18,-1,37,-3,27,19v-6,2,-19,1,-27,1r0,55v0,12,-20,5,-30,5v-3,-17,0,-41,-1,-60r-92,-1v-6,-3,-1,-11,2,-16r103,-178v7,-8,20,1,18,11r0,164" }, "5": { "d": "152,-255v14,1,12,34,0,31r-90,0r-7,81v55,-25,122,2,119,68v-3,50,-29,80,-80,80v-38,0,-66,-16,-71,-49v25,-46,32,32,72,28v29,-3,47,-19,47,-52v0,-57,-61,-70,-105,-46v-6,1,-5,-6,-5,-12r9,-120v1,-7,1,-9,9,-9r102,0" }, "6": { "d": "144,-64v5,-50,-57,-72,-90,-38v0,48,9,87,49,87v28,0,39,-22,41,-49xm22,-93v0,-92,53,-152,132,-167v15,0,11,16,0,17v-55,18,-89,59,-98,122v38,-37,126,-21,119,50v-4,45,-26,76,-73,76v-57,0,-80,-40,-80,-98" }, "7": { "d": "33,-225v-11,1,-4,-14,-6,-25v0,-3,2,-4,6,-4r140,1v9,11,-7,31,-11,43r-59,159v-9,20,-5,39,-17,51v-14,-1,-41,7,-32,-13r91,-212r-112,0" }, "8": { "d": "97,-240v-38,-2,-46,45,-24,67v23,36,65,9,63,-28v-2,-23,-15,-38,-39,-39xm98,-16v55,3,57,-72,15,-91r-22,-15v-19,15,-40,23,-40,56v0,30,17,49,47,50xm163,-205v1,36,-26,50,-46,65v27,18,57,33,57,76v0,45,-32,69,-79,69v-45,0,-74,-22,-74,-65v0,-41,29,-55,54,-73v-19,-14,-44,-32,-44,-67v0,-40,29,-60,69,-60v38,0,63,16,63,55" }, "9": { "d": "52,-190v0,51,58,69,87,37v-1,-41,-6,-87,-46,-87v-25,0,-41,22,-41,50xm40,5v-15,-6,-7,-13,7,-18v51,-18,84,-61,91,-122v-37,39,-123,22,-117,-50v4,-46,26,-75,73,-75v56,0,78,43,78,100v0,94,-51,150,-132,165" }, ":": { "d": "60,-136v13,0,23,11,23,23v1,12,-12,21,-23,21v-12,0,-23,-9,-23,-22v0,-12,11,-22,23,-22xm60,-42v13,0,23,10,23,23v0,12,-11,21,-23,21v-12,0,-23,-9,-23,-22v0,-12,11,-23,23,-22", "w": 105 }, ";": { "d": "60,-136v12,-1,23,11,23,23v0,12,-12,21,-23,21v-12,0,-24,-9,-23,-22v2,-13,9,-22,23,-22xm56,4v-2,-13,-19,-12,-19,-29v0,-11,10,-18,20,-17v45,6,19,82,-13,86v-20,-9,14,-23,12,-40", "w": 105 }, "\u037e": { "d": "60,-136v12,-1,23,11,23,23v0,12,-12,21,-23,21v-12,0,-24,-9,-23,-22v2,-13,9,-22,23,-22xm56,4v-2,-13,-19,-12,-19,-29v0,-11,10,-18,20,-17v45,6,19,82,-13,86v-20,-9,14,-23,12,-40", "w": 105 }, "<": { "d": "180,-24r-180,-91r0,-25r180,-90r0,23r-156,80r156,79r0,24", "w": 180 }, "=": { "d": "180,-126r-180,0r0,-21r180,0r0,21xm180,-62r-180,0r0,-22r180,0r0,22", "w": 180 }, ">": { "d": "0,-24r0,-24r156,-79r-156,-80r0,-23r180,90r0,25", "w": 180 }, "?": { "d": "75,-43v11,0,23,12,22,24v-1,12,-11,21,-23,21v-14,0,-21,-10,-22,-22v-1,-12,10,-23,23,-23xm73,-239v-33,-2,-20,39,-45,44v-7,0,-17,-7,-16,-17v3,-33,29,-45,64,-48v58,-5,79,64,36,96v-21,15,-30,33,-28,71v0,9,1,13,-8,12v-9,0,-9,0,-10,-7r-4,-58v11,-23,42,-24,42,-59v0,-21,-10,-33,-31,-34", "w": 150 }, "@": { "d": "143,-46v37,0,52,-40,54,-79v1,-24,-10,-41,-31,-41v-39,0,-55,42,-55,81v0,24,9,39,32,39xm215,-26v-20,0,-29,-12,-28,-33v-12,17,-28,33,-55,33v-30,0,-45,-23,-45,-58v0,-53,26,-101,75,-101v24,0,35,15,43,34r6,-26r21,0r-22,115v1,11,4,18,13,19v37,-14,58,-59,58,-110v0,-56,-34,-87,-92,-87v-91,0,-148,67,-148,157v0,73,49,112,122,112v53,0,93,-24,121,-53r10,12v-31,30,-70,57,-131,57v-81,0,-139,-44,-139,-129v0,-99,64,-172,166,-172v67,0,108,37,108,103v0,63,-26,127,-83,127", "w": 322 }, "A": { "d": "135,-121r-31,-86r-31,86r62,0xm31,-6v-4,12,-39,9,-29,-3r96,-244v6,-1,23,-4,24,4r95,246v-2,6,-35,6,-38,-2r-36,-95r-77,0", "w": 217 }, "B": { "d": "157,-68v0,-50,-45,-61,-98,-55r0,102v48,6,98,0,98,-47xm141,-189v1,-44,-38,-50,-82,-45r0,91v44,4,81,-7,82,-46xm100,2v-30,-3,-76,9,-76,-16r0,-228v2,-21,35,-12,60,-14v49,-3,93,14,93,61v0,34,-24,48,-47,59v37,7,64,29,64,69v0,53,-46,64,-94,69", "w": 209 }, "C": { "d": "212,-209v-28,47,-42,-34,-87,-29v-51,6,-75,46,-75,101v0,64,26,112,87,116v27,1,44,-14,63,-22v3,0,8,5,8,9v-11,25,-41,39,-78,39v-79,0,-117,-55,-117,-134v0,-76,37,-131,115,-131v41,0,76,17,84,51", "w": 217 }, "D": { "d": "189,-128v-1,-75,-50,-117,-130,-105r0,212v80,7,131,-29,130,-107xm24,-240v1,-23,36,-11,62,-17v88,1,141,47,141,130v0,103,-81,138,-188,128v-8,-1,-15,-2,-15,-10r0,-231", "w": 240 }, "E": { "d": "24,-246v0,-7,1,-7,7,-8r130,1v3,3,7,22,-5,22r-97,0r0,87r87,0v2,3,6,25,-5,22r-82,0r0,99r102,1v3,3,6,24,-5,22r-125,0v-6,0,-7,0,-7,-6r0,-240", "w": 172 }, "F": { "d": "139,-144v11,-2,6,9,7,18v0,5,-3,4,-7,4r-80,0r0,115v0,13,-22,6,-34,6r-1,-245v0,-6,0,-9,6,-9r130,1v1,5,6,25,-6,23r-95,0r0,87r80,0", "w": 164 }, "G": { "d": "141,-18v26,0,47,-6,47,-34r0,-53r-49,0v-11,2,-6,-10,-7,-18v0,-4,4,-3,7,-3r82,1v2,28,2,65,0,94v-11,26,-44,36,-83,36v-83,-1,-125,-51,-125,-132v0,-78,42,-133,119,-133v46,0,83,19,91,54v4,15,-19,23,-28,13v-17,-19,-27,-46,-64,-44v-55,2,-80,45,-80,104v0,64,27,115,90,115", "w": 240 }, "H": { "d": "200,-1v-12,0,-35,7,-34,-6r0,-115r-107,0r0,115v2,13,-18,5,-28,7v-5,0,-7,-2,-7,-7r0,-241v-1,-12,19,-4,29,-6v5,0,6,1,6,6r0,104r107,0r1,-109v8,0,34,-7,34,5", "w": 225 }, "I": { "d": "23,-247v1,-13,36,-10,36,-1r0,241v1,13,-19,5,-29,7v-5,0,-7,-2,-7,-7r0,-240", "w": 82 }, "J": { "d": "29,-254v11,2,30,-6,30,7r-1,226v-5,57,-35,97,-86,107v-13,3,-16,-14,-4,-18v38,-12,54,-48,55,-97r0,-219v0,-5,1,-6,6,-6", "w": 82 }, "K": { "d": "144,-247v3,-10,29,-10,34,-3v-25,38,-57,71,-84,108r100,138v-6,8,-38,8,-44,-1r-92,-129r-1,133v-9,-1,-33,8,-33,-6r0,-240v-2,-13,17,-6,27,-7v6,-1,7,1,7,7r0,107" }, "L": { "d": "24,-248v1,-13,35,-10,35,0r0,224r95,0v10,-1,7,18,4,24r-128,0v-5,0,-6,-2,-6,-6r0,-242", "w": 164 }, "M": { "d": "254,0v-10,-1,-27,6,-27,-7r0,-194r-83,201v-6,3,-10,-1,-12,-7r-81,-194r0,195v1,11,-20,6,-27,4r0,-245v0,-14,24,-5,36,-6r83,193r80,-193v10,0,38,-7,38,5r0,242v-1,5,-1,7,-7,6", "w": 285 }, "N": { "d": "24,-247v-1,-14,22,-5,33,-6r139,192r3,-193v9,2,26,-5,25,6r0,242v0,11,-24,8,-28,1r-144,-199r0,202v-4,2,-28,8,-28,-5r0,-240", "w": 247 }, "O": { "d": "128,-19v55,0,79,-52,77,-115v-2,-59,-25,-104,-78,-104v-55,0,-78,49,-77,109v1,60,21,110,78,110xm82,-4v-103,-42,-90,-256,47,-256v133,0,146,210,47,255v-28,12,-66,13,-94,1", "w": 254 }, "P": { "d": "145,-184v0,-47,-45,-59,-86,-50r0,104v47,5,86,-6,86,-54xm53,0v-10,-2,-30,6,-29,-6r0,-240v13,-14,52,-11,79,-10v49,1,83,28,78,81v-6,55,-59,71,-122,66r0,103v0,5,-1,6,-6,6", "w": 187 }, "Q": { "d": "131,-17v57,0,81,-51,80,-113v-1,-58,-25,-109,-80,-109v-56,0,-81,46,-81,110v0,62,23,112,81,112xm249,-127v0,69,-36,111,-88,129v11,41,54,58,98,70v8,9,-3,14,-14,12v-58,-10,-105,-33,-127,-80v-69,-8,-105,-56,-105,-130v0,-79,40,-134,118,-134v76,0,118,55,118,133", "w": 262 }, "R": { "d": "141,-184v2,-47,-37,-58,-82,-51r0,104v47,4,81,-11,82,-53xm59,-8v0,14,-35,11,-35,2r0,-234v15,-33,132,-19,143,15v27,44,-5,100,-53,105v24,40,53,74,75,116v-4,8,-36,7,-42,-2r-67,-105v-8,-7,-25,-5,-21,9r0,94" }, "S": { "d": "90,-238v-38,0,-53,50,-25,70v40,29,105,34,109,101v5,88,-151,95,-160,18v-3,-23,33,-22,36,-2v8,43,94,45,90,-8v-6,-76,-118,-45,-123,-133v-4,-80,130,-89,146,-24v0,10,-6,17,-15,17v-27,-5,-23,-39,-58,-39", "w": 187 }, "T": { "d": "177,-238v0,6,0,7,-6,7r-63,0r0,224v1,12,-18,5,-28,7v-7,0,-7,-1,-8,-7r0,-224r-63,0v-10,2,-5,-17,-5,-20v0,-2,2,-3,5,-3r162,0v8,1,6,5,6,16", "w": 180 }, "U": { "d": "162,-248v-1,-12,14,-6,24,-6v3,0,4,2,4,6r0,172v0,53,-30,81,-84,81v-57,0,-85,-29,-85,-86r0,-167v-1,-13,19,-5,29,-7v6,-1,6,2,7,7r0,161v-2,37,13,66,52,66v34,-1,53,-20,53,-59r0,-168", "w": 209 }, "V": { "d": "106,-59r69,-194v7,-1,32,-6,26,8r-90,244v-7,1,-17,3,-19,-4r-92,-245v3,-8,35,-7,39,2", "w": 202 }, "W": { "d": "1,-243v-6,-16,16,-10,28,-11v7,0,6,1,8,7r49,183r63,-189v6,-2,16,-3,16,5r61,184r54,-189v8,-1,31,-7,26,10r-72,242v-5,1,-16,4,-19,-4r-63,-179r-61,183v-7,1,-19,3,-20,-5", "w": 307 }, "X": { "d": "95,-108r-67,107v-8,2,-34,6,-25,-8r77,-125r-68,-116v4,-7,33,-7,38,1r50,83r57,-88v9,1,30,-5,22,8r-65,106r81,136v-4,7,-35,7,-39,-2" }, "Y": { "d": "113,-1v-11,0,-35,6,-35,-5r0,-110r-78,-135v7,-5,35,-7,40,2r62,106r65,-110v8,-1,35,-6,26,9r-78,130v-2,37,3,80,-2,113" }, "Z": { "d": "22,-231v-9,0,-10,-27,1,-23r148,0v5,1,2,6,1,10r-118,221r117,1v-1,8,6,22,-4,22r-158,0v-5,-2,-2,-5,0,-10r117,-221r-104,0", "w": 180 }, "[": { "d": "92,-299v3,3,4,18,-4,16r-36,0r0,312v14,2,38,-6,42,6v0,9,1,10,-7,10r-56,0v-6,0,-7,0,-7,-6r0,-332v0,-6,1,-7,7,-7", "w": 97 }, "\\": { "d": "5,-291v-4,-7,13,-14,19,-11r130,342v-2,5,-17,14,-23,5", "w": 157 }, "]": { "d": "73,39v0,6,-1,6,-7,6r-61,0v-1,-3,-5,-16,4,-16r36,0r0,-313v-13,-1,-30,1,-41,-1v1,-7,-4,-15,6,-15r57,0v6,0,6,1,6,7r0,332", "w": 97 }, "^": { "d": "206,-126r-27,0r-47,-98r-48,98r-28,0r65,-128r23,0", "w": 262 }, "_": { "d": "184,45r-188,0r0,-18r188,0r0,18", "w": 180 }, "a": { "d": "42,-49v-4,33,58,49,65,16v4,-20,0,-43,1,-65v-29,11,-62,14,-66,49xm85,-191v74,-4,50,87,54,153v2,42,-39,42,-80,42v-26,0,-50,-17,-49,-49v3,-52,57,-54,98,-70v13,-49,-38,-80,-58,-33v-3,7,-5,16,-16,15v-8,-1,-14,-5,-14,-15v4,-30,32,-41,65,-43", "w": 157 }, "b": { "d": "94,-167v-17,0,-31,9,-42,20v7,49,-20,128,35,130v73,2,79,-150,7,-150xm27,-275v9,2,25,-6,25,7r0,101v12,-12,31,-24,56,-24v48,0,68,39,68,89v0,65,-31,106,-93,106v-37,0,-63,-11,-63,-53r0,-219v0,-6,1,-7,7,-7", "w": 187 }, "c": { "d": "139,-130v-27,-4,-17,-43,-52,-40v-33,3,-46,30,-46,67v0,44,16,77,54,79v30,2,36,-28,53,-39v4,0,8,2,8,8v-5,34,-29,59,-69,59v-53,0,-75,-41,-75,-95v0,-58,24,-100,80,-100v33,0,57,17,61,46v1,10,-7,14,-14,15", "w": 164 }, "d": { "d": "103,-18v21,0,32,-7,32,-28r0,-113v-39,-34,-95,7,-91,63v3,44,17,76,59,78xm142,-275v10,2,27,-5,26,7r-1,240v-6,26,-40,32,-71,32v-56,0,-84,-33,-84,-91v0,-72,60,-129,123,-92r0,-88v0,-6,0,-9,7,-8", "w": 187 }, "e": { "d": "125,-130v1,-37,-51,-54,-72,-25v-8,10,-12,22,-14,38xm159,-127v1,9,-5,10,-10,12r-110,16v3,41,17,71,56,74v32,3,41,-29,60,-42v4,0,8,2,7,8v-7,34,-29,63,-72,63v-56,0,-78,-42,-78,-97v0,-59,22,-98,78,-98v42,0,66,26,69,64", "w": 172 }, "f": { "d": "62,-186v17,2,47,-7,35,15v-9,2,-23,1,-34,1r0,162v1,13,-15,7,-26,8v-6,0,-7,-2,-7,-8r0,-162v0,0,-33,4,-26,-15v6,-2,18,0,26,-1v2,-44,14,-87,56,-92v19,-2,23,25,6,26v-36,-9,-41,39,-30,66", "w": 97 }, "g": { "d": "86,-84v46,2,39,-79,7,-88v-27,-8,-47,11,-47,38v0,28,13,49,40,50xm152,23v-6,-34,-54,-22,-92,-26v-9,9,-22,17,-22,34v0,52,112,37,114,-8xm110,-186v18,18,63,-17,61,14r-34,8v33,44,-8,120,-74,97v-6,6,-15,13,-15,23v21,34,137,-10,133,59v-3,49,-48,69,-105,70v-37,0,-70,-11,-70,-42v0,-24,20,-37,38,-49v-10,-5,-29,-7,-27,-24v2,-21,19,-32,32,-43v-18,-8,-32,-29,-32,-56v0,-49,45,-72,93,-57", "w": 172 }, "h": { "d": "159,0v-9,-2,-25,6,-25,-7r-1,-129v-2,-41,-61,-36,-79,-12r0,139v1,13,-15,9,-26,9v-6,0,-7,-2,-7,-8r0,-261v-1,-11,17,-5,26,-6v6,-1,6,1,7,6r0,101v29,-37,112,-30,112,40r0,119v0,7,-1,9,-7,9", "w": 187 }, "i": { "d": "38,-256v10,1,19,7,19,18v0,11,-8,19,-20,19v-12,0,-19,-8,-19,-18v0,-11,9,-20,20,-19xm22,-185v9,-1,32,-6,31,5r0,174v0,12,-29,5,-31,5r0,-184", "w": 74 }, "j": { "d": "39,-256v12,0,19,8,19,18v0,10,-8,19,-19,19v-12,0,-20,-8,-20,-18v0,-11,9,-19,20,-19xm30,-186v9,2,25,-6,25,7v-2,111,15,242,-72,265v-9,0,-10,-11,-3,-15v62,-36,37,-157,42,-250v0,-6,2,-7,8,-7", "w": 74 }, "k": { "d": "21,-270v2,-10,19,-3,30,-5v6,51,0,117,2,172r77,-82v7,-2,37,-6,24,9r-66,73r79,99v-4,8,-33,6,-40,-1r-74,-92r-1,96v-7,0,-31,7,-31,-5r0,-264", "w": 164 }, "l": { "d": "54,-6v-3,11,-32,9,-32,0r0,-264v-1,-10,16,-3,25,-5v5,0,6,0,7,5r0,264", "w": 74 }, "m": { "d": "53,-7v-1,12,-35,11,-32,0r0,-145v-2,-52,101,-48,120,-17v27,-36,116,-31,116,36r0,126v0,11,-16,6,-26,7v-5,0,-6,-1,-6,-7r-1,-133v-2,-19,-12,-31,-34,-31v-23,1,-35,13,-35,38r0,126v2,13,-16,5,-25,7v-6,0,-7,0,-7,-6r-1,-134v-3,-18,-11,-33,-34,-32v-25,0,-35,15,-35,39r0,126", "w": 277 }, "n": { "d": "90,-191v48,-4,76,13,76,60r0,128v-4,4,-32,8,-32,-4r0,-135v2,-37,-76,-41,-80,-7v-5,45,-1,95,-1,142v0,12,-15,5,-25,7v-6,0,-6,-2,-7,-7r0,-145v-1,-35,40,-37,69,-39", "w": 187 }, "o": { "d": "96,-18v38,0,46,-39,46,-79v0,-39,-16,-69,-50,-74v-68,5,-61,153,4,153xm94,-191v55,0,82,44,82,97v0,55,-26,98,-82,98v-56,0,-82,-42,-82,-97v0,-55,27,-98,82,-98", "w": 187 }, "p": { "d": "85,-171v-24,-1,-32,10,-32,32r0,109v44,31,94,-7,90,-66v-3,-42,-18,-73,-58,-75xm176,-102v4,71,-61,132,-123,93r0,87v1,11,-15,6,-24,7v-6,-1,-7,-1,-8,-7r1,-236v7,-26,38,-33,70,-33v56,0,81,35,84,89", "w": 187 }, "q": { "d": "94,-21v19,1,29,-8,40,-18v-8,-47,24,-131,-32,-132v-73,-2,-81,147,-8,150xm166,78v2,13,-29,6,-30,6v-6,-29,0,-69,-2,-102v-13,11,-26,22,-51,22v-49,-2,-71,-38,-71,-88v0,-60,30,-107,91,-107v34,0,63,9,63,48r0,221", "w": 187 }, "r": { "d": "76,-173v-15,0,-22,8,-22,25r0,142v0,11,-16,6,-25,6v-6,0,-7,0,-7,-6r0,-151v-1,-33,37,-29,66,-34v29,-5,52,28,23,37v-15,-2,-17,-20,-35,-19", "w": 119 }, "s": { "d": "101,-153v-7,-25,-59,-24,-55,7v7,53,90,30,90,96v0,69,-116,70,-123,14v-1,-9,6,-16,15,-16v23,6,19,36,50,36v29,0,35,-37,16,-52v-28,-21,-74,-24,-77,-73v-3,-62,108,-67,113,-13v2,18,-26,15,-29,1", "w": 150 }, "t": { "d": "81,3v-81,11,-49,-103,-55,-174v-12,0,-30,4,-23,-14v5,-2,16,0,23,-1v-4,-29,9,-43,28,-53v5,-1,4,5,4,9r0,44r36,0v0,3,5,17,-4,15r-32,0r1,133v3,16,13,25,35,23v5,-1,7,4,7,7v0,8,-12,10,-20,11", "w": 97 }, "u": { "d": "129,-179v0,-12,34,-10,32,-1r-1,148v-4,32,-38,35,-73,36v-45,1,-68,-15,-68,-57r0,-127v-1,-11,16,-4,25,-6v6,0,7,0,7,6r0,120v-11,48,77,59,77,18", "w": 180 }, "v": { "d": "84,-44r46,-137v3,-9,15,-3,26,-5v-14,64,-44,126,-66,185v-6,1,-23,4,-23,-5r-67,-176v2,-7,31,-7,35,1", "w": 157 }, "w": { "d": "177,-5v1,9,-16,5,-23,4v-14,-38,-25,-81,-38,-120r-38,120v-6,0,-19,5,-22,-4r-56,-177v2,-8,31,-7,34,2r39,133r41,-138v6,0,11,-4,13,4r41,136r40,-140v7,-1,32,-5,23,9", "w": 232 }, "x": { "d": "74,-71r-48,70v-7,2,-32,6,-23,-8r56,-84r-53,-90v4,-6,32,-6,36,2r37,60v14,-21,26,-45,42,-64v9,1,31,-6,22,8r-50,78r57,96v-4,6,-32,5,-37,-2", "w": 150 }, "y": { "d": "25,86v-25,6,-35,-31,-10,-32v41,12,49,-22,60,-54r-72,-182v2,-8,33,-7,36,2r51,139r49,-144v7,-2,33,-5,24,9r-82,222v-10,21,-26,39,-56,40", "w": 164 }, "z": { "d": "49,-20r83,1v3,3,5,19,-4,19r-118,0v-3,-1,-3,-7,0,-10r83,-156r-78,-1v0,-7,-7,-19,5,-19r111,0v5,2,3,6,0,10", "w": 142 }, "{": { "d": "80,-254v-3,56,10,115,-30,128v43,9,26,73,30,126v1,21,12,33,34,34v7,8,-1,15,-14,12v-58,-1,-49,-70,-49,-131v0,-21,-9,-33,-28,-36v-1,-5,-2,-13,3,-13v35,-3,25,-54,25,-91v0,-49,16,-79,63,-75v3,3,4,15,-5,13v-19,2,-28,14,-29,33", "w": 127 }, "|": { "d": "52,90r-21,0r0,-360r21,0r0,360", "w": 82 }, "}": { "d": "12,37v16,-9,38,-10,35,-37v4,-48,-12,-116,30,-126r0,-2v-43,-9,-30,-76,-30,-126v0,-23,-15,-31,-34,-35v-1,-4,-3,-14,7,-12v66,-4,55,67,57,130v1,20,6,38,28,37v-1,5,3,14,-3,14v-39,6,-26,65,-26,110v0,37,-19,56,-56,56v-9,0,-8,-1,-8,-9", "w": 127 }, "~": { "d": "93,-131v36,0,85,48,110,3r11,20v-12,14,-23,27,-46,27v-39,0,-82,-49,-108,-1r-12,-20v9,-14,23,-29,45,-29", "w": 262 }, "'": { "d": "22,-247v-6,-24,28,-31,31,-10r-12,97r-7,0", "w": 74 }, "`": { "d": "24,-233v-16,-11,1,-38,13,-21v10,14,27,23,35,40v0,9,-7,9,-13,6", "w": 90 }, "#": { "d": "121,-113r5,-35r-37,0r-4,35r36,0xm203,-93r-63,0r-13,93r-22,0r13,-93r-36,0r-14,93r-20,0r12,-93r-60,0r0,-20r63,0r5,-35r-60,0r0,-20r63,0r11,-86r22,0r-12,86r36,0r12,-86r21,0r-11,86r60,0r0,20r-63,0r-5,35r61,0r0,20", "w": 209 }, "!": { "d": "49,-254v11,2,30,-6,30,7r-10,160v0,8,-9,5,-16,6v-11,-48,-6,-113,-12,-166v-1,-8,2,-7,8,-7xm60,-43v13,0,23,11,23,24v0,11,-12,21,-23,21v-15,0,-22,-10,-23,-22v-1,-12,10,-23,23,-23", "w": 105 }, "\"": { "d": "22,-247v-6,-24,28,-31,31,-10r-12,97r-7,0xm89,-250v-4,-21,30,-27,31,-7v1,32,-9,65,-12,97r-7,0", "w": 142}} });

//-------------------------------------------------------------------------------------------------------------------------

//Set Fonts

if (!window.XMLHttpRequest) //IE6- stuff;}
    Cufon.set('fontFamily', 'Barmeno').replace('#hdrContacts span')('#ContactUsBoxes h1')('#ContactUsBoxes p')
    ('#hdrContacts p')('.slogan')('#pageTitle h1')('#textStyle h1');
else
    Cufon.set('fontFamily', 'Barmeno').replace('.boxeTwoLong h1')/*('#textContCenter ul li a')*/('#intlinks a')('.nettitudeNews h2')
	('.boxeOneLong1 h1')('.boxeOneLong2 h1')('#ContactUsBoxes h1')('.ContactBox1 h1')('.ContactBox2 h1')('#boxesContainer h1')
	('#intlinks h1')('#intlinks h2')('#intlinks h3')('#SecurityTestingComplianceBTN')('#UnifiedCommunicationsBTN')
	('#InfrastructureBTN');

//-------------------------------------------------------------------------------------------------------------------------

//Chat PopUp

var dragElement = false;
var xDif = 0;
var yDif = 0;


function mouse_down(event, elementName) {
    var leftDim = document.getElementById(elementName).offsetLeft;
    var topDim = document.getElementById(elementName).offsetTop;
    dragElement = true;
    xDif = event.clientX - leftDim;
    yDif = event.clientY - topDim;
}

function dragWin(event, elementName) {
    if (dragElement == true) {
        document.getElementById(elementName).style.left = event.clientX - xDif + 'px';
        document.getElementById(elementName).style.top = event.clientY - yDif + 'px';
    }
}


function mouse_up(event, elementName) {
    dragElement = false;
    document.getElementById(elementName).style.left = event.clientX - xDif + 'px';
    document.getElementById(elementName).style.top = event.clientY - yDif + 'px';

}

$(document).ready(function () {
    /*$(".close").click(function () {
    $("#popupWin").fadeOut('slow');
    })*/

    $("#LiveChatBtn").click(function () {
        $("#popupWin").fadeIn('fast');
    })

    var centre = $(document).width() + 426;
    
    //For Testing
    /*    $('#popupWin').animate({
    //left: '+=1000'

    left: '+=' + centre / 2

    }, 5000, function () {
    });*/

    var chatonlinestatus = $.cookie('LiveChatOnlineStatus');
    var chatpopup = $.cookie('chatpopup');

    $(window).load(function () {
        //Pop up on first visit
        /*if (chatpopup != 'stop' && chatonlinestatus == 'Yes') {
            $('#popupWin').css('display', 'block');
            $('#popupWin').animate({ opacity: 0 }, 0);
            $('#popupWin').animate({ opacity: 1, left: '+=' + centre / 2 }, 5000);
            $.cookie('chatpopup', 'stop');
        } else {*/
            $("#popupWin").css("display", "none").css("left", (centre / 2) / 2);
        //}


    });
})
