// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
// Browser Detect code from: http://www.quirksmode.org/js/detect.html
// Returns:
// Browser name:    BrowserDetect.browser 
// Browser version: BrowserDetect.version 
// OS name:         BrowserDetect.OS

/* Example code:
	var BrowserName = BrowserDetect.browser;
	var BrowserVersion = BrowserDetect.version;
*/


function SetUniqueRadioButton(nameregex, current)
{
   re = new RegExp(nameregex);
   for(i = 0; i < document.forms[0].elements.length; i++)
   {
      elm = document.forms[0].elements[i]
      if (elm.type == 'radio')
      {
         if (re.test(elm.name))
         {
            elm.checked = false;
         }
      }
   }
   current.checked = true;
}

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

// END BrowserDetect
// ---------------------------------------------------------------------------------------


if(document.all && !document.getElementById) {
    document.getElementById = function(id) {
         return document.all[id];
    }
}

// element rotation

rotationNum = 3; //number of elements
// generate random number 0-2
//randomnumber=Math.floor(Math.random()*rotationNum);
theCount = 1; //randomnumber + 1;
function timedCount(isDelay){
	if (theCount > rotationNum ) { theCount = 1; }
	
	if (!isDelay) {
		tabSwitch('tab' + theCount,'content' + theCount);
		theCount++;
	}
	t=setTimeout("timedCount()",5000);
}

function stopTimer(countNum) { clearTimeout(t);
	if (countNum) theCount = countNum+1;
}

// end element rotation


//id.innerhtml = id.title
function titleToHtml (html, title){
	//find IDs
	if (html) var htmlID = findId(html);
	if (title) var titleID = findId(title);
	//Text switching
	if (htmlID && titleID) htmlID.innerHTML = titleID.title;
	return false;
}
function blankToHtml (blankID){
	if (blankID) {
		var blankID = findId(blankID);
		blankID.innerHTML = "";
	}
	return false;
}


//START dhtml tabs
function tabSwitch(link_id, content_id) {
//tabStart = 'default-link-on'
//tabTextStart= 'default-text-on'
//Link = onclick="tabSwitch('tab_link_1','tab_text_1');

	//find IDs
	var tabLinkStartID = findId(tabStart);
	var tabLinkNewID = findId(link_id);

	var tabTextStartID = findId(tabTextStart);
	var tabTextNewID = findId(content_id);
	
	//Link switching
	if (tabLinkStartID) tabLinkStartID.className = tabLinkStartID.className ==''?'on':'';
	if (tabLinkNewID) tabLinkNewID.className =  tabLinkNewID.className ==''?'on':'';
	tabStart = link_id;
	
	//Text switching
	if (content_id) HideShow(content_id);
	if (tabTextStart) HideShow(tabTextStart);
	tabTextStart = content_id;

	return false;
}

//END dhtml tabs

function value_remove_focus(el) {
	if(el.V) {
		if (el.value == el.V) {
		el.value = '';
		}
	} else {
		el.V = el.value;
		el.value = '';
	}
}

function DR_SwapClass (id, classString) {
	theClass = findId(id);
	theClassName = theClass.className;
	if (!theClassName.match(classString)) {
		theClassName_on = theClassName + classString;
		theClass.className = theClassName_on;
		//alert( "theClass.className: " + theClass.className )
	}
}


function DR_SwapClassRestore () {
	theClass.className = theClassName
}

function ExpandCollapse(id, theClass) {	
// find all divs
	var divs = document.getElementsByTagName('div');
	if (divs) {
		// loop through all
		for (var i=0;i<divs.length;i++)	{ 
			// hide all with class passed
			if (divs[i].className == theClass) {
				// if id then hide all
				if (id) { divs[i].style.display = 'none'; } 
				// if no id then show all
				else { divs[i].style.display = ''; }
			}
		}
	}
	
	// if id passed, show the one	
	if (id) {
		if (document.getElementById(id)) { document.getElementById(id).style.display="";}
	}
}


function position(thediv, theanchor,X,Y ) {
	
	if (X) { xOffset = X  } else ( xOffset = 10 )
	if (Y) { yOffset = Y  } else ( yOffset = 10 )
	
	lyr = findId(thediv);
	theimage = findId(theanchor)
	if (lyr){
		if (theimage) {
			locY = findPosY(theimage) + yOffset;
			locX = findPosX(theimage) + xOffset;
			lyr.style.left = locX + 'px';
			lyr.style.top = locY + 'px';
		}
	}
}


function getoffset(theTable, theDiv) {
	var Div = new getObj(theDiv);
	if (Div) {
		tableWidth = theTable.offsetWidth;
		offset = tableWidth - Div.obj.offsetWidth;
		return offset;
	}
}

function HideShow(id) {
	theElement = findId(id);
	if (theElement) { theElement.style.display=theElement.style.display==''?'none':''};
}

function HideShowMult() {
	for (i=0; i<= arguments.length; i++) {
		theElement = findId(arguments[i]);
		if (theElement) { theElement.style.display=theElement.style.display==''?'none':''};
	}
}

//** Drop Nav Centered on Site **//
// IE and Mozilla friendly way to get id's
function findId(id) {
	if (document.getElementById) {
		return document.getElementById(id);
	} else if (document.all) {
		return document.all.id;
	}
}
//  END IE and Mozilla friendly way to get id's

tdLastId = "";
tdCurrentId = "";
waiting = 0;
waitTime = 50;
timeoutId = "";

function navFlip(id, that, xOffset, yPos) {
	//alert(xOffset)
	if (!xOffset) xOffset = 0;
	if (!yPos) yPos = 0; 
	if (waiting) {
		if (id != tdLastId) {
			clearTimeout(timeoutId);
			that_saved = that;
			timeoutId = setTimeout('clearWait(' + xOffset + ', ' + yPos + ')', waitTime);
		}
		tdLastId = id;
		return;
	}

if (tdCurrentId != id) {
		if (id) {
			lyr = findId(id);
			if (lyr) { //Error fix 4/20/04
				if (that) {
					lyr.style.left = findPosX(that) + xOffset + 'px';
					if (yPos != 0) {
						lyr.style.top = findPosY(that) + yPos + 'px';
					}
				}	
	
				lyr.style.visibility = "visible";
	
				waiting = id;
			}// end lyr
		}

		if (tdCurrentId) {
			//alert('dis: ' + tdCurrentId + ' waiting:' + waiting);

			lyr = findId(tdCurrentId);
			if (lyr) { //Error fix 4/20/04
				lyr.style.visibility = "hidden";
			}// end if
		}
		tdCurrentId = id;
	}
	tdLastId = id;
}

function clearWait(xOffset, yPos) {
	//alert('clearing: ' + waiting);
	waiting = 0;
	navFlip(tdLastId, that_saved, xOffset, yPos);
}

// Functions to find positions of static images
function findPosX(obj) {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent) break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

