/*
function setCookie(name,value,days){
	if (days){
		var date=new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires=";expires="+date.toGMTString();
	}
	else{
		var expires="";
	}
	document.cookie=name+"="+value+expires+";path=/";
}

function getCookie(name){
	var nameEQ=name +"=";
	var ca=document.cookie.split(';');
	for(var i=0;i<ca.length;i++){
		var c=ca[i];
		while(c.charAt(0)==' '){
			c=c.substring(1,c.length);
		}
		if(c.indexOf(nameEQ) == 0){
			return c.substring(nameEQ.length,c.length);
		}
	}
	return null;
}

function deleteCookie(name) {
	createCookie(name,"",-1);
}

*/





function getCookieVal(offset){
	var endstr=document.cookie.indexOf(";",offset);
	if(endstr==-1){
		endstr=document.cookie.length;
	}
	return unescape(document.cookie.substring(offset,endstr));
}
function getCookie(name){
	var arg=name+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while(i<clen){
		var j=i+alen;
		if(document.cookie.substring(i,j)==arg){
			return getCookieVal(j);
		}
		i=document.cookie.indexOf(" ",i)+1;
		if(i===0){
			break;
		}
	}
	return null;
}
function setCookie(name,value,expires,path,domain,secure){
	document.cookie=name+"="+escape(value) +((expires)?";expires="+expires.toGMTString():"") +((path)?";path="+path:"") +((domain)?";domain="+domain:"") +((secure)?";secure":"");
}
function deleteCookie(name,path,domain){
	if(getCookie(name)){
		document.cookie=name+"=" +
			((path)?";path="+path:"") +
			((domain)?";domain="+domain:"") +
			";expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}







function createCookie(name,value,days) {
	var expires;
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		expires = "; expires="+date.toGMTString();
	}
	else expires = "";
	window.top.document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = window.top.document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}






















/*
function getCookie(c_name){
	if (document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return "";
}
function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
function checkCookie(){
	username=getCookie('username');
	if (username!=null && username!=""){
		alert('Welcome again '+username+'!');
	}
	else{
		username=prompt('Please enter your name:',"");
		if (username!=null && username!=""){
			setCookie('username',username,365);
		}
	}
}
Z*/
function newImage(arg){
		if(document.images){
				rslt=new Image();
				rslt.src=arg;
				return rslt;
		}
}
function changeImages(){
		if(document.images&&(preloadFlag===true)){
				for (var i=0; i<changeImages.arguments.length; i+=2){
						document[changeImages.arguments[i]].src=changeImages.arguments[i+1];
				}
		}
}
/*sniffers*/
var agt=new String(navigator.userAgent.toLowerCase());
// Return browser's (actual) major version or -1 if bad version entered
function getMajorVersion(x){
	return(isEmpty(x)?-1:(hasDot(x)?x:x.match(/(\d*)(\.\d*)*/)[1]));
}
// Return browser's (actual) minor version or -1 if bad version entered
function getMinorVersion(x){
		return(!isEmpty(x)?(!hasDot(x)?x.match(/\.(\d*([-\.]\d*)*)/)[1]:0):-1);
}
// Return Gecko version
function getGeckoVersion() {
	return agt.match(/gecko\/([0-9]+)/)[1];
}
// Return MSIE version
function getMSIEVersion() {
	return agt.match(/msie\s(\d+(\.?\d)*)/)[1];
}
// Return full browser UA string
function getFullUAString(o) {
	(isEmpty(o)?agt=navigator.userAgent.toLowerCase():agt=ob);
	return agt;
}
function hasDot(x){
		return(x.search(/\./) == -1);
}
function isEmpty(x){
	return(x===null||x==="");
}
function getBrowser(){
	var b=new Array("unknown","unknown","unknown","unknown");
	if(agt.search(/omniweb[\/\s]v?(\d+([\.-]\d)*)/)!=-1){
		// Omniweb
		b[0]="omniweb";
		b[1]=agt.match(/omniweb[\/\s]v?(\d+([\.-]\d)*)/)[1];
		(b[1] > 4.5?b[2]="khtml":b[2]="omniweb");
		(agt.search(/omniweb[\/\s]((\d+([\.-]\d)*)-)?v(\d+([\.-]\d)*)/)==-1?b[3]=agt.match(/omniweb[\/\s](\d+([\.-]\d)*)/)[1]:b[3]=agt.match(/omniweb[\/\s]((\d+([\.-]\d)*)-)?v(\d+([\.-]\d)*)/)[4]);
		return b;
	}
	else if(agt.search(/opera[\/\s](\d+(\.?\d)*)/)!=-1){
	// Opera
		b[0]="opera";
		b[1]=agt.match(/opera[\/\s](\d+(\.?\d)*)/)[1];
		b[2]="opera";
		b[3]=b[1];
		return b;
	}
	else if(agt.search(/crazy\s?browser\s(\d+(\.?\d)*)/)!=-1){
	// Crazy Browser
		b[0]="crazy";
		b[1]=agt.match(/crazy\s?browser\s(\d+(\.?\d)*)/)[1];
		b[2]="msie";
		b[3]=getMSIEVersion();
		return b;
	}
	else if(agt.search(/myie2/)!=-1){
	// MyIE2
		b[0]="myie2";
		b[2]="msie";
		b[3]=agt.match(/msie\s(\d+(\.?\d)*)/)[1];
		return b;
	}
	else if(agt.search(/netcaptor/)!=-1){
	// NetCaptor
		b[0]="netcaptor";
		b[1]=agt.match(/netcaptor\s(\d+(\.?\d)*)/)[1];
		b[2]="msie";
		b[3]=getMSIEVersion();
		return b;
	}
	else if(agt.search(/avant\sbrowser/)!=-1){
	// Avant Browser
		b[0]="avantbrowser";
		b[2]="msie";
		b[3]=getMSIEVersion();
		return b;
	}
	else if(agt.search(/msn\s(\d+(\.?\d)*)/)!=-1){
	// MSN Explorer
		b[0]="msn";
		b[1]=agt.match(/msn\s(\d+(\.?\d)*)/)[1];
		b[2]="msie";
		b[3]=getMSIEVersion();
		return b;
	}
	else if(agt.search(/msie\s(\d+(\.?\d)*)/)!=-1){
	// MS Internet Explorer
		b[0]="msie";
		b[1]=getMSIEVersion();
		b[2]="msie";
		b[3]=b[1];
		return b;
	}
	else if(agt.search(/powermarks\/(\d+(\.?\d)*)/)!=-1){
	// PowerMarks
		b[0]="powermarks";
		b[1]=agt.match(/powermarks\/(\d+(\.?\d)*)/)[1];
		b[2]="msie";
		try {
			b[3]=getMSIEVersion();
		}catch(e){ }
		return b;
}
	else if(agt.search(/konqueror[\/\s](\d+([\.-]\d)*)/)!=-1){
	// Konqueror
		b[0]="konqueror";
		b[1]=agt.match(/konqueror[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="khtml";
		return b;
	}
	else if(agt.search(/chrome\/(\d)*/)!=-1){
	// Chrome
		b[0]="chrome";
		b[1]=agt.match(/chrome\/(\d+(\.?\d*)*)/)[1];
		b[2]="khtml";
		b[3]=agt.match(/applewebkit\/(\d+(\.?\d*)*)/)[1];
		return b;
	}
	else if(agt.search(/safari\/(\d)*/)!=-1){
	// Safari
		b[0]="safari";
		b[1]=agt.match(/version\/(\d+(\.?\d*)*)/)[1];
		b[2]="khtml";
		b[3]=agt.match(/applewebkit\/(\d+(\.?\d*)*)/)[1];
		return b;
	}
	else if(agt.search(/zyborg/)!=-1){
	// Zyborg (SSD)
		b[0]="zyborg";
		b[1]=agt.match(/zyborg\/(\d+(\.?\d)*)/)[1];
		b[2]="robot";
		b[3]="-1";
		return b;
	}
	else if(agt.search(/netscape6[\/\s](\d+([\.-]\d)*)/)!=-1){
	// Netscape 6.x
		b[0]="netscape";
		b[1]=agt.match(/netscape6[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/netscape\/(7\.\d*)/)!=-1){
	// Netscape 7.x
		b[0]="netscape";
		b[1]=agt.match(/netscape\/(7\.\d*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/galeon[\/\s](\d+([\.-]\d)*)/)!=-1){
	// Galeon
		b[0]="galeon";
		b[1]=agt.match(/galeon[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/nautilus[\/\s](\d+([\.-]\d)*)/)!=-1){
	// Nautilus
		b[0]="nautilus";
		b[1]=agt.match(/nautilus[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/firefox[\/\s](\d+([\.-]\d)*)/)!=-1){
	// Firefox
		b[0]="firefox";
		b[1]=agt.match(/firefox[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/k-meleon[\/\s](\d+([\.-]\d)*)/)!=-1){
	// K-Meleon
		b[0]="kmeleon";
		b[1]=agt.match(/k-meleon[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/playstation\s3/)!=-1){
	// Playstation 3
		b[0]="netfront";
		b[1]="2.81"; // Taken from the Wikipedia article
		b[2]="playstation3";
		b[3]=agt.match(/playstation\s3;\s(\d+\.\d+)/)[1];
		return b;
	}
	else if(agt.search(/firebird[\/\s](\d+([\.-]\d)*)/)!=-1){
	// Firebird
		b[0]="firebird";
		b[1]=agt.match(/firebird[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/phoenix[\/\s](\d+([\.-]\d)*)/)!=-1){
	// Phoenix
		b[0]="phoenix";
		b[1]=agt.match(/phoenix[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/camino[\/\s](\d+([\.-]\d)*)/)!=-1){
	// Camino
		b[0]="camino";
		b[1]=agt.match(/camino[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/epiphany[\/\s](\d+([\.-]\d)*)/)!=-1){
	// Epiphany
		b[0]="epiphany";
		b[1]=agt.match(/epiphany[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/chimera[\/\s](\d+([\.-]\d)*)/)!=-1){
	// Chimera
		b[0]="chimera";
		b[1]=agt.match(/chimera[\/\s](\d+([\.-]\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/icab[\s\/]?(\d+(\.?\d)*)/) !=-1){
	// iCab
		b[0]="icab";
		b[1]=agt.match(/icab[\s\/]?(\d+(\.?\d)*)/)[1];
		b[2]="icab";
		b[3]=b[1];
		return b;
	}
	else if(agt.search(/netfront\/(\d+([\._]\d)*)/)!=-1){
	// NetFront
		b[0]="netfront";
		b[1]=agt.match(/netfront\/(\d+([\._]\d)*)/)[1];
		b[2]="netfront";
		b[3]=b[1];
		return b;
	}
	else if(agt.search(/netscape4\/(\d+([\.-]\d)*)/)!=-1){
	// Netscape 4.x
		b[0]="netscape";
		b[1]=agt.match(/netscape4\/(\d+([\.-]\d)*)/)[1];
		b[2]="mozold";
		b[3]=b[1];
		return b;
	}
	else if( (agt.search(/mozilla\/(4.\d*)/)!=-1) && (agt.search(/msie\s(\d+(\.?\d)*)/)==-1) ){
		b[0]="netscape";
		b[1]=agt.match(/mozilla\/(4.\d*)/)[1];
		b[2]="mozold";
		b[3]=b[1];
		return b;
	}
	else if((agt.search(/mozilla\/5.0/)!=-1) && (agt.search(/gecko\//)!=-1)){
	// Mozilla Seamonkey
		b[0]="mozsea";
		b[1]=agt.match(/rv\x3a(\d+(\.?\d)*)/)[1];
		b[2]="gecko";
		b[3]=getGeckoVersion();
		return b;
	}
	else if(agt.search(/elinks/)!=-1){
	// ELinks
		b[0]="elinks";
		(agt.search(/elinks\/(\d+(\.?\d)*)/)==-1?b[1]=agt.match(/elinks\s\x28(\d+(\.?\d)*)/)[1]:b[1]=agt.match(/elinks\/(\d+(\.?\d)*)/)[1]);
		b[2]="elinks";
		b[3]=b[1];
		return b;
	}
	else if(agt.search(/w3m\/(\d+(\.?\d)*)/)!=-1){
	// w3m;
		b[0]="w3m";
		b[1]=agt.match(/(^w3m|\sw3m)\/(\d+(\.?\d)*)/)[2];
		b[2]="w3m";
		b[3]=b[1];
		return b;
	}
	else if(agt.search(/links/)!=-1){
	// Links
		b[0]="links";
		(agt.search(/links\/(\d+(\.?\d)*)/)==-1?b[1]=agt.match(/links\s\x28(\d+(\.?\d)*)/)[1]:b[1]=agt.match(/links\/(\d+(\.?\d)*)/)[1]);
		b[2]="links";
		b[3]=b[1];
		return b;
	}
	else if(agt.search(/java[\/\s]?(\d+([\._]\d)*)/)!=-1){
	// Java (as web-browser)
		b[0]="java";
		b[1]=agt.match(/java[\/\s]?(\d+([\._]\d)*)/)[1];
		b[2]="java";
		b[3]=b[1];
		return b;
	}
	else if(agt.search(/lynx/)!=-1){
	// Lynx (SSD)
		b[0]="lynx";
		b[1]=agt.match(/lynx\/(\d+(\.?\d)*)/)[1];
		b[2]="libwww-fm";
		b[3]=agt.match(/libwww-fm\/(\d+(\.?\d)*)/)[1];
		return b;
	}
	else if(agt.search(/dillo/)!=-1){
	// Dillo (SSD)
		b[0]="dillo";
		b[1]=agt.match(/dillo\s*\/(\d+(\.?\d)*)/)[1];
		b[2]="dillo";
		b[3]=b[1];
		return b;
	}
	else if(agt.search(/wget/)!=-1){
	// wget (SSD)
		b[0]="wget";
		b[1]=agt.match(/wget\/(\d+(\.?\d)*)/)[1];
		b[2]="robot";
		b[3]="-1";
		return b;
	}
	else if(agt.search(/googlebot\-image/)!=-1){
	// GoogleBot-Image (SSD)
		b[0]="googlebotimg";
		b[1]=agt.match(/googlebot\-image\/(\d+(\.?\d)*)/)[1];
		b[2]="robot";
		b[3]="-1";
		return b;
	}
	else if(agt.search(/googlebot/)!=-1){
	// GoogleBot (SSD)
		b[0]="googlebot";
		b[1]=agt.match(/googlebot\/(\d+(\.?\d)*)/)[1];
		b[2]="robot";
		b[3]="-1";
		return b;
	}
	else if(agt.search(/msnbot/)!=-1){
	// MSNBot (SSD)
		b[0]="msnbot";
		b[1]=agt.match(/msnbot\/(\d+(\.?\d)*)/)[1];
		b[2]="robot";
		b[3]="-1";
		return b;
	}
	else if(agt.search(/turnitinbot/)!=-1){
	// Turnitin (SSD)
		b[0]="turnitinbot";
		b[1]=agt.match(/turnitinbot\/(\d+(\.?\d)*)/)[1];
		b[2]="robot";
		b[3]="-1";
		return b;
	}
	else{
		b[0]="unknown";
		return b;
	}
}
function getOS(){
	var os;
	os=agt.match(/\(.+\)/);
	if(String(os).match(/[wW]indows\s(([nN][tT]\s6\.1)|7)/)){
		// Windows 7
		return "Windows 7";
	}
	else if(String(os).match(/[wW]indows\s(([nN][tT]\s6\.0)|([vV]ista))/)){
		// Windows Vista
		return "Windows Vista";
	}
	else if(String(os).match(/[wW]indows\s(([nN][tT]\s5\.1)|([xX][pP]))/)){
		// Windows XP
		return "Windows XP";
	}
	else if(String(os).match(/mM]acintosh|[pP]ower[pP][cC]|[aA]pple|(ppc|PPC)\s[mM]ac/)){
		// Mac
		return "Mac";
	}
	else{
		return "no matching OS";
	}
}
/*cookies*/
/*
function getCookieVal(offset){
	var endstr=document.cookie.indexOf(";",offset);
	if(endstr==-1)
		endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset,endstr));
}
function FixCookieDate(date){
	var base=new Date(0);
	var skew=base.getTime();
	if(skew > 0)
		date.setTime(date.getTime()-skew);
}
function GetCookie(name){
	var arg=name+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while(i <clen){
		var j=i+alen;
		if(document.cookie.substring(i,j)==arg)
			return getCookieVal(j);
		i=document.cookie.indexOf(" ",i)+1;
		if(i===0) break;
	}
	return null;
}
function SetCookie(name,value,expires,path,domain,secure){
	document.cookie=name+"="+escape(value) +
		((expires)?";expires="+expires.toGMTString():"") +
		((path)?";path="+path:"") +
		((domain)?";domain="+domain:"") +
		((secure)?";secure":"");
}
function DeleteCookie(name,path,domain){
	if(GetCookie(name)){
		document.cookie=name+"=" +
			((path)?";path="+path:"") +
			((domain)?";domain="+domain:"") +
			";expires=Thu,01-Jan-70 00:00:01 GMT";
	}
}
*/
/* computed styles */
var IE_computedStyle=function(){
	var isIE=/*@cc_on true || @*/false;
	var borderRegex=/thin|medium|thick/i;
	var styleEl;
	var getPos=function(which){
		if(/auto/i.test(styleEl.currentStyle[which])){
			return "auto";
		}
		else{
			return grabLength(styleEl.currentStyle[which])+"px";
		}
	};
	var getMargin=function(which){
		if(/auto/i.test(styleEl.currentStyle["margin"+which])){
			return "0px";
		}
		else{
			return grabLength(styleEl.currentStyle["margin"+which])+"px";
		}
	};
	var getBorderWidth=function(which){
		var borderWidth=styleEl.currentStyle["border"+which+"Width"];
		if(styleEl.currentStyle["border"+which+"Style"]!="none"&&((/Top|Bottom/i.test(which) && styleEl.offsetHeight > styleEl.clientHeight)||(/right|Left/i.test(which) && styleEl.offsetWidth > styleEl.clientWidth))){
			if(!borderRegex.test(borderWidth)){
				return grabLength(borderWidth)+"px";
			}
			else if(borderRegex.test(borderWidth)){
				var temp=document.createElement("DIV");
				temp.style.width="10px";
				temp.style.border=borderWidth+" "+styleEl.currentStyle["border"+which+"Style"]+" #000000";
				styleEl.parentNode.appendChild(temp);
				borderWidth=Math.round((temp.offsetWidth-10)/2);
				styleEl.parentNode.removeChild(temp);
				return borderWidth+"px";
			}
		}
		else{
			return "0px";
		}
	};
	var getPadding=function(which){
		return grabLength(styleEl.currentStyle["padding"+which])+"px";
	};
	var getWidth=function(){
		var width=styleEl.offsetWidth;
		width-=parseInt(getPadding("Right"),10);
		width-=parseInt(getPadding("Left"),10);
		width-=parseInt(getBorderWidth("Right"),10);
		width-=parseInt(getBorderWidth("Left"),10);
		return width+"px";
	};
	var getHeight=function(){
		var height=styleEl.offsetHeight;
		height-=parseInt(getPadding("Top"),10);
		height-=parseInt(getPadding("Bottom"),10);
		height-=parseInt(getBorderWidth("Top"),10);
		height-=parseInt(getBorderWidth("Bottom"),10);
		return height;
	};
	var grabLength=function(length){
		var temp=document.createElement("DIV");
		temp.style.width=length;
		styleEl.parentNode.appendChild(temp);
		length=Math.round(temp.offsetWidth);
		styleEl.parentNode.removeChild(temp);
		return length;
	};
	return{
		get:function(el,styleProp){
			var rValue;
			styleEl=(typeof(el)=="string")?document.getElementById(el):el;
			styleProp=(typeof(styleProp)=="string")?styleProp.toLowerCase():"";
			styleProp=styleProp.replace(/\-/g,"");
			if(!isIE|| !/block/i.test(styleEl.currentStyle["display"])) return;
			switch(styleProp){
				case "top": rValue=getPos("top");break;
				case "right": rValue=getPos("right");break;
				case "bottom": rValue=getPos("bottom");break;
				case "left": rValue=getPos("left");break;
				case "margintop": rValue=getMargin("Top");break;
				case "marginright": rValue=getMargin("Right");break;
				case "marginbottom": rValue=getMargin("Bottom");break;
				case "marginleft": rValue=getMargin("Left");break;
				case "bordertopwidth": rValue=getBorderWidth("Top");break;
				case "borderrightwidth": rValue=getBorderWidth("Right");break;
				case "borderbottomwidth": rValue=getBorderWidth("Bottom");break;
				case "borderleftwidth": rValue=getBorderWidth("Left");break;
				case "paddingtop": rValue=getPadding("Top");break;
				case "paddingright": rValue=getPadding("Right");break;
				case "paddingbottom": rValue=getPadding("Bottom");break;
				case "paddingleft": rValue=getPadding("Left");break;
				case "width": rValue=getWidth();break;
				case "height": rValue=getHeight();break;
				default:break;
			}
			return rValue;
		}
	};
}();
function setComputedWidth(o,node,delta){
	var n=document.getElementById(node);
	var x;
	var b=navigator.userAgent.toLowerCase();
	if(String(b).indexOf("msie") > -1){
		x=IE_computedStyle.get(n,"width");
	}
	else{
		x =document.defaultView.getComputedStyle(n,"").width;
	}
	x=Number(x.substring(0,x.length-2));
	x+=Number(delta);
	x=w+"px";
	document.getElementById(o).style.width=x;
}
function setComputedHeight(o,node,delta){
	var n=document.getElementById(node);
	var x;
	var b=navigator.userAgent.toLowerCase();
	if(String(b).indexOf("msie") > -1){
		x=IE_computedStyle.get(n,"height");
	}
	else{
		x =document.defaultView.getComputedStyle(n,"").height;
	}
	x=Number(x.substring(0,x.length-2));
	x+=Number(delta);
	x=w+"px";
	document.getElementById(o).style.height=x;
}
function getComputedWidth(o){
	var x=document.getElementById(o);
	if(x){
		var b=navigator.userAgent.toLowerCase();
		if(String(b).indexOf("msie")>-1){
			return IE_computedStyle.get(x,"width");
		}
		else{
			return document.defaultView.getComputedStyle(x,"").width;
		}
	}
	return null;
}
function getComputedHeight(o){
	var b=navigator.userAgent.toLowerCase();
	if(String(b).indexOf("msie")>-1){
		return IE_computedStyle.get(o,"height");
	}
	else{
		return document.defaultView.getComputedStyle(o,"").height;
	}
}
function getComputedTop(o){
	var b=navigator.userAgent.toLowerCase();
	if(String(b).indexOf("msie")>-1){
		return IE_computedStyle.get(o,"top");
	}
	else{
		return document.defaultView.getComputedStyle(o,"").top;
	}
}
function getComputedBottom(o){
	var b=navigator.userAgent.toLowerCase();
	if(String(b).indexOf("msie")>-1){
		return IE_computedStyle.get(o,"bottom");
	}
	else{
		return document.defaultView.getComputedStyle(o,"").bottom;
	}
}
function setObjHeight(x,y,z){
	var xx;
	var b=navigator.userAgent.toLowerCase();
	if(String(b).indexOf("msie")>-1){
		xx=IE_computedStyle.get(y,"height");
	}
	else{
		xx=document.defaultView.getComputedStyle(y,"").height;
		xx=xx.replace(/px/,"");
	}
	xx=Number(xx)+Number(z);
	x.style.height=xx+"px";
}
/* toggles */
function toggleDisplay(o,x,y){
	var z=document.getElementById(x);
	if(z){
		z.style.display=o.checked?y:"none";
	}
}
function toggleSection(o,stat){
	var s,el,i;
	var a=new Array();
	var str=new String(document.getElementById(o).className);
	str=str.replace(/ disabled/,"");
	document.getElementById(o).className=(stat== "off")?str+" disabled": str;
	s=document.getElementById(o);
	a=s.getElementsByTagName("input");
	for(i=0;i <a.length;i++){
		if(document.getElementById(a[i].id)){
			el=document.getElementById(a[i].id);
		}
		if(el.type.toLowerCase() !="hidden"){
			el.disabled=(stat=="off")?true:false;
			if(stat=="off"){
				switch(el.type.toLowerCase()){
					case "text":
						el.value="";
						break;
					case "checkbox":
						el.checked=false;
						break;
					case "radio":
						el.checked=false;
						break;
					default:
						break;
				}
			}
		}
	}
	a=s.getElementsByTagName("select");
	for(i=0;i <a.length;i++){
		el=document.getElementById(a[i].id);
		el.disabled=(stat=="off")?true:false;
		if(stat=="off"){
			el.selectedIndex=0;
		}
	}
	a=s.getElementsByTagName("textarea");
	for(i=0;i <a.length;i++){
		el=document.getElementById(a[i].id);
		el.disabled=(stat=="off")?true:false;
		if(stat=="off"){
			el.value="";
		}
	}
	a=s.getElementsByTagName("img");
	for(i=0;i <a.length;i++){
		if(a[i].id){
			el=document.getElementById(a[i].id);
			if(el){
				if(el.className=="req"){
					el.src=(stat== "off")?"/atf/cf/{77dee951-b24f-42a6-9d0e-d7e5b841384d}/rqd_disabled.gif":"/atf/cf/{77dee951-b24f-42a6-9d0e-d7e5b841384d}/rqd.gif";
				}
			}
		}
	}
}
function toggleFieldset(o){
	var j;
	var y;
	if(o.type.toLowerCase()=="checkbox"||o.type.toLowerCase()=="radio"){
		for(var i=1;i<arguments.length;i++){
			var x=document.getElementById(arguments[i]);
			if(x){
				if(o.checked){
					x.className=x.className.replace(/disabled/,"");
					y=x.getElementsByTagName("input");
					for(j=0;j<y.length;j++){
						y[j].disabled=false;
					}
					y=x.getElementsByTagName("select");
					for(j=0;j<y.length;j++){
						y[j].disabled=y[j].length>1?false:true;
						y[j].disabled=false;
					}
				}
				else{
					x.className=x.className.indexOf("disabled")>-1?x.className:x.className+" disabled";
					y=x.getElementsByTagName("input");
					for(j=1;j<y.length;j++){
						y[j].disabled=true;
					}
					y=x.getElementsByTagName("select");
					for(j=0;j<y.length;j++){
						y[j].disabled=true;
					}
				}
			}
		}
	}
}
/* gets */
function getCellValue(cellOrId){
	var cell= typeof cellOrId=='string'?(document.all?document.all[cellOrId]:document.getElementById(cellOrId)):cellOrId;
	return cell.innerHTML;
}
function getElementsByClass(searchClass,node,tag){
	var classElements=new Array();
	node=node===null?document:(typeof(node)=="string"?document.getElementById(node):node);
	tag=tag===null?"*":tag;
	if(node){
		var els=node.getElementsByTagName(tag);
		var elsLen=els.length;
		var pattern=new RegExp('(^|\\s)'+searchClass+'(\\s|$)');
		for(i=0,j=0;i<elsLen;i++){
			if(pattern.test(els[i].className)){
				classElements[j]=els[i];
				j++;
			}
		}
	}
	return classElements;
}
/* setting */
function setSrc(o,x){
	o.src=x;
}
function changeSrc(o,x){
	if(document.getElementById(o)){
		document.getElementById(o).src=x;
	}
}
function changeClassName(o,x){
	if(document.getElementById(o)){
		document.getElementById(o).className=x;
	}
}
function setReadOnly(o,x){
	if(document.getElementById(o)){
		document.getElementById(o).readOnly=x;
	}
}
function setFocus(o){
	if(document.getElementById(o)){
		document.getElementById(o).focus();
	}
}
function goToLocation(x){
	location.href=x;
}
function setDisplay(o,x){
	if(document.getElementById(o)){
		document.getElementById(o).style.display=x;
	}
}
function redrawCaptcha(){
	RefreshCaptcha();
		document.getElementById("img_captcha").src=document.getElementById("imgCaptcha").src;
}
function getTargetElement(e){
	var elem;
	if(e.target){
		elem=(e.target.nodeType==3)?e.target.parentNode:e.target;
	}
	else{
		elem=e.srcElement;
	}
	return elem;
}
/* misc */
function toTop(){
	if(window.parent){
		if(window.parent.document.getElementById("container")){
			scrollToObject(window.parent.document.getElementById("container"),-300);
		}
	}
}
function findPosition(o){
	if(typeof(o.offsetParent)!="undefined"){
		for(var x=0,y=0;o;o=o.offsetParent ){
			x+=o.offsetLeft;
			y+=o.offsetTop;
		}
		return[x,y];
	}
	else {
		return[o.x,o.y];
	}
}
function scrollToObject(o,x){
	try{
		var pos=findPosition(o);
	}catch(e){}
	try{
		window.top==window.self?window.scrollTo(0,pos[1]):window.top.scrollTo(0,Number(pos[1])+x);
	}catch(e){}
	try{
		scroll(0,pos[1]);
	}catch(e){}
}
function swapSrc(o,s){
	var x=new String(document.getElementById(o).onmouseover);
	var y=new String(document.getElementById(o).onmouseout);
	if(x.indexOf("_on_on")>-1&&y.indexOf("_on")>-1){
		return false;
	}
	else{
		document.getElementById(o).src=s;
		return true;
	}
}
function roundDec(x,y){
	return Math.round(x*Math.pow(10,y))/Math.pow(10,y);
}
function callouts(){
	var x=Math.round(Math.random()*17)+1;
	if(document.getElementById("wp-quote"+x)){
		document.getElementById("wp-quote"+x).style.display="block";
		if(t){
			clearTimeout(t);
		}
		return true;
	}
	else{
		var t=setTimeout("callouts()",100);
	}
	return false;
}
function openWin(x){
	var specs=new String("\"");
	specs=arguments[1]?(parseInt(arguments[1],10)!=NaN?specs+"width="+arguments[1]+",":specs):specs;
	specs=arguments[2]?(parseInt(arguments[2],10)!=NaN?specs+"height="+arguments[2]+",":specs):specs;
	if(arguments.length>3){
		for(var i=3;i<arguments.length;i++){
			switch(arguments[i]){
				case "directories":
					specs=specs.replace(/directories\=no/,"directories=yes");
					break;
				case "location":
					specs=specs.replace(/location\=no/,"location=yes");
					break;
				case "menubar":
					specs=specs.replace(/menubar\=no/,"menubar=yes");
					break;
				case "resizable":
					specs=specs.replace(/resizable\=no/,"resizable=yes");
					break;
				case "scrollbars":
					specs=specs.replace(/scrollbars\=no/,"scrollbars=yes");
					break;
				case "status":
					specs=specs.replace(/status\=no/,"status=yes");
					break;
				case "titlebar":
					specs=specs.replace(/titlebar\=no/,"titlebar=yes");
					break;
				case "toolbar":
					specs=specs.replace(/toolbar\=no/,"toolbar=yes");
					break;
				default:
					break;
			}
		}
	}
	var y=window.open(x,"_blank",specs);
	if(y){
		y.focus();
		return false;
	}
	return true;
}
function largerImg(o,evt){
	var x=document.getElementById("selection");
	if(x){
		var y=getElementsByClass("cert-pop",x,"div");
		for(var i=0;i<y.length;i++){
			y[i].style.display="none";
		}
		y=getElementsByClass("card-pop",x,"div");
		for(i=0;i<y.length;i++){
			y[i].style.display="none";
		}
		y=getElementsByClass("ecard-pop",x,"div");
		for(i=0;i<y.length;i++){
			y[i].style.display="none";
		}
		o=o.indexOf("cert-thumb")>-1?"cert-pop"+o.replace(/cert-thumb/,""):(o.indexOf("card-thumb")>-1?"card-pop"+o.replace(/card-thumb/,""):(o.indexOf("cert-thumb")>-1?"cert-pop"+o.replace(/card-thumb/,""):(o.indexOf("thumb")>-1?"ecard-pop"+o.replace(/thumb/,""):o)));
		o=document.getElementById(o);
		if(o){
			evt=!evt?window.event:evt;
			x=evt.clientX;
			y=evt.clientY;
			var b=new Array(4);
			b=getBrowser();
			o.style.cursor=b[0]?(b[0]=="msie"?"pointer":"url(\"/atf/cf/{9dcd797d-e691-45d6-a735-21db0cd0a7e1}/minimize.cur\"),pointer"):"pointer";
			o.style.display="block";
			o.style.top=(Number(y)-240)+"px";
		}
	}
}
/* iframes */
function iframeAnchor(){
	if(window.parent){
		x=window.parent.location.href.split('?');
		if(x.length>0){
			y=x[x.length-1];
			location.href='#'+y;
			window.scrollTo(0,0);
		}
	}
}
var c=0;
function checkLoad(x,y,z){
	var t;
	if(window.parent.frames[x]){
		if(window.parent.document.getElementById(x)){
			if(window.parent.frames[x].document.getElementById(y)){
				setFrameHeight(x,y,z);
			}
			else{
				if(c<10){
					t=setTimeout("checkLoad(\'"+x+"\',\'"+y+"\',\'"+z+"\')",100);
					c++;
				}
			}
		}
		if(c<10){
			t=setTimeout("checkLoad(\'"+x+"\',\'"+y+"\',\'"+z+"\')",100);
			c++;
		}
	}
	if(c<10){
		t=setTimeout("checkLoad(\'"+x+"\',\'"+y+"\',\'"+z+"\')",100);
		c++;
	}
}
function setFrameHeight(x,y,z){
	if(window.parent.frames[x]){
		if(window.parent.document.getElementById(x)){
			if(window.parent.frames[x].document.getElementById(y)){
				var xx;
				var b=navigator.userAgent.toLowerCase();
				if(String(b).indexOf("msie")>-1){
					xx=IE_computedStyle.get(window.parent.frames[x].document.getElementById(y),"height");
				}
				else{
					xx=document.defaultView.getComputedStyle(window.parent.frames[x].document.getElementById(y),"").height;
					xx=xx.replace(/px/,"");
				}
				xx=Number(xx)+Number(z);
				window.parent.document.getElementById(x).style.height=xx+"px";
				correctIE6();
			}
			else{
				checkLoad(x,y,z);
			}
		}
		else{
			checkLoad(x,y,z);
		}
	}
	else{
		checkLoad(x,y,z);
	}
}
function setupFrame(x,y,z){
	var t=setTimeout("setFrameHeight(\'"+x+"\',\'"+y+"\',\'"+z+"\')",100);
}
function getIframe(win,ptr){
	node=win.document.getElementById(ptr);
	if(node){
		var x=new Array(2);
		if(node.contentDocument){ // DOM
			x[0]=node.contentDocument;
			x[1]=node.contentDocument.forms[0];
		}
		else if(node.contentWindow){ // IE win
			x[0]=node.contentWindow.document;
			x[1]=node.contentWindow.document.forms[0];
		}
		else if(window.frames[ptr].document){
			x[0]=window.frames[ptr].document;
			x[1]=window.frames[ptr].document.forms[0];
		}
	}
	return x;
}
/* events */
function fireEvent(o,evnt){
	var evt;
	if(document.createEvent){ // DOM
		evt=document.createEvent("HTMLEvents");
		evt.initEvent(evnt,true,true); // event type,bubbling,cancelable
		return !o.dispatchEvent(evt);
	}
	else{ // IE
		evt=document.createEventObject();
		return o.fireEvent("on"+evnt,evt);
	}
}
/* IE 6 Fix */
function getIEHeight(x){
	var height=x.offsetHeight;
	return height;
}
function correctIE6(){
	var b=new Array(4);
	b=getBrowser();
	if(b[0]){
		if(b[0]=="msie"){
			var v=String(b[1]).split(".");
			if(v[0]=="6"){
				var x=window.top!=window.self?document.getElementById("container"):document.getElementById("mainContent");
				if(x){
					var y=getComputedHeight(x);
					x=window.top!=window.self?window.parent.document.getElementById("bg_columns_sub"):document.getElementById("bg_columns_sub");
					if(x){
						var z=getIEHeight(x);
						x.style.height=String(Number(y)+161)+"px";
					}
				}
			}
		}
	}
}
/* timer */
/*
		Timer by Algorithm
		http://www.codingforums.com/archive/index.php/t-10531.html
	*/
	function Timer(){
		this.obj = (arguments.length)?arguments[0]:window;
		return this;
	}

	// The set functions should be called with:
	// - The name of the object method (as a string) (required)
	// - The millisecond delay (required)
	// - Any number of extra arguments, which will all be
	// passed to the method when it is evaluated.

	Timer.prototype.setInterval = function(func, msec){
		var i = Timer.getNew();
		var t = Timer.buildCall(this.obj, i, arguments);
		Timer.set[i].timer = window.setInterval(t,msec);
		return i;
	}
	Timer.prototype.setTimeoutx = function(func, msec){
//		alert("timer");
		var i = Timer.getNew();
		Timer.buildCall(this.obj, i, arguments);
		Timer.set[i].timer = window.setTimeout("Timer.callOnce("+i+");",msec);
		return i;
	}

	// The clear functions should be called with
	// the return value from the equivalent set function.
	Timer.prototype.clearInterval = function(i){
		if(!Timer.set[i]) return;
		window.clearInterval(Timer.set[i].timer);
		Timer.set[i] = null;
	}
	Timer.prototype.clearTimeout = function(i){
		if(!Timer.set[i]) return;
		window.clearTimeout(Timer.set[i].timer);
		Timer.set[i] = null;
	}

	// Private data
	Timer.set = new Array();
	Timer.buildCall = function(obj, i, args){
		var t = "";
		Timer.set[i] = new Array();
		if(obj != window){
			Timer.set[i].obj = obj;
			t = "Timer.set["+i+"].obj.";
		}
		t += args[0]+"(";
		if(args.length > 2){
			Timer.set[i][0] = args[2];
			t += "Timer.set["+i+"][0]";
			for(var j=1; (j+2)<args.length; j++){
				Timer.set[i][j] = args[j+2];
				t += ", Timer.set["+i+"]["+j+"]";
			}
		}
		t += ");";
		Timer.set[i].call = t;
		return t;
	}
	Timer.callOnce = function(i){
		if(!Timer.set[i]) return;
		eval(Timer.set[i].call);
		Timer.set[i] = null;
	}
	Timer.getNew = function(){
		var i = 0;
		while(Timer.set[i]) i++;
		return i;
	}
