isIE=/Microsoft Internet Explorer/.test(navigator.appName);IE=isIE;
IE6=/MSIE\s6/.test(navigator.appVersion);
IE7=/MSIE\s7/.test(navigator.appVersion);
var Browser = {
	IE:           !!( window.attachEvent && !window.opera ),
	IE6:          /MSIE\s6/.test( navigator.appVersion ),
	IE7:          /MSIE\s7/.test( navigator.appVersion ),
	Gecko:        navigator.userAgent.indexOf( 'Gecko' ) > -1 && navigator.userAgent.indexOf( 'KHTML' ) == -1,
	Opera:        !!window.opera,
	WebKit:       navigator.userAgent.indexOf( 'AppleWebKit/' ) > -1,
	MobileSafari: !!navigator.userAgent.match( /Apple.*Mobile.*Safari/ )
};
function cout(str){if(!IE){console.debug(str);}else alert(str);}
Array.prototype.unique = function() { temp = new Array(); this.sort(); for( var i = 0; i < this.length; i++ ) { if( temp[temp.length - 1] != this[i] ) { temp.push( this[i] ); } } return temp; }
Array.prototype.hasElement = function( indx ) { for( var i = 0; i < this.length; i++ ) { if( this[i] == indx ) { return true; } } return false; }
Array.prototype.remove = function( indx ) { this.sort(); for( var i = 0; i < this.length; i++ ) { if( this[i] == indx ) { this[i] = ""; this.sort(); this.shift(); } } }
function updateCountLimit(){selected=0,maxCount=selectedItems="";limit=/countLimit(\d+)/.exec(this.className)[1];items="";for(i=0;i<this.options.length;i++){if(this.options[i].selected){selected++;items+=((selected<10)?"&nbsp;&nbsp;":"")+selected+". "+this.options[i].innerHTML+"<br />";}}
divs=this.parentNode.getElementsByTagName("DIV");for(j=0;j<divs.length;j++){if(divs[j].className.indexOf("maxLength")>-1){maxCount=divs[j];}
if(divs[j].className.indexOf("selectedItems")>-1){selectedItems=divs[j];}}
if( IE6 ) { selectedItems.style.marginLeft = "1px"; }
setFieldNotice(this,"reset");if(maxCount!=""){setFieldNotice(maxCount,"reset");maxCount.innerHTML="Selected "+selected+" out of "+limit+" total.";}
if(selectedItems!=""){setFieldNotice(selectedItems,"reset");selectedItems.innerHTML=items;selectedItems.style.display="block";offset=this.offsetWidth+this.offsetLeft+10;if(IE7){offset-=20;}
selectedItems.style.left=offset+"px";}
if(selected>limit){setFieldNotice(this);if(maxCount){setFieldNotice(maxCount);}
if(selectedItems){setFieldNotice(selectedItems);}}}
function updateTARS(){try{max=this.className.replace(/^.*m([0-9]{1,5}).*$/,"$1");max=(isNumeric(max))?max:500;p=this.parentNode;s=p.getElementsByTagName("DIV");if(s.length>0&&s[0].className.indexOf("maxLength")>-1){s[0].innerHTML="Max "+max+" characters; "+(max-this.value.length)+" remaining.";this.style.background=(max<this.value.length)?"#FFCFDA":"#FFFFFF";}}
catch(e){err="";if(!e)var e=window.event;err+="Error: "+e.type+"\n";for(var p in e){err+=p+"\n";}
alert(err);}}
function setFieldNotice(node){node.style.background=(setFieldNotice.arguments[1]!="reset")?"#FFCFDA":(node.nodeName=="FIELDSET"||node.nodeName=="DIV")?"transparent":"#FFFFFF";node.style.borderColor=(setFieldNotice.arguments[1]!="reset")?"#9F0006":"#000000";}