function findPosY(obj) {
    var curtop = 0;
    if(obj.offsetParent)
        while(1) {
          curtop += obj.offsetTop;
          if(!obj.offsetParent) break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
// END ** Drop Nav Centered on Site **//

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

//Mouseover Script
<!--

function MM_openBrWindow(theURL,winName,features) { //v2.0
  w = window.open(theURL,winName,features);
  w.focus();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

browser = navigator.appName;
ie = "Microsoft Internet Explorer";
netscape = "Netscape";

function SetFormValue(formStr,field,value) {
	
	form=(MM_findObj(formStr))
	
	if (form) {
		if (null != (form.elements[field])) {
			if ((browser == netscape)&&(form.elements[field].type=='select-one')){
				sellength=form.elements[field].length;
				for (i=0; i< sellength; i++) {
					if (form.elements[field].options[i].value==value)
						form.elements[field].options[i].selected=true;
				}
			} 
			else 
				form.elements[field].value=value;
		}		
	}
}

function SubmitForm(formStr) {
	form=(MM_findObj(formStr))
	if(form) form.submit();
}
//-->


/*!	SWFObject v2.0 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/

var swfobject = function() {
	
	var UNDEF = "undefined",
		OBJECT = "object",
		SHOCKWAVE_FLASH = "Shockwave Flash",
		SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
		FLASH_MIME_TYPE = "application/x-shockwave-flash",
		EXPRESS_INSTALL_ID = "SWFObjectExprInst",
		
		win = window,
		doc = document,
		nav = navigator,
		
		domLoadFnArr = [],
		regObjArr = [],
		timer = null,
		storedAltContent = null,
		storedAltContentId = null,
		isDomLoaded = false,
		isExpressInstallActive = false;
	
	/* Centralized function for browser feature detection
		- Proprietary feature detection (conditional compiling) is used to detect Internet Explorer's features
		- User agent string detection is only used when no alternative is possible
		- Is executed directly for optimal performance
	*/	
	var ua = function() {
		var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF && typeof doc.appendChild != UNDEF && typeof doc.replaceChild != UNDEF && typeof doc.removeChild != UNDEF && typeof doc.cloneNode != UNDEF,
			playerVersion = [0,0,0],
			d = null;
		if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
			d = nav.plugins[SHOCKWAVE_FLASH].description;
			if (d) {
				d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
				playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
				playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
			}
		}
		else if (typeof win.ActiveXObject != UNDEF) {
			var a = null, fp6Crash = false;
			try {
				a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
			}
			catch(e) {
				try { 
					a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
					playerVersion = [6,0,21];
					a.AllowScriptAccess = "always";  // Introduced in fp6.0.47
				}
				catch(e) {
					if (playerVersion[0] == 6) {
						fp6Crash = true;
					}
				}
				if (!fp6Crash) {
					try {
						a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
					}
					catch(e) {}
				}
			}
			if (!fp6Crash && a) { // a will return null when ActiveX is disabled
				try {
					d = a.GetVariable("$version");  // Will crash fp6.0.21/23/29
					if (d) {
						d = d.split(" ")[1].split(",");
						playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
					}
				}
				catch(e) {}
			}
		}
		var u = nav.userAgent.toLowerCase(),
			p = nav.platform.toLowerCase(),
			webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
			ie = false,
			windows = p ? /win/.test(p) : /win/.test(u),
			mac = p ? /mac/.test(p) : /mac/.test(u);
		/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
		return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac };
	}();

	/* Cross-browser onDomLoad
		- Based on Dean Edwards' solution: http://dean.edwards.name/weblog/2006/06/again/
		- Will fire an event as soon as the DOM of a page is loaded (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
	*/ 
	var onDomLoad = function() {
		if (!ua.w3cdom) {
			return;
		}
		addDomLoadEvent(main);
		if (ua.ie && ua.win) {
			try {  // Avoid a possible Operation Aborted error
				doc.write("<scr" + "ipt id=__ie_ondomload defer=true src=//:></scr" + "ipt>"); // String is split into pieces to avoid Norton AV to add code that can cause errors 
				var s = getElementById("__ie_ondomload");
				if (s) {
					s.onreadystatechange = function() {
						if (this.readyState == "complete") {
							this.parentNode.removeChild(this);
							callDomLoadFunctions();
						}
					};
				}
			}
			catch(e) {}
		}
		if (ua.webkit && typeof doc.readyState != UNDEF) {
			timer = setInterval(function() { if (/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
		}
		if (typeof doc.addEventListener != UNDEF) {
			doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, null);
		}
		addLoadEvent(callDomLoadFunctions);
	}();
	
	function callDomLoadFunctions() {
		if (isDomLoaded) {
			return;
		}
		if (ua.ie && ua.win) { // Test if we can really add elements to the DOM; we don't want to fire it too early
			var s = createElement("span");
			try { // Avoid a possible Operation Aborted error
				var t = doc.getElementsByTagName("body")[0].appendChild(s);
				t.parentNode.removeChild(t);
			}
			catch (e) {
				return;
			}
		}
		isDomLoaded = true;
		if (timer) {
			clearInterval(timer);
			timer = null;
		}
		var dl = domLoadFnArr.length;
		for (var i = 0; i < dl; i++) {
			domLoadFnArr[i]();
		}
	}
	
	function addDomLoadEvent(fn) {
		if (isDomLoaded) {
			fn();
		}
		else { 
			domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
		}
	}
	
	/* Cross-browser onload
		- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
		- Will fire an event as soon as a web page including all of its assets are loaded 
	 */
	function addLoadEvent(fn) {
		if (typeof win.addEventListener != UNDEF) {
			win.addEventListener("load", fn, false);
		}
		else if (typeof doc.addEventListener != UNDEF) {
			doc.addEventListener("load", fn, false);
		}
		else if (typeof win.attachEvent != UNDEF) {
			win.attachEvent("onload", fn);
		}
		else if (typeof win.onload == "function") {
			var fnOld = win.onload;
			win.onload = function() {
				fnOld();
				fn();
			};
		}
		else {
			win.onload = fn;
		}
	}
	
	/* Main function
		- Will preferably execute onDomLoad, otherwise onload (as a fallback)
	*/
	function main() { // Static publishing only
		var rl = regObjArr.length;
		for (var i = 0; i < rl; i++) { // For each registered object element
			var id = regObjArr[i].id;
			if (ua.pv[0] > 0) {
				var obj = getElementById(id);
				if (obj) {
					regObjArr[i].width = obj.getAttribute("width") ? obj.getAttribute("width") : "0";
					regObjArr[i].height = obj.getAttribute("height") ? obj.getAttribute("height") : "0";
					if (hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >= Flash content version: Houston, we have a match!
						if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements
							fixParams(obj);
						}
						setVisibility(id, true);
					}
					else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only)
						showExpressInstall(regObjArr[i]);
					}
					else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content
						displayAltContent(obj);
					}
				}
			}
			else {  // If no fp is installed, we let the object element do its job (show alternative content)
				setVisibility(id, true);
			}
		}
	}
	
	/* Fix nested param elements, which are ignored by older webkit engines
		- This includes Safari up to and including version 1.2.2 on Mac OS 10.3
		- Fall back to the proprietary embed element
	*/
	function fixParams(obj) {
		var nestedObj = obj.getElementsByTagName(OBJECT)[0];
		if (nestedObj) {
			var e = createElement("embed"), a = nestedObj.attributes;
			if (a) {
				var al = a.length;
				for (var i = 0; i < al; i++) {
					if (a[i].nodeName.toLowerCase() == "data") {
						e.setAttribute("src", a[i].nodeValue);
					}
					else {
						e.setAttribute(a[i].nodeName, a[i].nodeValue);
					}
				}
			}
			var c = nestedObj.childNodes;
			if (c) {
				var cl = c.length;
				for (var j = 0; j < cl; j++) {
					if (c[j].nodeType == 1 && c[j].nodeName.toLowerCase() == "param") {
						e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
					}
				}
			}
			obj.parentNode.replaceChild(e, obj);
		}
	}
	
	/* Fix hanging audio/video threads and force open sockets and NetConnections to disconnect
		- Occurs when unloading a web page in IE using fp8+ and innerHTML/outerHTML
		- Dynamic publishing only
	*/
	function fixObjectLeaks(id) {
		if (ua.ie && ua.win && hasPlayerVersion("8.0.0")) {
			win.attachEvent("onunload", function () {


				var obj = getElementById(id);
				if (obj) {
					for (var i in obj) {
						if (typeof obj[i] == "function") {
							obj[i] = function() {};
						}
					}
					obj.parentNode.removeChild(obj);
				}
			});
		}
	}
	
	/* Show the Adobe Express Install dialog
		- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
	*/
	function showExpressInstall(regObj) {
		isExpressInstallActive = true;
		var obj = getElementById(regObj.id);
		if (obj) {
			if (regObj.altContentId) {
				var ac = getElementById(regObj.altContentId);
				if (ac) {
					storedAltContent = ac;
					storedAltContentId = regObj.altContentId;
				}
			}
			else {
				storedAltContent = abstractAltContent(obj);
			}
			if (!(/%$/.test(regObj.width)) && parseInt(regObj.width, 10) < 310) {
				regObj.width = "310";
			}
			if (!(/%$/.test(regObj.height)) && parseInt(regObj.height, 10) < 137) {
				regObj.height = "137";
			}
			doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
			var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
				dt = doc.title,
				fv = "MMredirectURL=" + win.location + "&MMplayerType=" + pt + "&MMdoctitle=" + dt,
				replaceId = regObj.id;
			// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
			// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
			if (ua.ie && ua.win && obj.readyState != 4) {
				var newObj = createElement("div");
				replaceId += "SWFObjectNew";
				newObj.setAttribute("id", replaceId);
				obj.parentNode.insertBefore(newObj, obj); // Insert placeholder div that will be replaced by the object element that loads expressinstall.swf
				obj.style.display = "none";
				win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
			}
			createSWF({ data:regObj.expressInstall, id:EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height }, { flashvars:fv }, replaceId);
		}
	}
	
	/* Functions to abstract and display alternative content
	*/
	function displayAltContent(obj) {
		if (ua.ie && ua.win && obj.readyState != 4) {
			// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
			// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
			var el = createElement("div");
			obj.parentNode.insertBefore(el, obj); // Insert placeholder div that will be replaced by the alternative content
			el.parentNode.replaceChild(abstractAltContent(obj), el);
			obj.style.display = "none";
			win.attachEvent("onload", function() { obj.parentNode.removeChild(obj); });
		}
		else {
			obj.parentNode.replaceChild(abstractAltContent(obj), obj);
		}
	}	

	function abstractAltContent(obj) {
		var ac = createElement("div");
		if (ua.win && ua.ie) {
			ac.innerHTML = obj.innerHTML;
		}
		else {
			var nestedObj = obj.getElementsByTagName(OBJECT)[0];
			if (nestedObj) {
				var c = nestedObj.childNodes;
				if (c) {
					var cl = c.length;
					for (var i = 0; i < cl; i++) {
						if (!(c[i].nodeType == 1 && c[i].nodeName.toLowerCase() == "param") && !(c[i].nodeType == 8)) {
							ac.appendChild(c[i].cloneNode(true));
						}
					}
				}
			}
		}
		return ac;
	}
	
	/* Cross-browser dynamic SWF creation
	*/
	function createSWF(attObj, parObj, id) {
		var r, el = getElementById(id);
		if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
			attObj.id = id;
		}
		if (ua.ie && ua.win) { // IE, the object element and W3C DOM methods do not combine: fall back to outerHTML
			var att = "";
			for (var i in attObj) {
				if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries, like Object.prototype.toJSONString = function() {}
					if (i == "data") {
						parObj.movie = attObj[i];
					}
					else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
						att += ' class="' + attObj[i] + '"';
					}
					else if (i != "classid") {
						att += ' ' + i + '="' + attObj[i] + '"';
					}
				}
			}
			var par = "";
			for (var j in parObj) {
				if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
					par += '<param name="' + j + '" value="' + parObj[j] + '" />';
				}
			}
			el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>';
			fixObjectLeaks(attObj.id); // This bug affects dynamic publishing only
			r = getElementById(attObj.id);	
		}
		else if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements: fall back to the proprietary embed element
			var e = createElement("embed");
			e.setAttribute("type", FLASH_MIME_TYPE);
			for (var k in attObj) {
				if (attObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
					if (k == "data") {
						e.setAttribute("src", attObj[k]);
					}
					else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
						e.setAttribute("class", attObj[k]);
					}
					else if (k != "classid") { // Filter out IE specific attribute
						e.setAttribute(k, attObj[k]);
					}
				}
			}
			for (var l in parObj) {
				if (parObj[l] != Object.prototype[l]) { // Filter out prototype additions from other potential libraries
					if (l != "movie") { // Filter out IE specific param element
						e.setAttribute(l, parObj[l]);
					}
				}
			}
			el.parentNode.replaceChild(e, el);
			r = e;
		}
		else { // Well-behaving browsers
			var o = createElement(OBJECT);
			o.setAttribute("type", FLASH_MIME_TYPE);
			for (var m in attObj) {
				if (attObj[m] != Object.prototype[m]) { // Filter out prototype additions from other potential libraries
					if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
						o.setAttribute("class", attObj[m]);
					}
					else if (m != "classid") { // Filter out IE specific attribute
						o.setAttribute(m, attObj[m]);
					}
				}
			}
			for (var n in parObj) {
				if (parObj[n] != Object.prototype[n] && n != "movie") { // Filter out prototype additions from other potential libraries and IE specific param element
					createObjParam(o, n, parObj[n]);
				}
			}
			el.parentNode.replaceChild(o, el);
			r = o;
		}
		return r;
	}
	
	function createObjParam(el, pName, pValue) {
		var p = createElement("param");
		p.setAttribute("name", pName);	
		p.setAttribute("value", pValue);
		el.appendChild(p);
	}
	
	function getElementById(id) {
		return doc.getElementById(id);
	}
	
	function createElement(el) {
		return doc.createElement(el);
	}
	
	function hasPlayerVersion(rv) {
		var pv = ua.pv, v = rv.split(".");
		v[0] = parseInt(v[0], 10);
		v[1] = parseInt(v[1], 10);
		v[2] = parseInt(v[2], 10);
		return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
	}
	
	/* Cross-browser dynamic CSS creation
		- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
	*/	
	function createCSS(sel, decl) {
		if (ua.ie && ua.mac) {
			return;
		}
		var h = doc.getElementsByTagName("head")[0], s = createElement("style");
		s.setAttribute("type", "text/css");
		s.setAttribute("media", "screen");
		if (!(ua.ie && ua.win) && typeof doc.createTextNode != UNDEF) {
			s.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
		}
		h.appendChild(s);
		if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
			var ls = doc.styleSheets[doc.styleSheets.length - 1];
			if (typeof ls.addRule == OBJECT) {
				ls.addRule(sel, decl);
			}
		}
	}
	
	function setVisibility(id, isVisible) {
		var v = isVisible ? "visible" : "hidden";
		if (isDomLoaded) {
			getElementById(id).style.visibility = v;
		}
		else {
			createCSS("#" + id, "visibility:" + v);
		}
	}
	
	return {
		/* Public API
			- Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation
		*/ 
		registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr) {
			if (!ua.w3cdom || !objectIdStr || !swfVersionStr) {
				return;
			}
			var regObj = {};
			regObj.id = objectIdStr;
			regObj.swfVersion = swfVersionStr;
			regObj.expressInstall = xiSwfUrlStr ? xiSwfUrlStr : false;
			regObjArr[regObjArr.length] = regObj;
			setVisibility(objectIdStr, false);
		},
		
		getObjectById: function(objectIdStr) {
			var r = null;
			if (ua.w3cdom && isDomLoaded) {
				var o = getElementById(objectIdStr);
				if (o) {
					var n = o.getElementsByTagName(OBJECT)[0];
					if (!n || (n && typeof o.SetVariable != UNDEF)) {
				    	r = o;
					}
					else if (typeof n.SetVariable != UNDEF) {
						r = n;
					}
				}
			}
			return r;
		},
		
		embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
			if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
				return;
			}
			widthStr += ""; // Auto-convert to string to make it idiot proof
			heightStr += "";
			if (hasPlayerVersion(swfVersionStr)) {
				setVisibility(replaceElemIdStr, false);
				var att = (typeof attObj == OBJECT) ? attObj : {};
				att.data = swfUrlStr;
				att.width = widthStr;
				att.height = heightStr;
				var par = (typeof parObj == OBJECT) ? parObj : {};
				if (typeof flashvarsObj == OBJECT) {
					for (var i in flashvarsObj) {
						if (flashvarsObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries
							if (typeof par.flashvars != UNDEF) {
								par.flashvars += "&" + i + "=" + flashvarsObj[i];
							}
							else {
								par.flashvars = i + "=" + flashvarsObj[i];
							}
						}
					}
				}
				addDomLoadEvent(function() {
					createSWF(att, par, replaceElemIdStr);
					if (att.id == replaceElemIdStr) {
						setVisibility(replaceElemIdStr, true);
					}
				});
			}
			else if (xiSwfUrlStr && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) {
				setVisibility(replaceElemIdStr, false);
				addDomLoadEvent(function() {
					var regObj = {};
					regObj.id = regObj.altContentId = replaceElemIdStr;
					regObj.width = widthStr;
					regObj.height = heightStr;
					regObj.expressInstall = xiSwfUrlStr;
					showExpressInstall(regObj);
				});
			}
		},
		
		getFlashPlayerVersion: function() {
			return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
		},
		
		hasFlashPlayerVersion:hasPlayerVersion,
		
		createSWF: function(attObj, parObj, replaceElemIdStr) {
			if (ua.w3cdom && isDomLoaded) {
				return createSWF(attObj, parObj, replaceElemIdStr);
			}
			else {
				return undefined;
			}
		},
		
		createCSS: function(sel, decl) {
			if (ua.w3cdom) {
				createCSS(sel, decl);
			}
		},
		
		addDomLoadEvent:addDomLoadEvent,
		
		addLoadEvent:addLoadEvent,
		
		getQueryParamValue: function(param) {
			var q = doc.location.search || doc.location.hash;
			if (param == null) {
				return q;
			}
		 	if(q) {
				var pairs = q.substring(1).split("&");
				for (var i = 0; i < pairs.length; i++) {
					if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
						return pairs[i].substring((pairs[i].indexOf("=") + 1));
					}
				}
			}
			return "";
		},
		
		// For internal usage only
		expressInstallCallback: function() {
			if (isExpressInstallActive && storedAltContent) {
				var obj = getElementById(EXPRESS_INSTALL_ID);
				if (obj) {
					obj.parentNode.replaceChild(storedAltContent, obj);
					if (storedAltContentId) {
						setVisibility(storedAltContentId, true);
						if (ua.ie && ua.win) {
							storedAltContent.style.display = "block";
						}
					}
					storedAltContent = null;
					storedAltContentId = null;
					isExpressInstallActive = false;
				}
			} 
		}
		
	};

}();
/*!	SWFObject v2.0 <http://code.google.com/p/swfobject/>

	END
*/


//-- Urchin Tracking Module II (UTM II),$Revision: 1.6 $,
//-- Copyright 2003 Urchin Software Corporation, All Rights Reserved.

/*--------------------------------------------------
   UTM II User Settings
--------------------------------------------------*/
var __utmfsc=1;                 /*-- set client info flag (1=on|0=off) --*/
var __utmdn="auto";             /*-- (auto|none|domain) set the domain name for cookies --*/
var __utmhash="on";             /*-- (on|off) unique domain hash for cookies --*/
var __utmgifpath="/Images/CommonImages/__utm.gif";  /*-- set the web path to the __utm.gif file --*/
var __utmtimeout="1800";        /*-- set the inactive session timeout in seconds --*/

/*--------------------------------------------------
   UTM II Campaign Tracking Settings
--------------------------------------------------*/
var __utmctm=1;                 /*-- set campaign tracking module (1=on|0=off) --*/
var __utmcto="15768000";        /*-- set the campaign timeout in seconds (6 month default) --*/

var __utmccn="utm_campaign";    /*-- campaign name --*/
var __utmcpr="utm_program";     /*-- campaign program --*/
var __utmcrs="utm_refsite";     /*-- campaign referral site --*/
var __utmcrl="utm_refloc";      /*-- campaign referral location --*/
var __utmctr="utm_term";        /*-- campaign term/keyword --*/
var __utmcct="utm_content";     /*-- campaign content --*/

var __utmcui="utm_userid";      /*-- campaign userid --*/
var __utmccu="utm_custom";      /*-- campaign custom field --*/

/*--------------------------------------------------
   Don't modify below this point
--------------------------------------------------*/
var __utmf,__utmdh,__utmd,__utmdom="",__utmu,__utmjv="-",__utmfns;

if (!__utmf) {
   var __utma,__utmb,__utmc;
   var __utmexp="",__utms="",__utmst=0,__utmlf=0;

   /*--------------------------------------------------
      get useful information
   --------------------------------------------------*/
   __utmdh = __utmSetDomain();                               /*--- set the domain and get the domain hash ---*/
   __utma  = document.cookie.indexOf("__utma="+__utmdh);     /*--- cookie a ---*/
   __utmb  = document.cookie.indexOf("__utmb="+__utmdh);     /*--- cookie b ---*/
   __utmc  = document.cookie.indexOf("__utmc="+__utmdh);     /*--- cookie c ---*/
   __utmu  = Math.round(Math.random() * 4294967295);         /*--- unique number ---*/
   __utmd  = new Date();                                     /*--- current date/time epoch ---*/
   __utmst = Math.round(__utmd.getTime()/1000);              /*--- session time ---*/

   if (__utmdn && __utmdn != "") { __utmdom = " domain="+__utmdn+";"; } /*--- domain ---*/
   /*--- timeout ---*/
   if (__utmtimeout && __utmtimeout != "") {
      __utmexp = new Date(__utmd.getTime()+(__utmtimeout*1000));
      __utmexp = " expires="+__utmexp.toGMTString()+";";
   }

   /*--------------------------------------------------
      grab cookies from the commandline
   --------------------------------------------------*/
   __utms = document.location.search;
   if (__utms && __utms != "" && __utms.indexOf("__utma=") >= 0) {
      __utma = __utmGetCookie(__utms,"__utma=","&");
      __utmb = __utmGetCookie(__utms,"__utmb=","&");
      __utmc = __utmGetCookie(__utms,"__utmc=","&");
      if (__utma != "-" && __utmb != "-" && __utmc != "-") __utmlf = 1;
      else if (__utma != "-")                              __utmlf = 2;
   }

   /*--------------------------------------------------
      based on the logic set cookies
   --------------------------------------------------*/
   if (__utmlf == 1) { 
      document.cookie="__utma="+__utma+"; path=/; expires=Sun, 18 Jan 2038 00:00:00 GMT;";
      document.cookie="__utmb="+__utmb+"; path=/;"+__utmexp;
      document.cookie="__utmc="+__utmc+"; path=/;";
      __utmfns=1;
   } else if (__utmlf == 2) { 
      __utma = __utmFixA(__utms,"&",__utmst); 
      document.cookie="__utma="+__utma+"; path=/; expires=Sun, 18 Jan 2038 00:00:00 GMT;";
      document.cookie="__utmb="+__utmdh+"; path=/;"+__utmexp;
      document.cookie="__utmc="+__utmdh+"; path=/;"
      __utmfns=1;
   } else if (__utma >= 0 && __utmb >= 0 && __utmc >= 0) { 
      document.cookie="__utmb="+__utmdh+"; path=/;"+__utmexp+__utmdom;
   } else if (__utma >=0) { 
      __utma = __utmFixA(document.cookie,";",__utmst); 
      document.cookie="__utma="+__utma+"; path=/; expires=Sun, 18 Jan 2038 00:00:00 GMT;"+__utmdom;
      document.cookie="__utmb="+__utmdh+"; path=/;"+__utmexp+__utmdom;
      document.cookie="__utmc="+__utmdh+"; path=/;"+__utmdom;
      __utmfns=1;
   } else if (__utma < 0 && __utmb < 0 && __utmc < 0) { 
      __utma = __utmCheckUTMI(__utmd); 
      if (__utma == "-")  __utma = __utmdh+"."+__utmu+"."+__utmst+"."+__utmst+"."+__utmst+".1"; 
      else                __utma = __utmdh+"."+__utma;
      document.cookie="__utma="+__utma+"; path=/; expires=Sun, 18 Jan 2038 00:00:00 GMT;"+__utmdom;
      document.cookie="__utmb="+__utmdh+"; path=/;"+__utmexp+__utmdom;
      document.cookie="__utmc="+__utmdh+"; path=/;"+__utmdom;
      __utmfns=1;
   } else {
      __utma = __utmdh+"."+__utmu+"."+__utmst+"."+__utmst+"."+__utmst+".1";
      document.cookie="__utma="+__utma+"; path=/; expires=Sun, 18 Jan 2038 00:00:00 GMT;"+__utmdom;
      document.cookie="__utmb="+__utmdh+"; path=/;"+__utmexp+__utmdom;
      document.cookie="__utmc="+__utmdh+"; path=/;"+__utmdom;
      __utmfns=1;
   }
   __utmSetInfo();
   __utmf = 1;
}

function __utmSetInfo() {
   var __utmr="-",__utmp;
   var __utmi = new Image(1,1);
   var __utmsrc = __utmgifpath+"?";
   var loc = document.location;
   __utmr = document.referrer;
   if (!__utmr || __utmr == "") { __utmr = "-"; } 
   else { 
      __utmp = __utmr.indexOf(document.domain); 
      if ((__utmp >= 0) && (__utmp <= 8)) { __utmr = "0"; }
      if (__utmr.indexOf("[") == 0 && __utmr.lastIndexOf("]") == (__utmr.length-1)) { __utmr = "-"; }
   }
   __utmsrc += "utmn="+__utmu;
   if (__utmfsc && __utmfns) {__utmsrc += __utmGetClientInfo(); }
   if (__utmctm)             {__utmsrc += __utmSetCampaignInfo(); }
   __utmsrc += "&utmr="+__utmr+"&utmp="+loc.pathname+loc.search;
   __utmi.src = __utmsrc;
   return 0;
}

function __utmSetCampaignInfo() {
    var __utmcc = "";
    var __utmtmp = "-";
    var __utmcnew = "&utmcn=1";
    var __utmx = document.location.search;
    var __utmz = document.cookie.indexOf("__utmz="+__utmdh);
    if (__utmz > -1) {
       __utmz = __utmGetCookie(document.cookie,"__utmz=",";");
    } else { __utmz = "-"; }

    /*--- check for campaign info ---*/
    __utmtmp = __utmGetCookie(__utmx,__utmccn+"=","&");
    if (__utmtmp == "-" || __utmtmp == "") { return ""; }
    __utmcc += "utmccn="+__utmtmp;
    __utmtmp = __utmGetCookie(__utmx,__utmcpr+"=","&"); if (__utmtmp != "-" && __utmtmp != "") __utmcc += "|utmcpr="+__utmtmp;
    __utmtmp = __utmGetCookie(__utmx,__utmcrs+"=","&"); if (__utmtmp != "-" && __utmtmp != "") __utmcc += "|utmcrs="+__utmtmp;
    __utmtmp = __utmGetCookie(__utmx,__utmcrl+"=","&"); if (__utmtmp != "-" && __utmtmp != "") __utmcc += "|utmcrl="+__utmtmp;
    __utmtmp = __utmGetCookie(__utmx,__utmctr+"=","&"); if (__utmtmp != "-" && __utmtmp != "") __utmcc += "|utmctr="+__utmtmp;
    __utmtmp = __utmGetCookie(__utmx,__utmcct+"=","&"); if (__utmtmp != "-" && __utmtmp != "") __utmcc += "|utmcct="+__utmtmp;

    /*--- check if campaign is already set ---*/
    if (!__utmfns && __utmz.indexOf(__utmcc) != -1) __utmcnew = "";


    /*--- check for userid in cookie ---*/
    __utmtmp = __utmGetCookie(__utmx,__utmcui+"=","&"); 
    if (__utmtmp != "-" && __utmtmp != "") { 
       __utmcc += "|utmcui="+__utmtmp;
    } else {
       __utmtmp = __utmGetCookie(__utmz,"utmcui=","|"); 
       if (__utmtmp != "-" && __utmtmp != "") { __utmcc += "|utmcui="+__utmtmp; } 
    }

    /*--- check for email in cookie ---*/
    __utmtmp = __utmGetCookie(__utmx,__utmccu+"=","&"); 
    if (__utmtmp != "-" && __utmtmp != "") { 
       __utmcc += "|utmccu="+__utmtmp;
    } else {
       __utmtmp = __utmGetCookie(__utmz,"utmccu=","|"); 
       if (__utmtmp != "-" && __utmtmp != "") { __utmcc += "|utmccu="+__utmtmp; } 
    }

    /*--- set the cookie ---*/
    if (!__utmcto || __utmcto == "") { __utmcto = "15768000"; }
    var __utmcx = new Date(__utmd.getTime()+(__utmcto*1000));
    __utmcx = " expires="+__utmcx.toGMTString()+";";
    document.cookie="__utmz="+__utmdh+"."+__utmst+"."+__utmcc+"; path=/; "+__utmcx+__utmdom;

    /*--- set the new campaign flag  ---*/
    return __utmcnew;
}