function isNumeric(question){regEx=/^-?\d*(\.\d+)?$/;return(regEx.test(question))?true:false;}
function trimString(str){sInString=str.replace(/^\s+/g,"");return sInString.replace(/\s+$/g,"");}
function unique(all){all.sort();temp=Array();for(f=0;f<all.length;f++){w=f;while(all[f]==all[w]){w++;}
f+=(w-f)-1;temp.push(all[f]);}
return temp;}
function validateForm(formObj){try{valid=/\bvalidate-(n|e|d\d|t\d|o|f|p\d|g\d|m\d{1,5}?|s\d{1,3}?)+?\b/;notNull=/\bvalidate-[^n,\s]*n[^n,\s]*\b/;email=/\bvalidate-[^e,\s]*e[^e,\s]*\b/;date=/\bvalidate-[^d,\s]*d\d[^d,\s]*\b/;time=/\bvalidate-[^t,\s]*t\d[^t,\s]*\b/;human=/\bvalidate-[^o,\s]*o[^o,\s]*\b/;field=/\bvalidate-[^f,\s]*f[^f,\s]*\b/;pair=/\bvalidate-[^p,\s]*(p[0-9])+?[^p,\s]*\b/;group=/\bvalidate-[^g,\s]*(g[0-9])+?[^g,\s]*\b/;maxLength=/\bvalidate-[^m,\s]*m[0-9]{1,5}?[^m,\s]*\b/;select=/\bvalidate-[^s,\s]*s\d{1,3}[^s,\s]*\b/;trim=/\s+$/;errorMsg="";borderColor=formObj[0].style.borderColor;arrEmail=new Array();tempError=false;function getMaxLength(name){validArgs=/m\d{1,5}$/.exec(valid.exec(name)[0])[0].replace("m","");return(isNumeric(validArgs))?validArgs:500;}
function getGroups(formObj){all=Array();for(i=0;i<formObj.length;i++){if(valid.test(formObj[i].id)&&(formObj[i].type=="checkbox"||formObj[i].type=="radio")&&formObj[i].checked){all.push(formObj[i].id);}}
return unique(all);}
function fieldsetHasValue(obj){r=obj.getElementsByTagName("INPUT");valued=false;if(r[0].type=="radio"||r[0].type=="checkbox"){for(fieldsetCounter=0;fieldsetCounter<r.length;fieldsetCounter++){if(r[fieldsetCounter].checked==true){valued=true;}}}
return valued;}
function getPairs(formObj){p=Array();for(b=0;b<formObj.length;b++){if(valid.test(formObj[b].className)&&pair.test(formObj[b].className)){p.push(formObj[b]);}}
if(p.length%2!=0){alert("javascript error - invalid pair count");}
return p;}
function groupName(obj){v=group.exec(obj.className);return v[0];}
function validEmail(question){var regEx=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;return(regEx.test(question))?true:false;}
function validPhone(question){regEx=/^(\d{1,4}?-){3,5}?$/;return regEx.test(question);}
groups=getGroups(formObj);pairs=getPairs(formObj);for(i=0;i<formObj.length;i++){node=formObj[i];if(formObj.className.indexOf("testing")>-1){}
if(v=valid.exec(node.className)){validArgs=v[0];setFieldNotice(node,"reset");tempError=false;textArea=maxLength.test(node.className)&&trimString(node.value)!="";emailField=email.test(node.className)&&trimString(node.value)!="";dateField=date.test(node.className)&&trimString(node.value)!="";timeField=time.test(node.className);humanField=human.test(node.className);fieldset=field.test(node.className);groupField=group.test(node.className);pairsField=pair.test(node.className);selectField=select.test(node.className);nNullField=notNull.test(node.className)&&trimString(node.value)=="";if(textArea){characters=getMaxLength(node.className);if(node.value.length>characters){errorMsg+="This Area must be "+characters+" characters or fewer; you have: "+node.value.length+"\n";tempError=true;}}
if(fieldset&&!fieldsetHasValue(node)){errorMsg+="A value has not been selected.\n";tempError=true;}
if(groupField){for(x=0;x<groups.length;x++){testControl=document.getElementById(groupName(node)).checked;if(node.nodeName!="FIELDSET"){if(testControl&&trimString(node.value)==""){errorMsg+="One (or more) required fields are not filled.\n";tempError=true;}}
else{if(testControl&&!fieldsetHasValue(node)){errorMsg+="A value has not been selected.\n";tempError=true;}}}}
if(emailField){arrEmail.push(node);if(!validEmail(node.value)){errorMsg+="One (or more) of the email addresses you entered are not correctly formatted.\n";tempError=true;}}
if(dateField){flavor=/d\d/.exec(node.className)[0];separators="([\\.\/-])";simpleDay="((?:[0-2]?\\d)|(?:3[0-1]))";monthNumbers="((?:0?\\d)|(?:1[0-2]))";shortMonthNames="((?:Jan)|(?:Feb)|(?:Mar)|(?:Apr)|(?:May)|(?:Jun)|(?:Jul)|(?:Aug)|(?:Sep)|(?:Oct)|(?:Nov)|(?:Dec))";longMonthNames="((?:January)|(?:February)|(?:March)|(?:April)|(?:May)|(?:June)|(?:July)|(?:August)|(?:September)|(?:October)|(?:November)|(?:December))";longYear="([12]\\d{3})";var properDate=new RegExp("");switch(flavor){case"d2":properDate.compile("^"+longYear+separators+monthNumbers+"(\\2)"+simpleDay+"$");break;case"d3":properDate.compile("^"+shortMonthNames+" "+simpleDay+", "+longYear+"$");break;case"d4":properDate.compile("^"+longMonthNames+" "+simpleDay+", "+longYear+"$");break;case"d5":properDate.compile("^"+simpleDay+" "+shortMonthNames+" "+longYear+"$");break;case"d6":properDate.compile("^"+simpleDay+" "+longMonthNames+" "+longYear+"$");break;case"d7":properDate.compile("^"+longYear+"$");break;case"d8":properDate.compile("^"+shortMonthNames+" "+simpleDay+"$");break;case"d9":properDate.compile("^"+longMonthNames+" "+simpleDay+"$");break;case"d0":properDate.compile("^"+longYear+"-"+"\\d\\d+?"+"$");break;default:properDate.compile("^"+monthNumbers+separators+simpleDay+"(\\2)"+longYear+"$");break;}
if(!properDate.test(node.value)){errorMsg+="One (or more) of the dates you entered are not correctly formatted.\n";tempError=true;}}
if(timeField){flavor=/t\d/.exec(node.className)[0];switch(flavor){case"t2":properTime=/^(((?:[0-1]?\d)|(?:2[0-4])):([0-5]\d))$/;break;case"t3":break;case"t4":break;case"t5":break;case"t6":break;case"t7":break;case"t8":break;case"t9":break;case"t0":break;default:properTime=/^(((?:0?\d)|(?:1[012])):([0-5]?\d))\s?([ap]m)$/i;break;}
if(!properTime.test(node.value)){errorMsg+="One (or more) of the times you entered are not correctly formatted.\n";tempError=true;}
else{hrs=/(\d\d?)/.exec(node.value);if(hrs[1]<10&&hrs[1][0]!=0){node.value="0"+node.value;}}}
if(humanField){if(node.value!=""){errorMsg+="If you are attempting to Spam our site, please don't.\n";tempError=true;}}
if(selectField){maxNum=/validate-[^s\s]*s(\d{1,3})/.exec(node.className)[1];selected="";for(j=0;j<node.options.length;j++){if(node.options[j].selected){selected++;}}
if(selected>maxNum){errorMsg+="Only "+maxNum+" items may be selected in this list, please deselect "+parseInt(selected-maxNum)+".\n";tempError=true;}}
if(pairsField){regEx=/p[0-9]/;for(q=0;q<pairs.length;q++){nodeCompare=regEx.exec(node.className);pairCompare=regEx.exec(pairs[q].className);if(nodeCompare[0]==pairCompare[0]&&node.value!=pairs[q].value&&node!=pairs[q]){errorMsg+="Please make sure these fields match identically.\n"
tempError=true;setFieldNotice(pairs[q]);}}}
if(nNullField){errorMsg+="The "+node.name+" field should not be empty.\n"
tempError=true;}
if(tempError){setFieldNotice(node);}}}
if(arrEmail.length>1&&arrEmail[0].value!=arrEmail[1].value){setFieldNotice(arrEmail[0]);setFieldNotice(arrEmail[1]);errorEmail+=(errorEmail!="")?"\n":"";errorEmail+="The email addresses you entered do not match.";}
if(errorMsg!=""){errorMsg=errorMsg.replace(/One \(or more\) required fields are not filled\.\n/gi,"")+"One (or more) required fields are not filled.\n";if(/One \(or more\) required fields are not filled\.\n/gi.test(errorMsg)){errorMsg+="The missing fields are denoted by a red color in the area of the problem.";}
alert(errorMsg);return false;}
return true;}
catch(e){if(!e)var e=window.event;er="";for(var p in e){er+=p+" = "+e.eval(p)+"\n";}
alert("JavaScript Error!\n"+er);return false;}}


var detect=navigator.userAgent.toLowerCase();var OS,browser,version,total,thestring;function getBrowserInfo(){if(checkIt('konqueror')){browser="Konqueror";OS="Linux";}
else if(checkIt('safari'))browser="Safari"
else if(checkIt('omniweb'))browser="OmniWeb"
else if(checkIt('opera'))browser="Opera"
else if(checkIt('webtv'))browser="WebTV";else if(checkIt('icab'))browser="iCab"
else if(checkIt('msie'))browser="Internet Explorer"
else if(!checkIt('compatible')){browser="Netscape Navigator"
version=detect.charAt(8);}
else browser="An unknown browser";if(!version)version=detect.charAt(place+thestring.length);if(!OS){if(checkIt('linux'))OS="Linux";else if(checkIt('x11'))OS="Unix";else if(checkIt('mac'))OS="Mac"
else if(checkIt('win'))OS="Windows"
else OS="an unknown operating system";}}
function checkIt(string){place=detect.indexOf(string)+1;thestring=string;return place;}
Event.observe(window, 'load', initialize);
Event.observe(window, 'load', getBrowserInfo, false); 
var lightbox=Class.create();lightbox.prototype={yPos:0,xPos:0,initialize:function(ctrl){this.content=ctrl.href;Event.observe(ctrl,'click',this.activate.bindAsEventListener(this),false);ctrl.onclick=function(){return false;};},activate:function(){if(browser=='Internet Explorer'){this.getScroll();this.prepareIE('100%','hidden');this.setScroll(0,0);this.hideSelects('hidden');}
this.displayLightbox("block");},prepareIE:function(height,overflow){bod=document.getElementsByTagName('body')[0];bod.style.height=height;bod.style.overflow=overflow;htm=document.getElementsByTagName('html')[0];htm.style.height=height;htm.style.overflow=overflow;},hideSelects:function(visibility){selects=document.getElementsByTagName('select');for(i=0;i<selects.length;i++){selects[i].style.visibility=visibility;}},getScroll:function(){if(self.pageYOffset){this.yPos=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){this.yPos=document.documentElement.scrollTop;}else if(document.body){this.yPos=document.body.scrollTop;}},setScroll:function(x,y){window.scrollTo(x,y);},displayLightbox:function(display){$('overlay').style.display=display;$('lightbox').style.display=display;if(display!='none')this.loadInfo();},loadInfo:function(){var myAjax=new Ajax.Request(this.content,{method:'post',parameters:"",onComplete:this.processInfo.bindAsEventListener(this)});},processInfo:function(response){info="<div id='lbContent'><div id='lbFrame'>"+
response.responseText+'<a id="closeWindow" href="javascript:lightbox.prototype.deactivate();">Close Window</a>'+"</div></div>";new Insertion.Before($('lbLoadMessage'),info);$('lightbox').className="done";$('lightbox').style.marginTop="100px";$('lightbox').style.width=$('lightbox').offsetWidth+"px";$('lightbox').style.marginLeft="-"+parseInt($('lightbox').offsetWidth/2)+"px";this.actions();},actions:function(){lbActions=document.getElementsByClassName('lbAction');for(i=0;i<lbActions.length;i++){Event.observe(lbActions[i],'click',this[lbActions[i].rel].bindAsEventListener(this),false);lbActions[i].onclick=function(){return false;};}},insert:function(e){link=Event.element(e).parentNode;Element.remove($('lbContent'));var myAjax=new Ajax.Request(link.href,{method:'post',parameters:"",onComplete:this.processInfo.bindAsEventListener(this)});},deactivate:function(){Element.remove($('lbContent'));if(browser=="Internet Explorer"){this.setScroll(0,this.yPos);this.prepareIE("auto","auto");this.hideSelects("visible");}
this.displayLightbox("none");}}
function initialize(){addLightboxMarkup();lbox=$$('.lbOn');for(i=0;i<lbox.length;i++){n=lbox[i];n.href=n.href.replace("login.asp","loginForm.asp");n.href=n.href.replace("currencyConverter.asp","currencyForm.asp");valid=new lightbox(n);n.onfocus=function(){this.blur();}
if(n.className.indexOf("activate")>-1){valid.activate();}}}
function addLightboxMarkup(){bod=document.getElementsByTagName('body')[0];overlay=document.createElement('div');overlay.id='overlay';overlay.onclick=function(){lightbox.prototype.deactivate();}
lb=document.createElement('div');lb.id='lightbox';lb.className='loading';lb.innerHTML='<div id="lbLoadMessage"><p>Loading</p></div>';bod.appendChild(overlay);bod.appendChild(lb);}