function __utmGetClientInfo() {
   var __utmtmp="-",__utmsr="-",__utmsa="-",__utmsc="-",__utmbs="-",__utmul="-";
   var __utmje=1,__utmce=1,__utmtz=0;
   if (self.screen) { 
      __utmsr = screen.width+"x"+screen.height;
      __utmsa = screen.availWidth+"x"+screen.availHeight;
      __utmsc = screen.colorDepth+"-bit";
   } else if (self.java) {
      var __utmjk = java.awt.Toolkit.getDefaultToolkit();
      var __utmjksize = __utmjk.getScreenSize();       
      __utmsr = __utmjksize.width+"x"+__utmjksize.height;
   } 
   if( typeof( window.innerWidth ) == 'number' ) {
      __utmbs = window.innerWidth+"x"+window.innerHeight;
   } else { 
     if (document.documentElement && 
       (document.documentElement.offsetHeight || document.documentElement.offsetWidth ) ) {
        __utmbs = document.documentElement.offsetWidth+"x"+document.documentElement.offsetHeight;
     } else if (document.body && (document.body.offsetWidth || document.body.offsetHeight) ) {
        __utmbs = document.body.offsetWidth+"x"+document.body.offsetHeight;
     } 
   }
   for (var i=5;i>=0;i--) {
      var __utmtmp = "<script language='JavaScript1."+i+"'>__utmjv='1."+i+"';</script>"; 
      document.write(__utmtmp);
      if (__utmjv != "-") break;
   }
   if (navigator.language) { __utmul = navigator.language.toLowerCase(); }
   else if (navigator.browserLanguage) { __utmul = navigator.browserLanguage.toLowerCase(); }
   __utmje = navigator.javaEnabled()?1:0;
   if (document.cookie.indexOf("__utmb=") < 0) { __utmce = "0"; }
   if (document.cookie.indexOf("__utmc=") < 0) { __utmce = "0"; }
   __utmtz = __utmd.getTimezoneOffset();
   __utmtz = __utmTZConvert(__utmtz);
   __utmtmp ="";
   __utmtmp += "&utmsr="+__utmsr+"&utmsa="+__utmsa+"&utmsc="+__utmsc+"&utmbs="+__utmbs;
   __utmtmp += "&utmul="+__utmul+"&utmje="+__utmje+"&utmce="+__utmce+"&utmtz="+__utmtz+"&utmjv="+__utmjv;
   return __utmtmp;
}
function __utmLinker(__utmlink) {
   var __utmlp,__utmi,__utmi2,__utmta="-",__utmtb="-",__utmtc="-",__utmtz="-";

   if (__utmlink && __utmlink != "") { 
      if (document.cookie) {
         __utmta = __utmGetCookie(document.cookie,"__utma="+__utmdh,";");
         __utmtb = __utmGetCookie(document.cookie,"__utmb="+__utmdh,";");
         __utmtc = __utmGetCookie(document.cookie,"__utmc="+__utmdh,";");
         __utmtz = __utmGetCookie(document.cookie,"__utmz="+__utmdh,";");
         __utmlp = "__utma="+__utmta+"&__utmb="+__utmtb+"&__utmc="+__utmtc+"&__utmz="+__utmtz;
      }
      if (__utmlp) {
         if (__utmlink.indexOf("?") <= -1) { document.location = __utmlink+"?"+__utmlp; }
         else { document.location = __utmlink+"&"+__utmlp; }
      } else { document.location = __utmlink; }
   }
}
function __utmGetCookie(__utmclist,__utmcname,__utmcsep) {
   if (!__utmclist || __utmclist == "") return "-";
   if (!__utmcname || __utmcname == "") return "-";
   if (!__utmcsep  || __utmcsep  == "") return "-";
   var __utmi, __utmi2, __utmi3, __utmtc="-";

   __utmi = __utmclist.indexOf(__utmcname);
   __utmi3 = __utmcname.indexOf("=")+1;
   if (__utmi > -1) { 
      __utmi2 = __utmclist.indexOf(__utmcsep,__utmi); if (__utmi2 < 0) { __utmi2 = __utmclist.length; }
      __utmtc = __utmclist.substring((__utmi+__utmi3),__utmi2); 
   }
   return __utmtc;
}
function __utmSetDomain() {
   if (!__utmdn || __utmdn == "" || __utmdn == "none") { __utmdn = ""; return 1; }
   if (__utmdn == "auto") {
      var __utmdomain = document.domain;
      if (__utmdomain.substring(0,4) == "www.") {
         __utmdomain = __utmdomain.substring(4,__utmdomain.length);
      }
      __utmdn = __utmdomain;
   }
   if (__utmhash == "off") return 1;
   return __utmHash(__utmdn);
}
function __utmHash(__utmd) {
   if (!__utmd || __utmd == "") return 1;
   var __utmhash=0, __utmg=0;
   for (var i=__utmd.length-1;i>=0;i--) {
      var __utmc = parseInt(__utmd.charCodeAt(i)); 
      __utmhash = ((__utmhash << 6) & 0xfffffff) + __utmc + (__utmc << 14);
      if ((__utmg = __utmhash & 0xfe00000) != 0) __utmhash = (__utmhash ^ (__utmg >> 21));
   }
   return __utmhash;
}
function __utmFixA(__utmcs,__utmsp, __utmst) {
   if (!__utmcs || __utmcs == "") return "-";
   if (!__utmsp || __utmsp == "") return "-";
   if (!__utmst || __utmst == "") return "-";
   var __utmt = __utmGetCookie(__utmcs,"__utma=",__utmsp);
   var __utmlt=0;
   var __utmns=0;
   var __utmi=0;

   if ((__utmi=__utmt.lastIndexOf(".")) > 9) {
      __utmns = __utmt.substring(__utmi+1,__utmt.length);
      __utmns = (__utmns*1)+1;
      __utmt = __utmt.substring(0,(__utmi));

      if ((__utmi = __utmt.lastIndexOf(".")) > 7) {
         __utmlt = __utmt.substring(__utmi+1,__utmt.length);
         __utmt = __utmt.substring(0,(__utmi));
      }

      if ((__utmi = __utmt.lastIndexOf(".")) > 5) {
         __utmt = __utmt.substring(0,(__utmi));
      }
      __utmt += "."+__utmlt+"."+__utmst+"."+__utmns;
   }
   return __utmt;
}

function __utmCheckUTMI(__utmd) {
   var __utm1A = new Array();
   var __utmlst=0,__utmpst=0,__utmlvt=0,__utmlu=0,__utmi=0,__utmpi=0;
   var __utmap = "-";
   var __utmld = "";
   var __utmt2;
   var __utmt = document.cookie;

   while((__utmi = __utmt.indexOf("__utm1=")) >= 0) {
      __utm1A[__utm1A.length] = __utmGetCookie(__utmt,"__utm1=",";");
      __utmt = __utmt.substring(__utmi+7,__utmt.length);
   }
   if (__utm1A.length) {
      var __utmcts = Math.round(__utmd.getTime()/1000);
      var __utmlex = " expires="+__utmd.toGMTString()+";";
      __utmt = document.cookie; 
      if ((__utmi = __utmt.lastIndexOf("__utm3=")) >= 0) {
         __utmlst = __utmt.substring(__utmi,__utmt.length);
         __utmlst = __utmGetCookie(__utmlst,"__utm3=",";");
      }
      if ((__utmi = __utmt.lastIndexOf("__utm2=")) >= 0) {
         __utmpst = __utmt.substring(__utmi,__utmt.length);
         __utmpst = __utmGetCookie(__utmpst,"__utm2=",";");
      }
      for (var i=0;i<__utm1A.length;i++) {
         __utmt = __utm1A[i];
         if ((__utmi = __utmt.lastIndexOf(".")) >= 0) {
            __utmt2 = (__utmt.substring(0,__utmi))*1;
            __utmt  = (__utmt.substring(__utmi+1,__utmt.length))*1;
            if (__utmlvt == 0 || __utmt < __utmlvt) { 
               __utmlvt = __utmt;
               __utmlu  = __utmt2;
            }
         }
      }
      if (__utmlvt && __utmlst) { 
         if (!__utmpst ||  __utmpst > __utmlst) __utmpst = __utmlst;
         __utmap = __utmlu+"."+__utmlvt+"."+__utmpst+"."+__utmlst+".2"; 
      } else if (__utmlvt) { 
         if (!__utmpst || __utmpst > __utmcts) __utmpst = __utmcts;
         __utmap = __utmlu+"."+__utmlvt+"."+__utmpst+"."+__utmcts+".2";
      }
      __utmld = __utmt = document.domain;
      __utmi=__utmpi=0;
      while((__utmi = __utmt.indexOf(".",__utmpi+1)) >= 0) {
         if (__utmpi>0) __utmld = __utmt.substring(__utmpi+1,__utmt.length);
         __utmld = " domain="+__utmld+";"; 
         document.cookie="__utm1=1; path=/;"+__utmlex+__utmld;
         document.cookie="__utm2=1; path=/;"+__utmlex+__utmld;
         document.cookie="__utm3=1; path=/;"+__utmlex+__utmld;
         __utmpi=__utmi;
      }
      document.cookie="__utm1=1; path=/;"+__utmlex;
      document.cookie="__utm2=1; path=/;"+__utmlex;
      document.cookie="__utm3=1; path=/;"+__utmlex;
   }
   return __utmap;
}

function __utmTZConvert(__utmmz) {
   var __utmhr=0,__utmmn=0,__utmsg='+';
   if (__utmmz && __utmmz != "") {
      if (__utmmz <= 0) {__utmsg='+'; __utmmz*=-1; }
      else {__utmsg='-'; __utmmz*=1; }
      __utmhr = Math.floor((__utmmz/60)); 
      __utmmn = Math.floor((__utmmz%60)); 
   }
   if (__utmhr < 10) __utmhr = "0"+__utmhr;
   if (__utmmn < 10) __utmmn = "0"+__utmmn;
   return __utmsg+__utmhr+__utmmn;
}

// jquery modules

/**
* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
* 
* @param  f  onMouseOver function || An object with configuration options
* @param  g  onMouseOut function  || Nothing (use configuration options object)
* @author    Brian Cherne <brian@cherne.net>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);




/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-07-21 18:44:59 -0500 (Sat, 21 Jul 2007) $
 * $Rev: 2446 $
 *
 * Version 2.1.1
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b($){$.m.E=$.m.g=b(s){h($.x.10&&/6.0/.I(D.B)){s=$.w({c:\'3\',5:\'3\',8:\'3\',d:\'3\',k:M,e:\'F:i;\'},s||{});C a=b(n){f n&&n.t==r?n+\'4\':n},p=\'<o Y="g"W="0"R="-1"e="\'+s.e+\'"\'+\'Q="P:O;N:L;z-H:-1;\'+(s.k!==i?\'G:J(K=\\\'0\\\');\':\'\')+\'c:\'+(s.c==\'3\'?\'7(((l(2.9.j.A)||0)*-1)+\\\'4\\\')\':a(s.c))+\';\'+\'5:\'+(s.5==\'3\'?\'7(((l(2.9.j.y)||0)*-1)+\\\'4\\\')\':a(s.5))+\';\'+\'8:\'+(s.8==\'3\'?\'7(2.9.S+\\\'4\\\')\':a(s.8))+\';\'+\'d:\'+(s.d==\'3\'?\'7(2.9.v+\\\'4\\\')\':a(s.d))+\';\'+\'"/>\';f 2.T(b(){h($(\'> o.g\',2).U==0)2.V(q.X(p),2.u)})}f 2}})(Z);',62,63,'||this|auto|px|left||expression|width|parentNode||function|top|height|src|return|bgiframe|if|false|currentStyle|opacity|parseInt|fn||iframe|html|document|Number||constructor|firstChild|offsetHeight|extend|browser|borderLeftWidth||borderTopWidth|userAgent|var|navigator|bgIframe|javascript|filter|index|test|Alpha|Opacity|absolute|true|position|block|display|style|tabindex|offsetWidth|each|length|insertBefore|frameborder|createElement|class|jQuery|msie'.split('|'),0,{}))






/*!
 * Linkselect jQuery Plug-in
 *
 * Copyright 2008 Giva, Inc. (http://www.givainc.com/labs/) 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * 	http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Date: 2008-10-15
 * Rev:  1.2.02
 */
;(function($){
	// set the version of the link select
	$.linkselect = {version: "1.2.02"};
	
	$.fn.linkselect = function(options) {
		var method = typeof arguments[0] == "string" && arguments[0];
		var args = method && Array.prototype.slice.call(arguments, 1) || arguments;

		// if a method is supplied, execute it for non-empty results
		if( method && this.length ){
			// get a reference to the first linkselect found
			var self = $.data(this[0], "linkselect");

			// if request a copy of the object, return it			
			if( method.toLowerCase() == "object" ) return self;
			// if method is defined, run it and return either it's results or the chain
			else if( self[method] ){
				// define a result variable to return to the jQuery chain
				var result;
				this.each(function (i){
					// apply the method to the current element
					var r = $.data(this, "linkselect")[method].apply(self, args);
					// if first iteration we need to check if we're done processing or need to add it to the jquery chain
					if( i == 0 && r ){
						// if this is a jQuery item, we need to store them in a collection
						if( !!r.jquery ){
							result = $([]).add(r);
						// otherwise, just store the result and stop executing
						} else {
							result = r;
							// since we're a non-jQuery item, just cancel processing further items
							return false;
						}
					// keep adding jQuery objects to the results
					} else if( !!r && !!r.jquery ){
						result = result.add(r);
					}
				});

				// return either the results (which could be a jQuery object) or the original chain
				return result || this;
			// everything else, return the chain
			} else return this;
		// initializing request
		} else {
			// create a new linkselect for each object found
			return this.each(function (){
				new $.LinkSelect(this, options);
			});
		};
	};

	$.LinkSelect = function (el, options){
		options = $.extend({}, $.LinkSelect.defaults, options);
		
		var self = this, select = el, $select = $(el), shortcuts = {}, disabled = false, current_char_pos = 0, last_char_code, is_open = false;
		
		// store the global properties
		this.id = $select.attr("id");
		
		// get/set the value of the field
		this.val = function (value, doCallback){
			// update the selected value
			if( arguments.length > 0 ){
				setSelectedItem(value, doCallback);
				return $a;
			} 
			else return $input.val();
		};

		// set the focus to the field		
		this.focus = function (){
			// place focus asynchronously to avoid click collisions
			setTimeout(function(){$a.focus();}, 1);
			return $a;
		};
		
		// set the blur to the field		
		this.blur = function (){
			// place focus asynchronously to avoid click collisions
			setTimeout(function(){$a.blur();}, 1);
			return $a;
		};
		
		// place focus and open the menu
		this.open = function (callback, bDoFocus){
			// if disabled, skip processing
			if( disabled ) return $a;
			// close any open linkselects
			$(document).triggerHandler("click.linkselect");
			// place focus
			if( bDoFocus !== false ) $a.trigger("focus");
			// show the options asynchronously to avoid click collisions
			setTimeout(function(){ showOptions(callback); }, 1);
			return $a;
		}
		
		// disable the link
		this.disable = function (status){
			disabled = status;
			// remove any existing disabled label
			$a.parent().find("span." + options.classDisabled).remove();
			// show/hide the anchor depending on the disabled status
			$a[disabled ? "hide" : "show"]();
			// if disabled, add a span			
			if( disabled ) $a.after('<span class="' + options.classDisabled + '">' + $a.html() + '</span>');
			return $a;
		}
		
		// replace the options
		this.replaceOptions = function (options, doCallback){
			// remove the current options
			$select.children('option').remove();

			// add each new item
			$.each(options, function (i){
				// create the new option
				var $option = $("<option/>").attr("value", this.value).html(this.text);
				// check to see if the option should be selected
				if( this.selected == true ) $option.attr("selected", "selected");
				// if any classes were specified, add them
				if( this.className ) $option.addClass(this.className);
				// add the new option to the array
				$option.appendTo($select);
			});
			
			// we need to repaint the dropdown so the widht/height all get recalculated based on the new properties
			repaint();
			// bind the new triggers
			bindItems();
			// update the selected value
			getSelectedItem().trigger("click.linkselect", [true, doCallback]);
		};
		
		var $html = createHtml();

		// insert the new html and remove the old stuff
		//$select.after($html).remove();
		// BEGIN: jkedit - Do no remove the select html but add style to hide it:
		$select.after($html);
		// Do not need line below. Hidding the original select dropdowns initially with CSS
		//$select.addClass("customSelect_hidden");
		// END: jkedit
		
		
		// get the hidden input field
		var $input = $html.filter("input");
		// get anchor
		var $a = $html.filter("a");
		// get container
		var $container = $html.filter("div");
		// get scrollable list
		var $scrollable = $html.find(".scrollable");
		// get the title
		var $title = $html.find(".title");
		// get the list
		var $ul = $container.find("ul");
		// track last event
		var lastCurrentEvent;
		
		// copy the class statements to the input field (this is so class based selectors still work)
		$input.addClass($select.attr("className"));
		
		// store a reference to this link select
		$.data($input[0], "linkselect", this);
		
		// move the container to the main body so it can be correctly positioned absolutely
		$container
			// add the container to the body (this is so we can correctly absolutely position it)
			.appendTo("body") // default: "body"
			// if user is moving the mouse, we want to make sure to trigger the mouseover event
			.bind("mousemove.linkselect", function (e){
				lastCurrentEvent = e;
				
				
			});
		
		// this function will bind the elements
		function bindItems(){
			$ul.find("li")
				.bind("mouseover.linkselect", function (e){
					// if we're moving via the keyboard, then kill processing
					if( lastCurrentEvent && lastCurrentEvent.type == "keydown" ) return;
					// highlight the current option
					setHighlightedItem($(this));
					lastCurrentEvent = e;
				})
				.bind("click.linkselect", function (e, nofocus, doCallback){
					// stop the default behavior
					e.preventDefault();
					// remove the selected class from the previous option
					var $previous = getSelectedItem().removeClass(options.classSelected);
					// get the currently selected item and remove the class
					var $current = $(this).addClass(options.classSelected);
					var value = $current.attr("rel") || "";
					var text = $current.find("." + options.classValue).html();
					// hide the container
					hideOptions(nofocus);

					// trigger the change callback if it's false, stop processing
					if( (doCallback !== false) && (($.isFunction(options.change) && (options.change.apply(self, [this, value, text, doCallback]) === false)) || ($.isFunction($select[0].onchange) && ($select[0].onchange.apply(self, [this, value, text, doCallback]) === false))) ){
						// restore the selected classes (since we're not selecting this option)
						$previous.addClass(options.classSelected);
						$current.removeClass(options.classSelected)
						return;
					}
					// update the hidden value
					$input.val(value);
					
					// -------------------------------------------------------------------
					// BEGIN: jkedit
					// We have the hidden input's value from above.
					// Now i'm trying to get the selectedIndex so i can set it on the real select dropdown menu
					var i = 0;
					//alert (select.length);
					//alert ("\"" + select[select.selectedIndex][(jQuery.browser.msie && !(select[select.selectedIndex].attributes['value'].specified)) ? "text" : "value"] + "\"");
					while ( (i < select.length) && (value != select[i][(jQuery.browser.msie && !(select[i].attributes['value'].specified)) ? "text" : "value"])) {
						//alert (value);
						//alert (select[i][(jQuery.browser.msie && !(select[i].attributes['value'].specified)) ? "text" : "value"]);
						i++;
					}
					// just double checking that selectedIndex doesn't get out of the boundaries
					if ( (i>=0) && (i<select.length) ) {
						select[i].selected = true;
					}
					//alert (select[select.selectedIndex][(jQuery.browser.msie && !(select[select.selectedIndex].attributes['value'].specified)) ? "text" : "value"]);
					// END
					// -------------------------------------------------------------------
					
					// update the text of the anchor and trigger the focus handler
					$a.html(text)[(nofocus !== true)?"trigger":"triggerHandler"]("focus", [nofocus]);
					// if the field is disabled, update the disabled label
					if( disabled ) $a.parent().find("span." + options.classDisabled).html(text);
				});
		};
		// bind events to the list items
		bindItems();
			
		$a.bind("click.linkselect", function(e){
			e.preventDefault();
			toggleOptions();
			// make sure the link has focus for IE6
			if( $.browser.msie ){
				setTimeout(function (){
					$a.trigger("focus.linkselect");
				}, 0);
			}
		})
		.bind("focus.linkselect", function (e, nofocus){
			// we need to make sure not to re-add the class for IE6 since we have to reset the focus
			if( !$container.is(":visible") && (nofocus !== true) ){
				$a.addClass(options.classLinkFocus);
			}
		})
		.bind("blur.linkselect", function (e){
			// if not coming from a live user event, then hide the options
			if( isJQueryEvent(e) ) hideOptions();
			$a.removeClass(options.classLinkFocus);
		})
		.bind("keypress.linkselect", function(e, e2){
			// if we've passed a copy of an event object, use that instead
			if( !!e2 ) var e = e2;
			
			var key = e.keyCode || e.charCode, cur_char = String.fromCharCode(key).toLowerCase();

			switch(key) {
				case 38: // up
				case 40: // down
					e.preventDefault();
					moveSelect((key == 38) ? -1 : 1);
					lastCurrentEvent = e;
					break;
				case 13: // return
					e.preventDefault();
					// only select the item if the menu is visible
					if( $container.is(":visible") ){
						$container.find('li.' + options.classCurrent).trigger('click.linkselect');
					} else {
						$a.trigger('click.linkselect');
					}
					break;
				case 9: // tab
				case 27: // escape
					hideOptions();
				  break;
				case 35: // end
					e.preventDefault();
					moveLast();
					lastCurrentEvent = e;
				  break;
				case 36: // home
					e.preventDefault();
					moveFirst();
					lastCurrentEvent = e;
				  break;
				case 33: // page up
				case 34: // page down
					e.preventDefault();
					var isVisible = $container.is(":visible");
					// show the container so we can get heights
					if( !isVisible ) $container.show();
					var iItemsPerPage = parseInt($scrollable.height()/$ul.find("li:first").outerHeight(), 10);
					// now hide the container
					if( !isVisible ) $container.hide();
					// move up/down the total number of items visible
					moveSelect((key == 33) ? iItemsPerPage * -1 : iItemsPerPage);
				  break;
			}
			
			// if we're pressed a different key, then restart the array position
			if( cur_char != last_char_code ) current_char_pos = 0;
			// store the current character
			last_char_code = cur_char;
			
			// check to see if there's a keyboard shortcut configured for the key press
			if( typeof shortcuts[cur_char] != "undefined" ){
				// if we're outside the bounds of the array, go back to zero
				if( current_char_pos >= shortcuts[cur_char].length ) current_char_pos = 0;

				// if there is, trigger the click event
				$ul.find('#' + self.id + '_li_' + shortcuts[cur_char][current_char_pos]).trigger("click.linkselect");
				e.preventDefault();
				e.stopPropagation();

				// increase the array position
				current_char_pos++;
			}
		});

		// IE6 doesn't register certain keypress events, so we must catch them during the keydown event
		if( $.browser.msie ) $a.bind("keydown.linkselect", function (e){
			// check to see if a key was pressed that IE6 doesn't trigger a keypress event for
			if( ",8,9,33,34,35,36,37,38,39,40,".indexOf("," + e.keyCode + ",") > -1 ) return $(this).triggerHandler("keypress.linkselect", [e]);
		});

		// we need to close the menu if we don't click on it
		$(document).bind("click.linkselect", function (e){
			if( (e.target !== $a[0]) && (e.target !== $scrollable[0]) && $container.is(":visible") ){
				hideOptions();
				// make sure we remove the focus class
				$a.removeClass(options.classLinkFocus);
			}
		});
		
		// move the layer on a resize
		$(window).resize(function (){
			if( is_open )
				anchorTo($a, $container, true)
		});

		// create the replacement html
		function createHtml(){
			
			var id = self.id;
			var title = $select.attr("title");
			// get the selected text
			var text = select.selectedIndex == -1 ? "" :select[select.selectedIndex].text;
			var value = select.selectedIndex == -1 ? "" :select[select.selectedIndex][(jQuery.browser.msie && !(select[select.selectedIndex].attributes['value'].specified)) ? "text" : "value"];
			// get the current tab index and make sure to copy it
			var tabindex = $select.attr("tabindex");
			
			var aHtml = [
				'<a href="#' + self.id + '" id="' + self.id + '_link" class="' + options.classLink + '"' + (tabindex ? ' tabindex="' + tabindex + '"' : '') + '>' + text + '</a>'
				, '<input type="hidden" name="' + self.id + '_selval" id="' + self.id + '_selval" value="' + value + '" />'
				, '<div class="' + options.classContainer + '">'
					, (title) ? '<div class="title"><span>' + title + '</span></div>' : ''
					, '<div class="scrollable"><ul id="' + self.id + '_list">'
					, generateOptions($select.children('option'))
					, '</ul></div>'
				, '</div>'
			];

			// generate and return the new HTML			
			return $(aHtml.join(""));
		}
		
		function generateOptions($options){
			// purge the shortcut list
			shortcuts = [];
			// an array to store the <li/> tags we're creating
			var lis = [];
			$options.each(function(i){
				var $option = $(this);
				var bSelected = $option.is(":selected");
				var label = $.trim($option.text());
				var html = '<span class="' + options.classValue + '">' + label + '</span>';
				var value = jQuery.browser.msie && !(this.attributes['value'].specified) ? this.text : this.value
				
				// if a special format renderer has been specified, use it (will use original HTML if format function returns false or undefined)
				if( $.isFunction(options.format) ) html = options.format.apply(self, [html, value, label, i, $option, options]) || html;
				
				var first_char = (label.length > 1) ? label.substring(0, 1).toLowerCase() : "";
				
				// create an array of shortcut keys
				if( !shortcuts[first_char] ) shortcuts[first_char] = [];
				// push the position into the array
				shortcuts[first_char].push(i);
				
				// get the current class statement				
				var cn = $.trim(this.className + ' ' + (bSelected ? options.classSelected : ''));
				
				lis.push('<li id="' + self.id + '_li_' + i + '" rel="' + value + (cn.length > 0 ? '" class="' + cn : '') + '">' + html + '</li>');
			});
			
			return lis.join("");
		}
		
		function repaint(){
			// make sure we re-init the menu width on first show
			bFixedWidth = false;
			// clear styles that will effect recalculating the width of the drop down
			$container[0].style.width = "";
			$title[0].style.width = "";
			$title.css("float", "");
			
			// re-generate get the html making up all the new options and update the cache
			$ul.html(generateOptions($select.children('option')));
		}

		// set the currently selected item
		function setSelectedItem(value, doCallback){
			// look for the currently selected item
			var $selected = $ul.find("li[rel=" + value + "]");
			
			// if nothing is selected, get the first item
			if( $selected.length == 0 ) $selected = $ul.find("li:eq(0)");

			// return the selected item			
			return $selected.trigger("click.linkselect", [true, doCallback]);
		}

		// get the currently selected item
		function getSelectedItem(){
			// look for the currently selected item
			var $selected = $ul.find("li.selected");

			// if nothing is selected, get the first item
			if( $selected.length == 0 ) $selected = $ul.find("li:eq(0)");

			// return the selected item			
			return $selected;
		}
		
		// get the currently selected item
		function getHighlightedItem(){
			// look for the currently selected item
			var $selected = $ul.find("li.current");

			// if nothing is selected, get the first item
			if( $selected.length == 0 ) $selected = getSelectedItem();

			// return the selected item			
			return $selected;
		}
		
		function setHighlightedItem($el){
			// remove the currently selected item
			$container.find(".current").removeClass(options.classCurrent);
			// highlight the current row
			$el.addClass(options.classCurrent);
			return $el;
		}

		// move the selected item
		function moveSelect(step){
			// get the currently selected item
			var $current = getHighlightedItem();
			var pos = parseInt($current.attr("id").replace(/(.+)(_(\d+$))/gi, "$3"), 10);

			moveTo(pos + step);
		}

		// move the selected item
		function moveTo(pos){
			var $li = $("li", $container), $next;
			// if the options are empty, cancel request
			if( !$li || $li.length == 0 ) return false;
			
			// get the currently selected item
			var $current = getHighlightedItem().removeClass(options.classCurrent);

			// don't go lower than first item	
			if( isNaN(pos) || pos < 0 ){
				$next = $li.eq(0);
			// if greater than last position	
			} else if( pos > $li.length - 1 ){
				$next = $li.eq($li.length - 1);
			// get the first item
			} else {
				$next = $li.eq(pos);
			}
			
			// if the container is open
			if( $container.is(":visible") ){
				// change highlighted option
				$next.addClass(options.classCurrent);
				// make sure the item is in the viewable area
				scrollIntoView($next);
			} else {
				// only trigger the click if we've moved positions
				if( $current[0] !== $next[0] ) $next.trigger("click.linkselect");
			}
		}
		
		function moveFirst(){
			moveTo(0);
		}

		function moveLast(){
			moveTo($select.children('option').length-1);
		}

		function scrollIntoView($el, center){
			var el = $el[0];
			var scrollable = $scrollable[0];
			// get the padding which is need to adjust the scrollTop
			var s = {pTop: parseInt($scrollable.css("paddingTop"), 10)||0, pBottom: parseInt($scrollable.css("paddingBottom"), 10)||0, bTop: parseInt($scrollable.css("borderTopWidth"), 10)||0, bBottom: parseInt($scrollable.css("borderBottomWidth"), 10)||0};
	
			// scrolling down
			if( (el.offsetTop + el.offsetHeight) > (scrollable.scrollTop + scrollable.clientHeight) ){
				scrollable.scrollTop = $el.offset().top + (scrollable.scrollTop - $scrollable.offset().top) - ((scrollable.clientHeight/((center == true) ? 2 : 1)) - ($el.outerHeight() + s.pBottom));
			// scrolling up
			} else if( el.offsetTop - s.bTop - s.bBottom <= (scrollable.scrollTop + s.pTop + s.pBottom) ){
				scrollable.scrollTop = $el.offset().top + (scrollable.scrollTop - $scrollable.offset().top) - s.pTop;
			}
		}
	
		function toggleOptions(){
			if( $container.is(":visible") ) hideOptions();
			else showOptions();
		}
		
		var bFixedWidth = false;
		function showOptions(callback){
			// get the currently selected item
			var $selected = getSelectedItem();
			// add the a class to the anchor showing we're open
			$a.removeClass(options.classLinkFocus).addClass(options.classLinkOpen);
			// display the options
			$container.show();
			// fix the width of the container
			if( !bFixedWidth ){
				// get the width of the anchor link unless inline, then grab width of parent
				var aw = ($a.css("display").indexOf("inline") > -1) ? $a.parent().outerWidth() : $a.outerWidth();
				// get the original width of the container
				var width = options.fixedWidth ? aw : $container.width();
				// make sure the width of the drop down is at least as wide as the link
				if( width < aw ) width = aw;
				
				// get the list element
				var maxHeight = parseInt($scrollable.css("max-height"), 10);

				// if IE6, we need to apply max-width/max-height rules (which are not support in IE)
				if( $.browser.msie && $.browser.version <= 6 ){
					if( (maxHeight > 0) && ($scrollable.height() > maxHeight) ) $scrollable.height(maxHeight);
				}
				
				// if scrolling list, adjust the width for the scrollbars
				if( $ul.height() > maxHeight ) width += 25;

				// make sure the width of everything isn't greater than the max-width CSS property
				var maxWidth = parseInt("0" + $container.css("max-width"), 10);
				if( (maxWidth > 0) && (width > maxWidth) ) width = aw = maxWidth;
				
				// adjust the width of the dropdown
				$container.width('217px');

				// webkit has a bug with detecting "max-width", so we must double check after setting the container width
				if( $.browser.safari ){
					var cw = $container.width();
					if( aw > cw ) width = aw = cw;
				}
				
				// make the title bar the width of the anchor
				$title.width('217px');

				// adjust the width for any padding in the title bar				
				if( $title.outerWidth() > aw ) $title.width(aw - ($title.outerWidth()-aw));

				// check to see if we should right-align the title
				if( options.titleAlign.toLowerCase() == "right" && !options.fixedWidth ) $title.css("float", "right");

				// mark that we've fixed the width
				bFixedWidth = true;
			}
			// anchor the options to the link
			anchorTo($a, $container, true);
			// if the bgIframe exists, use the plug-in
			if( !!$.fn.bgIframe ) $container.bgIframe();
			// scroll the selected item into view
			scrollIntoView($selected, true);
			// highlight the current option
			setHighlightedItem($selected);
			// run the open callback
			if( $.isFunction(options.open) ) options.open.apply(this, [$container, $a, $selected, $title]);
			// run any manual callback
			if( $.isFunction(callback) ) callback.apply(this, [$container, $a, $selected, $title]);
			is_open = true;
			
			// BEGIN: jkedit - set DropdownIsOpen
			DropdownIsOpen = true;
			//alert ("showOptions: " + DropdownIsOpen);
			// END: jkedit - set DropdownIsOpen
			
		}

		function hideOptions(nofocus){
			// tell the anchor we're no longer open
			if( nofocus !== true ) $a.addClass(options.classLinkFocus).removeClass(options.classLinkOpen);
			$container.hide();
			if( $.isFunction(options.close) ) options.close.apply(this, [$container, $a, $selected, $title]);
			is_open = false;
			
			// BEGIN: jkedit - set DropdownIsOpen
			DropdownIsOpen = false;
			//alert ("hideOptions: " + DropdownIsOpen);
			// END: jkedit - set DropdownIsOpen
		}

		function position($el){
			var bHidden = false;
			// if the element is hidden we must make it visible to the DOM to get
			if ($el.is(":hidden")) {
				bHidden = !!$el.css("visibility", "hidden").show();
			}
			
			// use offset to get the actual viewport position of the element (and not it's relative position)
			var pos = $.extend($el.offset(),{
				  width: $el.outerWidth()
				, height: $el.outerHeight()
				, marginLeft: parseInt($.curCSS($el[0], "marginLeft", true), 10) || 0
				, marginRight: parseInt($.curCSS($el[0], "marginRight", true), 10) || 0
				, marginTop: parseInt($.curCSS($el[0], "marginTop", true), 10) || 0
				, marginBottom: parseInt($.curCSS($el[0], "marginBottom", true), 10) || 0
			});
			
			if( pos.marginTop < 0 ) pos.top += pos.marginTop;
			if( pos.marginLeft < 0 ) pos.left += pos.marginLeft;
			
			pos["bottom"] = pos.top + pos.height;
			pos["right"] = pos.left + pos.width;
			
			// hide the element again
			if( bHidden ) $el.hide().css("visibility", "visible");
	
			return pos;
		}
		
		function anchorTo($anchor, $target){
			var pos = position($anchor);
			// get the screen dimensions
			var sd = getScreenDimensions();

			// get the far right edge of the option container
			var farRight = $container.outerWidth() + pos.left;
			
			// if we're going to be off the screen, adjust the position
			if( farRight > sd.x ){
				// adjust to the left by subtracting the list width and then adding the width of the title (which will cover up the anchor text)
				pos.left = (pos.left - $container.outerWidth()) + $title.outerWidth();
			} else {
				// since the container isn't offscreen, see if we need to expand the width of the title bar
				var cow = $container.outerWidth(), tow = $title.outerWidth();
				// expand the title bar to the width of the container, subtracting the difference in padding
				if( cow > tow ) $title.width(cow - (tow - $title.width()));
			}

			$target.css({
				  position: "absolute"
				, top: pos[options.yAxis]
				, left: pos.left
			});
			
			return pos.bottom;
		}

		function getScreenDimensions(){
			var d = {
				  scrollLeft: $(window).scrollLeft()
				, scrollTop:  $(window).scrollTop()
				, width:      $("body").width()     // changed from innerWidth
				, height:     $("body").height()    // changed from innerHeight			
			};
			
			// calculate the correct x/y positions
			d.x = d.scrollLeft + d.width;
			d.y = d.scrollTop + d.height;
			
			return d;
		}
		
		function isJQueryEvent(e){
			return !("bubbles" in e || "cancelBubble" in e);
		}
		
		// invoke the init callback
		if( $.isFunction(options.init) ) options.init.apply(this, [$select, $input, $a, $container, $scrollable, $title, $ul]);
	};

	$.LinkSelect.defaults = {
		  classLink: "linkselectLink"             // the class to use for the anchor tag
		, classLinkOpen: "linkselectLinkOpen"     // the anchor's class when the dropdown is shown
		, classLinkFocus: "linkselectLinkFocus"   // the anchor's class when it has focus
		, classContainer: "linkselectContainer"   // the class to the container that holds the options
		, classSelected: "selected"               // the class of the currently selected item
		, classCurrent: "current"                 // the class of the highlighted item
		, classDisabled: "linkselectDisabled"     // the class used on the text when the linkselect is disabled
		, classValue: "linkselectValue"           // the class used for each item in the dropdown
		, yAxis: "bottom"                            // the position of the dropdown relative to the link (can be either "top" or "bottom")
		, titleAlign: "left"                     // location of dropdown's title bar if dropdown is on right edge of the screen (can be either "right" or "left")
		, fixedWidth: true                       // false = dropdown sizes to width of options, true = dropdown uses width of link
		, init: null                              // callback that occurs when a linkselect menu is initialized
		, change: null                            // callback that occurs when an option is selected
		, format: null                            // callback that occurs when rendering the HTML to use for an item in the dropdown
		, open: null                             // callback that occurs when the menu is opened [null]
		, close: null                             // callback that occurs when the menu is closed
	};

})(jQuery);