emailRegex=/(~([^~]+)~@~([^~]+)~)/gi;
nakedEmails = /(([^@\s<>]+)@([^@\s<>]+))/gi;
emailLink="<a href=\"mailto:$2@$3\">$2@$3</a>";function emails(){document.body.innerHTML=document.body.innerHTML.replace(emailRegex,emailLink);}
function _(tag){return document.getElementsByTagName(tag);}
function isNumeric(question){return/^-?\d*(\.\d+)?$/.test(question);}
function hello(){alert(hello.arguments[0]||"hello");}
function invalidEmail(){alert("There seems to be a problem with the email address you have registered with globalEDGE. Please go to your profile and update your email address information. Thank you.");}
function killAllTheAnts(arrOfLinks){for(i=0;i<arrOfLinks.length;i++){arrOfLinks[i].onfocus=function(){if(this.blur){this.blur();}}}}
function fixPDFLinks(){arrOfLinks=document.getElementsByTagName("A");for(i=0;i<arrOfLinks.length;i++){if(-1<arrOfLinks[i].href.indexOf(".pdf")){arrOfLinks[i].target="_blank";}}}
function textboxChange(){for(i=0;i<textboxChange.arguments.length;i++){if(node=document.getElementById(textboxChange.arguments[i].toString())){node.onfocus=function(){if(this.value==this.id){this.value='';}}
node.onblur=function(){if(this.value==''){this.value=this.id;}}}}}
function iCrushYourHead(){p=this.parentNode;this.innerHTML=(this.innerHTML=="Read more... ")?"Collapse topic ":"Read more... ";wrapper=/^(.*)?(\s?hider\s?)(.*)?$/;hidem=/^(.*)(\s?hideable\s?)(.*)$/;while(!wrapper.test(p.className)&&p.nodeName!="BODY"){p=p.parentNode;}
for(i=0;i<p.childNodes.length;i++){if(hidem.test(p.childNodes[i].className)){p.childNodes[i].style.display=(p.childNodes[i].style.display=="none")?"inline":"none";}}}
function clickableLabels(){if(Browser.IE){labels=document.getElementsByTagName("LABEL");for(i=0;i<labels.length;i++){
if(labels[i].className=="clickable"){labels[i].onclick=function(){if(this.childNodes[0].type=="radio"){this.childNodes[0].checked=true;}else{this.childNodes[0].click();}}}}}}
function fixCode(){tags=document.getElementsByTagName("INS");for(i=0;i<tags.length;i++){content=tags[i].innerHTML.toString();while(content.indexOf("&gt;")>-1){content=content.replace("&gt;",">");}
while(content.indexOf("&lt;")>-1){content=content.replace("&lt;","<");}
tags[i].innerHTML=content;}}
function initForm(){lbls=document.getElementsByTagName("LABEL");for(i=0;i<lbls.length;i++){lbls[i].innerHTML=lbls[i].innerHTML.replace(/:\s*$/,":<span style=\"visibility:hidden;\">_<\/span>");}
tars=document.getElementsByTagName("TEXTAREA");for(i=0;i<tars.length;i++){tars[i].onkeyup=updateTARS;tars[i].onkeyup();}
selc=document.getElementsByTagName("SELECT");for(s=0;s<selc.length;s++){if(selc[s].className.indexOf("countLimit")>-1){selc[s].onchange=updateCountLimit;selc[s].onchange();}}}
window.onload=function(){if(document.getElementById("nav")){killAllTheAnts(document.getElementById("nav").getElementsByTagName("A"));}textboxChange("search","description");clickableLabels();fixCode();if(document.forms.length>0){initForm();}
for(h=1;h<7;h++){temp=document.getElementsByTagName("H"+h);for(a=0;a<temp.length;a++){temp[a].innerHTML=temp[a].innerHTML.replace(/[abdeglo]{10}/ig,"globalEDGE");}}
allLinks=document.getElementsByTagName("A");for(l=0;l<allLinks.length;l++){node=allLinks[l];if(!/globaledge/.test(node.href)||/linktrace/i.test(node.href)){node.target="_blank";}
if(/alt\+/.test(node.title)){node.title=node.title.replace(/\s-\salt\+\w/,"");}
if(node.href=="js:pincer;"){node.href="javascript:;";if(node.parentNode.nodeName=="P"){}
node.innerHTML="[ collapse this topic ]";node.target="";node.onfocus=function(){if(this.blur){this.blur();}}
node.onclick=iCrushYourHead;node.onclick();}
hiddenEmail="js:email|";if(node.href.indexOf(hiddenEmail)>-1){temp=node.href.replace("js:email|","");args=temp.split(",");address=args[0]+"@"+args[1];node.href="mailto:"+address;node.innerHTML=(args.length>2)?args[2].replace(/%20/g," "):address;}}}
function testURL(e){
	var site = document.getElementById(e).value;
	if(site){
		window.open(document.getElementById(e).value);
	}
	else{
		alert('URL cannot be blank');	
	}
	return false;
}

function blogReadMore(){
	var el = $$('.readMore');
		var l = el.length;
		for(var i=0; i < l; i++){
			el[i].observe('click', readMore);
			el[i].hide();
		}
		
		function readMore(e){
			var id = this.id.split('_');
			$('more_' + id[1]).toggle();
			if($('more_' + id[1]).visible()){
				this.innerHTML = 'Collapse Topic';					 
			}
			else{
				this.innerHTML = 'Read More...';	
			}
			Event.stop(e);
		}	
}