/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-07-21 18:44:59 -0500 (Sat, 21 Jul 2007) $
 * $Rev: 2446 $
 *
 * Version 2.1.1
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b($){$.m.E=$.m.g=b(s){h($.x.10&&/6.0/.I(D.B)){s=$.w({c:\'3\',5:\'3\',8:\'3\',d:\'3\',k:M,e:\'F:i;\'},s||{});C a=b(n){f n&&n.t==r?n+\'4\':n},p=\'<o Y="g"W="0"R="-1"e="\'+s.e+\'"\'+\'Q="P:O;N:L;z-H:-1;\'+(s.k!==i?\'G:J(K=\\\'0\\\');\':\'\')+\'c:\'+(s.c==\'3\'?\'7(((l(2.9.j.A)||0)*-1)+\\\'4\\\')\':a(s.c))+\';\'+\'5:\'+(s.5==\'3\'?\'7(((l(2.9.j.y)||0)*-1)+\\\'4\\\')\':a(s.5))+\';\'+\'8:\'+(s.8==\'3\'?\'7(2.9.S+\\\'4\\\')\':a(s.8))+\';\'+\'d:\'+(s.d==\'3\'?\'7(2.9.v+\\\'4\\\')\':a(s.d))+\';\'+\'"/>\';f 2.T(b(){h($(\'> o.g\',2).U==0)2.V(q.X(p),2.u)})}f 2}})(Z);',62,63,'||this|auto|px|left||expression|width|parentNode||function|top|height|src|return|bgiframe|if|false|currentStyle|opacity|parseInt|fn||iframe|html|document|Number||constructor|firstChild|offsetHeight|extend|browser|borderLeftWidth||borderTopWidth|userAgent|var|navigator|bgIframe|javascript|filter|index|test|Alpha|Opacity|absolute|true|position|block|display|style|tabindex|offsetWidth|each|length|insertBefore|frameborder|createElement|class|jQuery|msie'.split('|'),0,{}))






/**
 * jQuery.labelify - Display in-textbox hints
 * Stuart Langridge, http://www.kryogenix.org/
 * Released into the public domain
 * Date: 25th June 2008
 * @author Stuart Langridge
 * @version 1.3
 *
 *
 * Basic calling syntax: $("input").labelify();
 * Defaults to taking the in-field label from the field's title attribute
 *
 * You can also pass an options object with the following keys:
 *   text
 *     "title" to get the in-field label from the field's title attribute 
 *      (this is the default)
 *     "label" to get the in-field label from the inner text of the field's label
 *      (note that the label must be attached to the field with for="fieldid")
 *     a function which takes one parameter, the input field, and returns
 *      whatever text it likes
 *
 *   labelledClass
 *     a class that will be applied to the input field when it contains the
 *      label and removed when it contains user input. Defaults to blank.
 *  
 */
jQuery.fn.labelify = function(settings) {
  settings = jQuery.extend({
    text: "title",
    labelledClass: ""
  }, settings);
  var lookups = {
    title: function(input) {
      return $(input).attr("title");
    },
    label: function(input) {
      return $("label[for=" + input.id +"]").text();
    }
  };
  var lookup;
  var jQuery_labellified_elements = $(this);
  return $(this).each(function() {
    if (typeof settings.text === "string") {
      lookup = lookups[settings.text]; // what if not there?
    } else {
      lookup = settings.text; // what if not a fn?
    };
    // bail if lookup isn't a function or if it returns undefined
    if (typeof lookup !== "function") { return; }
    var lookupval = lookup(this);
    if (!lookupval) { return; }

    // need to strip newlines because the browser strips them
    // if you set textbox.value to a string containing them    
    $(this).data("label",lookup(this).replace(/\n/g,''));
    $(this).focus(function() {
      if (this.value === $(this).data("label")) {
        this.value = this.defaultValue;
        $(this).removeClass(settings.labelledClass);
      }
    }).blur(function(){
      if (this.value === this.defaultValue) {
        this.value = $(this).data("label");
        $(this).addClass(settings.labelledClass);
      }
    });
    
    var removeValuesOnExit = function() {
      jQuery_labellified_elements.each(function(){
        if (this.value === $(this).data("label")) {
          this.value = this.defaultValue;
          $(this).removeClass(settings.labelledClass);
        }
      })
    };
    
    $(this).parents("form").submit(removeValuesOnExit);
    $(window).unload(removeValuesOnExit);
    
    if (this.value !== this.defaultValue) {
      // user already started typing; don't overwrite their work!
      return;
    }
    // actually set the value
    this.value = $(this).data("label");
    $(this).addClass(settings.labelledClass);

  });
};



var HeaderDropdownMouseOver = false;
var DropdownIsOpen = false;


// ------------------------------------------------------------------------------
// BEGIN: PrimaryNavOver/PrimaryNavOut
// Variable used to fix IE bug where select/option dropdown is making nav header hide
function isReal() {
    var evt = window.event;
    if (!evt) {
        return true;
    }

    var el;
    if (evt.type === "mouseout") {
        el = evt.toElement;
    } else if (evt.type === "mouseover") {
        el = evt.fromElement;
    }
    if (!el) {
        return false;
    }
    while (el) {
        if (el === evt.srcElement) {
                return false;
        }
        el = el.parentNode;
    }
    return true;
}

var selectMenuOver = false;
function PrimaryNavOver() {
	if (isReal()) {
		selectMenuOver = true;
	}
}
function PrimaryNavOut() {
	if (isReal()) {
		selectMenuOver = false;
	}
}
// END: PrimaryNavOver/PrimaryNavOut






// Jquery
$(document).ready(function() {
	
	// ------------------------------------------------------------------------------
	// replace select objects
	//$('.main_content .customSelect').linkselect({fixedWidth: true});
	
	/*JSEDIT
	// why is this needed again?
	$('#header select').linkselect({
	 fixedWidth: true
	 // CHANGED: removed the init function appending the linkselect to the container element. 
	 // because seems that linkselect's positioning is done with window offsets
	});*/


	//JSEDIT $(":text").labelify();

	// page tools image rollovers
	// Preload all rollovers
	
	
	$('a.hasHover img').each(function() {
		// Set the original src
		rollsrc = $(this).attr('src');
		
		if(rollsrc.indexOf('.gif') >= 0)
		    rollON = rollsrc.replace(/.gif$/ig,'_on.gif'); // strip off extension
		else if(rollsrc.indexOf('.ashx') >= 0)
		    rollON = rollsrc.replace(/.ashx$/ig,'_on.ashx'); // strip off extension for ashx too (Chait)
		$('<img>').attr('src', rollON);
	});
	
	// rollovers (if links)
	var imgsrc; 
	$('a.hasHover').mouseover(function(){
		imgsrc = $(this).children('img').attr('src');
		matches = imgsrc.match(/_on/);
		// don't do the rollover if state is already ON
		if (!matches) {
		    if(imgsrc.indexOf('.gif') >= 0)
		        imgsrcON = imgsrc.replace(/.gif$/ig,'_on.gif'); // strip off extension
		    else if(imgsrc.indexOf('.ashx') >= 0)
		        imgsrcON = imgsrc.replace(/.ashx$/ig,'_on.ashx'); // strip off extension for ashx too (Chait)

		$(this).children('img').attr('src', imgsrcON);
		}
	});
	$('a.hasHover').mouseout(function(){
		$(this).children('img').attr('src', imgsrc);
	});
	// rollovers (if links)
	$('input.hasHover').mouseover(function(){
		imgsrc = $(this).attr('src');
		matches = imgsrc.match(/_on/);
		// don't do the rollover if state is already ON
		if (!matches) {
		imgsrcON = imgsrc.replace(/.gif$/ig,'_on.gif'); // strip off extension
		$(this).attr('src', imgsrcON);
		}
	});
	$('input.hasHover').mouseout(function(){
		$(this).attr('src', imgsrc);
	});
	
	
	// ------------------------------------------------------------------------------
	// BEGIN: .pngimg
	// For IE6 - fixes transparent image BUGS.
	/*
	var BrowserName = BrowserDetect.browser;
	var BrowserVersion = BrowserDetect.version;
	// Preload all rollovers
	if ( (BrowserName == "Explorer") && (BrowserVersion < 7) ) {
		
		$('a.pngimg, h1.pngimg, h2.pngimg').each(function(){
			imgsrc = $(this).children('img').attr('src');
			matches = imgsrc.match(/spacer.gif/);
			// don't do the rollover if state is already ON
			if (!matches) {
				$(this).children('img').attr('src', '/Images/CommonImages/spacer.gif');
				newFilter = "filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imgsrc + "', sizingMethod='crop');"
				$(this).children('img').attr('style', newFilter);
			}
		});
		
		// rollovers (if links)
		$('a.pngimg').mouseover(function(){
		    //alert ("hello");
			imgsrc = $(this).children('img').attr('style');
			matches = imgsrc.match(/_on/);
			// don't do the rollover if state is already ON
			if (!matches) {
				imgsrcON = imgsrc.replace(/.ashx/i,'_on.ashx'); // strip off extension
				$(this).children('img').attr('style', imgsrcON);
			}
		});
		$('a.pngimg').mouseout(function(){
			$(this).children('img').attr('style', imgsrc);
		});
		
	} else { // Rest of browsers - just do simple swapping
		// page tools image rollovers
		// Preload all rollovers
		$('a.pngimg img').each(function() {
			// Set the original src
			rollsrc = $(this).attr('src');
			rollON = rollsrc.replace(/.ashx/ig,'_on.png');
			$('<img>').attr('src', rollON);
		});
		// rollovers (if links)
		$('a.pngimg').mouseover(function(){
		    imgsrc = $(this).children('img').attr('src');
			matches = imgsrc.match(/_on/);
			// don't do the rollover if state is already ON
			if (!matches) {
			    imgsrcON = imgsrc.replace(/.ashx/ig,'_on.ashx'); // strip off extension
			    $(this).children('img').attr('src', imgsrcON);
			}
		});
		$('a.pngimg').mouseout(function(){
			$(this).children('img').attr('src', imgsrc);
		});
	}
	// END: .pngimg
	*/
	
	/*JSEDIT*/
	//$('html').addClass('js');


	// ------------------------------------------------------------------------------
	// BEGIN: Primary Nav jQuery
	var $overlay = $("#overlayBkgd").fadeTo(200, 0).hide();
	var quickSearchOpen = false;
	
	window.HidePanel = function() {
		if(quickSearchOpen == false) {
			if ($overlay.is(':animated')) {
				$overlay.stop().fadeTo(500, 0).hide();
			} else {
				$overlay.fadeTo(500, 0).hide();
			}
		}
		$($('.header a.tabOn').attr('rel')).fadeOut(500, 0);
		$('a.tabOn').removeClass('tabOn');
	}
	
	window.DelayHidePanel = function(t) {
		switch(t) {
			case 1:
				nav1timer = setTimeout("HidePanel()", 600);
				break;
			case 2:
				nav2timer = setTimeout("HidePanel()", 600);
				break;
			case 3:
				nav3timer = setTimeout("HidePanel()", 600);
				break;
			case 4:
				nav4timer = setTimeout("HidePanel()", 600);
				break;
			case 5:
				nav5timer = setTimeout("HidePanel()", 600);
				break;
			case 6:
				nav6timer = setTimeout("HidePanel()", 600);
				break;
			case 7:
				nav7timer = setTimeout("HidePanel()", 600);
				break;
		}
	}
	window.ClearPanelTimeout = function(t) {
		switch(t) {
			case 1:
				clearTimeout(nav1timer);
				break;
			case 2:
				clearTimeout(nav2timer);
				break;
			case 3:
				clearTimeout(nav3timer);
				break;
			case 4:
				clearTimeout(nav4timer);
				break;
			case 5:
				clearTimeout(nav5timer);
				break;
			case 6:
				clearTimeout(nav6timer);
				break;
			case 7:
				clearTimeout(nav7timer);
				break;
		}
	}
	window.clearTimeoutAll = function() {
		clearTimeout(nav1timer);
		clearTimeout(nav2timer);
		clearTimeout(nav3timer);
		clearTimeout(nav4timer);
		clearTimeout(nav5timer);
		clearTimeout(nav6timer);
		clearTimeout(nav7timer);
	}
	
	function NavFunctions(LinkId, PanelId, t) {
		/* On click - Show Primary Panel */
		$('#'+LinkId).click(function() {
			
			// Hide Any open Dropdown Menus
			$('div.linkselectContainer:visible').hide();
			
			clearTimeoutAll();
			/*alert (!$('#'+PanelId+':visible').length);*/
			if (!$('#'+PanelId+':visible').length) {
				/*alert ("Panel Not Open");*/
				HidePanel();
			}
			// Show Overlay BG
			/*$overlay
				.width( Math.max($(window).width(), $(document).width()) )
				.height( Math.max($(window).height(), $(document).height()) )
				.stop().fadeTo(500, 0.33).show();*/
			overlayInit();
			$overlay.stop().fadeTo(500, 0.33).show();
			
			// Hide Search results menu
			$('.instantsearchdropdown').fadeOut(200);
			quickSearchOpen = false;
			
			// Turn on Panel
			$("#"+PanelId).fadeIn(500);
			
			// Keeps arrow Blue and sets tab to On
			$(this).addClass('tabOn');
		});
		
		// Arrow mouseover/mouseout
		$("#"+LinkId).hover( function(){
			ClearPanelTimeout(t);
			/* Force quick Panel Hide if another Nav item is hovered */
			/*$(".navPanel").each(function(){
				if ($(this) != $("#"+PanelId)) {
					HidePanel();
				}
			});*/
			/*$("#"+PanelId).show();*/
		},function() {
			if ($('#'+PanelId+':visible').length) {
				DelayHidePanel(t); /*;alert('Arrow out');*/
			}
		});
		// Panel mouseover/mouseout
		$("#"+PanelId).hover( function(){
			ClearPanelTimeout(t);
		},function() {
			/* Only hide if there are no Dropdown Menus open inside the Panel */
			/*if (!$('div.linkselectContainer:visible').length) {
				DelayHidePanel(t);
			}*/
			/* above function Modified since now, we're using real dropdowns */
			if (selectMenuOver == false) {
				DelayHidePanel(t);
			}
		});
		// END: Primary Nav jQuery
	}
	
	// Initialize Primary Nav Functions Here:
	var nav1timer;
	NavFunctions("navArrowPeople", "navPeopleMenu", 1);
	var nav2timer;
	NavFunctions("navArrowPractices", "navPracticesMenu", 2);
	var nav3timer;
	NavFunctions("navArrowOffices", "navOfficesMenu", 3);
	var nav4timer;
	NavFunctions("navArrowOurFirm", "navOurFirmMenu", 4);
	var nav5timer;
	NavFunctions("navArrowNews", "navNewsMenu", 5);
	var nav6timer;
	NavFunctions("navArrowPublications", "navPublicationsMenu", 6);
	var nav7timer;
	NavFunctions("navArrowCareers", "navCareersMenu", 7);
	
	
	
	// Get window width and page height
	function getDimensions() {
			  winWidth = $(window).width();
			  pageHeight = $(document).height()
	}
	// set the size of the overlay
	function sizeOverlay() {
			  $("#overlayBkgd").width( winWidth );
			  $("#overlayBkgd").height( pageHeight );
	}
	// resize the overlay
	function overlayInit () {
			  getDimensions();
			  sizeOverlay();
	}
	// run on resize
	$(window).resize(function(){
		if ($("#overlayBkgd:visible").length) {
			overlayInit ();
		}
	});

	/* Hide All Things when clicking on Overlay background */
	$($overlay).click(function() {
		$('.instantsearchdropdown').fadeOut(200);
		
		quickSearchOpen = false;
		HidePanel();
	})
	
	// ------------------------------------------------------------------------------
	// BEGIN: Nav Search jQuery	
	var isOkToSearch = false;
    
	$(".headsearchbtn").click(function()
	{
	    return isOkToSearch;
	});
	
	$(".headsearchtxt").click(function(){
	    value_remove_focus(this);

	}).keyup(function(e){
	//alert('hello');
	    if (!e) var e = window.event;
	    if (e.keyCode) code = e.keyCode;
	    else if (e.which) code = e.which;
	    
	    //check keyCode is left or up or right or down then out
        if(code == '37' || code == '38' || code == '39' || code == '40')
            return;
	    
	    if(this.value != "" ){
		    $("#imgLoading").show();
            isOkToSearch = true;
            $.ajax({
                timeout: 700,
                type: "POST",
                url: "/utilities/instantsearch.aspx",
                data: "key=" + this.value,
                success: function(data){
                    $("#imgLoading").hide();
                    data=data.replace("<input type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\" value=\"/","<input type=\"hidden\" name=\"pg\" value=\"");
                    //alert(data);
		            if(data.indexOf('class="instantsearchresults"') > 0) {
                        $(".instantsearchdropdown").html(data);
                        
                        /*$overlay
				            .width( Math.max($(window).width(), $(document).width()) )
				            .height( Math.max($(window).height(), $(document).height()) )
				            .show().fadeTo(200,0.66);*/
								overlayInit();
								$overlay.stop().fadeTo(200, 0.33).show();
			
				            $('.instantsearchdropdown').fadeIn(200);
				            $($('.header a.tabOn').attr('rel')).fadeOut(0);
				            quickSearchOpen = true;
				            
				        bindEmailDisclaimerPopup();    
				    }
                    else {
                        $overlay.hide().fadeTo(200,0.0);
								$('.instantsearchdropdown').fadeOut(200);
								quickSearchOpen = false;	
                    }
                },
                error:function (d,msg){
                    $("#imgLoading").hide();
                }           
            });
		} else {
			$("#imgLoading").hide();
			$overlay.stop().fadeTo(200, 0).hide();
			$('.instantsearchdropdown').fadeOut(200);
			quickSearchOpen = false;		
		}		
		
	}).keypress(function(e){
	    if (!e) var e = window.event;
	    if (e.keyCode) code = e.keyCode;
	    else if (e.which) code = e.which;
	    
	    if(code == 13) {
	        isOkToSearch = false;
	    
	        if ($(this).val()!="")
	            isOkToSearch = true;
	    }
	
	}).blur(function(){
	    if($(this).val()=="")
	    {
	        $(this).val("SEARCH");
	        isOkToSearch = false;
	    }else
	        isOkToSearch = true;
	});
	// END: Nav Search jQuery
	
	
	
	// ------------------------------------------------------------------------------
	// Clear form input values
	$('input[value=Reset]').click(function() {
		var $thisForm = $(this).parents('form');
		$thisForm.find(':text').val('');
		$thisForm.find('a.linkselectLink').each(function() {
			var idFirst = this.id.split('_')[0];
			var resetVal = $('#' + idFirst + '_list').find('li:first').text();
			$('#' + idFirst).linkselect('val', resetVal);
		});
		return false;
	});
	
	// mainNavReset - used instead of inputs
	//start:main nav reset button
	$('a.mainNavReset').click(function(){
		var $thisFieldset = $(this).parents('fieldset');
		
		// This clears any input elements of type text
		$thisFieldset.find(':text').val('');
		
		// reset all the linkselectLink elements
		$thisFieldset.find('a.linkselectLink').each(function(){
			// looking for the id before _link
			var idFirst = this.id.split('_link')[0];
			var resetVal = $('#' + idFirst + '_list').find('li:first').text();
			
			// Find the hidden input idFirst_selval and set the new value
			// this function will then automatically reset the jQuery dropdowns
			$('#' + idFirst + "_selval").linkselect('val', resetVal);
		});
		
		// Clear the hidden select elements to the default value
		$thisFieldset.find('select').each(function(){
			$(this).find('option:first').attr('selected', 'selected').parent('select');
		});
		return false;
	});
	//end:main nav reset button

	// ------------------------------------------------------------------------------
	// hover spacer
	$('#subNav ul li.selected').prev().addClass('spacingHover');
	$('#subNav ul li.selected').next().addClass('spacingHover');
	$('#subNav ul li a').hover(function(){ 
		if ($(this).parent('li').hasClass('selected')){
			$(this).parent('li').removeClass('selected').addClass('selectedHover');
			$(this).parent('li').prev().addClass('spacingHover');
			$(this).parent('li').next().addClass('spacingHover');
		} else {
			$(this).parent('li').addClass('selected');
			$(this).parent('li').prev().addClass('spacingHover');
			$(this).parent('li').next().addClass('spacingHover');
		}
	}, function(){ 
		if ($(this).parent('li').hasClass('selectedHover'))	{
			$(this).parent('li').removeClass('selectedHover').addClass('selected');
			$(this).parent('li').prev().addClass('spacingHover');
			$(this).parent('li').next().addClass('spacingHover');
		} else {
			$(this).parent('li').removeClass('selected');
			$(this).parent('li').prev().removeClass('spacingHover');
			$(this).parent('li').next().removeClass('spacingHover');
			if ($(this).parent('li').siblings('li.selected')){
				var now = $(this).parent('li').siblings('li.selected');
				$(now).prev().addClass('spacingHover');
				$(now).next().addClass('spacingHover');
			}
		}
	});

  
	// expand and contract practices menus
	// initialize practice settings on page load, this keeps a clean version when js is disabled
	$('a.showSub').show();
	$('a.showNav').show();
	$('ul.listing li ul').hide();
	$('ul.listing li ul li a.selected').parents("ul:first").show();
	$('ul.listing li.active').find("a.showSub").hide();//html("&#8211;");
	$('ul.listing li.active ul').show();
	$('ul.listing li ul li a.on').parents("ul:first").show();
	$('a.showSub').click(function()
	{
		$($(this).siblings('ul')).toggle();
	//	$('ul.listing li.active').removeAttr("class");
		return false;
	});
	$('a.showSub').toggle( function()
		{
			$(this).parent(".practiceCol ul li").find("a.showSub").html("&#8211;");
		}, function()
		{
			$(this).parent(".practiceCol ul li").find("a.showSub").html("+");
		});	
		
		
//			
//	$('a.showSubNav').click(function()
//	{
//		$($(this).siblings('ul')).toggle();
//		return false;
//	});
//	$('a.showSubNav').toggle( function()
//		{
//			$(this).parent(".sectionNav ul.listing li.active").find("a.showSubNav").html("&#8211;");
//		}, function()
//		{
//			$(this).parent(".sectionNav ul.listing li.active").find("a.showSubNav").html("+");
//		});	
	
	// ---------------------------------------------------------
	// BEGIN: alternative expand and contract for navPanel
	/* Show/Hide Level 2 */
	$('a.showNav').toggle( function()
	{
		$(this).html("&#8211;"); // changes to " - "
		
		// If any 1 column item is "on" turn it off
		$(this).parents("ul").find(".showNav_on").click();
		// Hide all 2nd column items
		$($(this).attr("href")).siblings().hide();
		
		$(this).addClass("showNav_on");
		$($(this).attr("href")).show();
		return false;
	}, function()
	{
		// Check if 2nd column has any items "on" If so, click on it again so 3rd column boxes will hide.
		$($(this).attr("href")).find(".showNav_on").click();
		
		$(this).html("+");
		$(this).removeClass("showNav_on");
		$($(this).attr("href")).hide();
		
		return false;
	});	
	// END: alternative expand and contract for navPanel
	
	
	


	$('#advancedSearchLink').click(function()
	{
		$('fieldset#advanced_search').show();
		$('#advancedSearchLink').hide();
		return false;
	});
	
	$('.searchwithintxt').click(function()
	{
		value_remove_focus(this);
		return false;
	});
	
	bindEmailDisclaimerPopup();
	
    //start:dropnav reset button
    $('a.navReset').click(function(){
        $(this).parent().parent().find('select').each(function(){
            $(this).find('option:first').attr('selected', 'selected').parent('select');
        });
        $(this).parent().parent().find('input').val('');
    });
    //end:dropnav reset button
   
	
	
	
	
	
	

	// ---------------------------------------------------------------------------------------
    //start: printPage
    $('#aPrintPage').click(function(){
        window.print();
    });
    //end:printPage    
    
    function bindEmailDisclaimerPopup()
    {
        $('.emailDisclaimer').click(function(){
    
            var path = '/popup-pages/email-disclaimer.aspx?type=disclaimer';
                
            var email = $(this).find(".emailInfo").html();
            if(email != null)
                path += '&email=' + email;
            
            var guid = $(this).find(".guidInfo").html();
            if(guid != null)
                path += '&guid=' + guid;
            
            window.open(path,'disclaimer','toolbar=no,resizable=yes,scrollbars=yes,width=530,height=600');
        });
    }  
    
    //pdf icon options
	/*$('.toolPDF').click(function(){$('.pdf_option').show();})*/
	$('.pdf_option').click(function(){ $('.pdf_option').hide();})
	$('.pdf_tool').mouseover(function(){ $('.pdf_option').show();})
	$('.pdf_tool').mouseout(function(){ $('.pdf_option').hide();})
  	
  	$('#aFullBio').click(function(){
  	    window.location = "/Non-Sitecore/bioPDF.asp?id=" + $('#employeeGuid').val() + "&type=full&file=" + $('#pdfFileName').val();
  	});
  	$('#aExecutiveBio').click(function(){
		 window.location = "/Non-Sitecore/bioPDF.asp?id=" + $('#employeeGuid').val() + "&type=exec&file=" + $('#pdfFileName').val();
  	});
	
  	$('.pubPDF').click(function(){
  	    window.location = "/Non-Sitecore/NewsletterPDF.asp?id=" + $('#issueGuid').val()+ "&file=" + $('#pdfFileName').val();
  	});
	
	
	
	
	// ---------------------------------------------------------------------------------------
	// BEGIN: Font Resizing
	// Reset Font Size
	$('.font_sizing').show();
	
	var fontSizeLevels;//how many levels fonts can increase/decrease
	var fontSizeVariation;//how many PX/EM points to increase/decrease	
	
	//Defaults setings
	fontSizeLevels = 2;//how many levels fonts can increase/decrease
	fontSizeVariation = 1;//how many PX/EM points to increase/decrease

	//Which items to effect
	//Make all elements sizeable in array 'originalFontItems'//

	effectedItems = $("td, p, a, h1, h2, h3, h4, h5, h6, span, th, label, input, option, textarea, li, .callout_box_text, .callout_box_form, .callout_box_title", ".main_content_padding");
	
	// Increase Font Size
	var defaultIncreaseFontNum = 0;
	var increaseFontNum = fontSizeLevels;
	$(".increaseFont").click(function(){
		if (defaultIncreaseFontNum < increaseFontNum){
			$.each(effectedItems, function(i){
				var currentFontSize = $(this).css('font-size');
				currentFontSizeNum = parseFloat(currentFontSize, 10);
				var newFontSize = currentFontSizeNum+fontSizeVariation;
				$(this).css('font-size', newFontSize);
			});
			defaultIncreaseFontNum = defaultIncreaseFontNum+fontSizeVariation;
			defaultDecreaseFontNum = defaultDecreaseFontNum-fontSizeVariation;
		}
		return false;
	});
	
	// Decrease Font Size
	var defaultDecreaseFontNum = 0;
	var decreaseFontNum = fontSizeLevels;
	$(".decreaseFont").click(function(){
		if (defaultDecreaseFontNum < (decreaseFontNum)){
			$.each(effectedItems, function(i){
				var currentFontSize = $(this).css('font-size');
				currentFontSizeNum = parseFloat(currentFontSize, 10);
				var newFontSize = currentFontSizeNum-fontSizeVariation;
				$(this).css('font-size', newFontSize);
			});
			defaultIncreaseFontNum = defaultIncreaseFontNum-fontSizeVariation;
			defaultDecreaseFontNum = defaultDecreaseFontNum+fontSizeVariation;
		}
		return false;
	});
	// END: Font Resizing
	
});

    
    
