
// RC2 Learning Curve
// lib_global.js
// Version: 1.0
// Date: December 17, 2007

var _page = new Object();
_page.rc2message = new Array();
_page.msglink = new Array();
_page.values = new Object();
_page.rc2locales = new Object();
_page.hideIntlStyle = false;
_page.menutype = "";
_page.altIntlFlag = "";
_page.altIntlText = "";
_page.selectedLocale = "";
_page.GlobalLanguageSwitch ="";
_page.browserInfo = new Array();
var browser = new RC2BrowserInfo();
var useRC2Iframe = (browser.isIE5up &&  (!browser.isIE5x || browser.isIE55));
_page.leftNavOnload = (browser.isNS && !browser.isNS7up?false:true);
var isMacIE = (browser.isIE && browser.isMac?true:false);
var arrLoad = new Array();
var arrDOMLoad = new Array();

function stylesheets(){	
	var rc2stylesheet='';
	if(_page.hideIntlStyle == false){
		rc2stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\""+contentPrefixAttribute+"/css/rc2_global.css\" />\n";
	}
	
	if(browser.isNS6x){
		rc2stylesheet += "<style>td.dd-inactiveItem{font-size:80%;}td.dd-activeItem{font-size:80%;}.p-table_flyout{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:70%;}</style>";
	}
	if(browser.isNS6x || browser.isNS7x){
		rc2stylesheet += "<style>.p-content-grid{border-collapse:inherit;}</style>";
	}
	if(browser.isNS7x){	
		rc2stylesheet += "<style>table.p-dropdown table td{border-width:0px;}</style>";
	}
	if(browser.isOpera && browser.isWin){		
	}
		
	if(rc2stylesheet!="") document.write(rc2stylesheet);
};

_page.rc2intlcountries = new Object();
_page.rc2intllanguages = new Object();


_page.rc2intlcountries["US"]="United States";
_page.rc2intlcountries["AU"]="Australia";
_page.rc2intlcountries["CA"]="Canada";
_page.rc2intlcountries["CN"]="China";
_page.rc2intlcountries["DE"]="Deutschland";
_page.rc2intlcountries["FR"]="France";
_page.rc2intlcountries["GB"]="UK & Eire";




_page.rc2intllanguages["de"]="Deutsch";
_page.rc2intllanguages["fr"]="Fran&#231;ais";
_page.rc2intllanguages["en"]="English";
_page.rc2intllanguages["na"]="&#x4e2d;&#x6587;";
_page.menutype = "";

_page.changelocale = function (locale) {	
	var strCheckLocale = (_page.selectedLocale!=""?_page.selectedLocale:_page.locale);
	if(locale==""){		
		alert(_page.rc2message["alert2"]);
	}
	saveNewLocaleCookie(locale);

};

_page.write = function (str, last_item) {
	document.write(str);
};

_page.writeHeader = function (menutype) {
	_page.headerType = "internet";
	_page.hideIntlStyle = false;
	stylesheets();

    var rc2server = "";
	var intl_arrow_name = _page.direction=='ltr'?"arrow_header.gif":"arrow_header_rtl.gif";
	
    var rc2header="";
	rc2header+="			<div id=\"p-header\">\n";
	rc2header+="				<div id=\"p-header-wrapper\">\n";
	rc2header+="					<table id=\"p-topcontainer\" cellspacing=\"0\" border=\"0\">\n";
	rc2header+="						<tr>\n";	
	rc2header+="							<td id=\"p-topright\">\n";
	
	rc2header+="											<table id=\"p-mainnav\" class=\"p-tight\" cellspacing=\"0\" border=\"0\">";
	rc2header+="												<tr>";
	rc2header+="													<td id=\"p-mainnav-sep2\" class=\"mainnavsep\" ><img alt=\"\" src=\""+contentPrefixAttribute+"/images/t.gif\" width=\"1\" /></td>";
	
	rc2header+="													<td id=\"p-mainnav-rightcorner\" class=\"p-mainnav-rightcorner\">\n";
	var headerLS = new _page.ls('1');

	rc2header+= headerLS.html;
	rc2header+="													</td>\n";
	rc2header+="												</tr>\n";
	rc2header+="											</table>\n";
	rc2header+="										</td>\n";
	rc2header+="									</tr>\n";
	
	rc2header+="					</table>\n";
	rc2header+="				</div>\n";
	rc2header+="			</div>\n";
	
    _page.write(rc2header, false);
};
	
	_page.arrLS =[];
	_page.ls = function(type) {
		this.arrIndex = _page.arrLS.length;
		this.id = "ls_"+ this.arrIndex;
		this.timer = "";
		this.type = type;
		this.rows = 9;
		this.overflow = false;		
		_page.arrLS[this.arrIndex] = this;
		this._init();
	}
	_page.ls.prototype = {
		_init:function() {
			this._rc2countrybuild();
			addDOMOnLoadEvent("_page.arrLS["+this.arrIndex+"]._rc2countryupdate();");
		},
		_rc2countryload:function() {
			this._rc2countryupdate();
			this._rc2countryRenderImages();
			this._rc2countryresize();
			this._rc2countryposition();
		},
		_mRC2CountryClick:function() {
			clearTimeout(this.timer);
			_page.arrLS[this.arrIndex]._rc2countryshow();
		},
		_mRC2CountryOver:function() {
			clearTimeout(this.timer);
			this.timer=setTimeout('_page.arrLS['+this.arrIndex+']._rc2countryshow()','2000');
		},
		_mRC2CountryClose:function() {
			clearTimeout(this.timer);
			this.timer=setTimeout('_page.arrLS['+this.arrIndex+']._rc2countryhide()','100');
		},
		_rc2countryshow:function() {
			this._rc2countryload();
			var objLS = gE('p-ls-container-'+this.arrIndex);
			if(objLS) {
				var objLSBody = gE('p-ls-body-'+this.arrIndex);
				if(objLSBody && this.overflow) objLSBody.style.overflow = "auto";	
				if(this.type == '1') {
					var objFlag = gE('p-flag-'+this.arrIndex);
					if(objFlag) applyRC2Style(objFlag,'p-flag-on');
				}
				if(useRC2Iframe) {
					var objIframe = gE('p-lsIF-'+this.arrIndex);
					if(objIframe) sE(objIframe);
				}
				sE(objLS);
			};
		},
		_rc2countryhide:function() {
			var objLS = gE('p-ls-container-'+this.arrIndex);
			if(objLS) {
				var objLSBody = gE('p-ls-body-'+this.arrIndex);
				if(objLSBody  && this.overflow) objLSBody.style.overflow = "hidden";
				if(this.type == '1') {
					var objFlag = gE('p-flag-'+this.arrIndex);
					if(objFlag) applyRC2Style(objFlag,'p-flag');
				}
				if(useRC2Iframe) {
					var objIframe = gE('p-lsIF-'+this.arrIndex);
					if(objIframe) hE(objIframe);
				}
				hE(objLS);
			}
		},
		_rc2countrybuild:function() {			
			var strFlagLocale = (_page.altIntlFlag==""?_page.locale:_page.altIntlFlag);					
			var strLocaleText = _page.altIntlText;
			flag_src= "rc2flag_"+strFlagLocale.substr(3,5)+".gif";			
			current_country = strFlagLocale.substring(3,5);
			current_language = strFlagLocale.substring(0,2);
			if(_page.altIntlText=="") strLocaleText = _page.rc2intlcountries[current_country] +" / "+ _page.rc2intllanguages[current_language]		

			var strHTML = "";
			var rc2server = "";			
			var strArrowName = (_page.direction == 'ltr'?"rc2_arrow_bottom_right.gif":"rc2_arrow_bottom_left.gif")
			if(this.type == "1") {
				strHTML+="<div class=\"p-ls-hover-container-1 p-click\" onmouseover=\"_page.arrLS["+this.arrIndex+"]._mRC2CountryOver()\" onmouseout=\"_page.arrLS["+this.arrIndex+"]._mRC2CountryClose()\" onclick=\"_page.arrLS["+this.arrIndex+"]._mRC2CountryClick()\"><nobr><table class=\"p-ls-hover\" id=\"p-ls-hover-"+this.arrIndex+"\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td class=\"p-ls-hover-center\"><span id=\"p-ls-header-text-"+this.arrIndex+"\">"+strLocaleText+"</span></td><td class=\"p-ls-hover-right\"><img alt=\""+strLocaleText+"\" src=\""+contentPrefixAttribute+"/images/" + flag_src + "\" id=\"p-flag-"+this.arrIndex+"\" class=\"p-flag\" /></td><td class=\"p-ls-hover-right\"><img alt=\"Show locale list\" src=\""+contentPrefixAttribute+"/images/"+strArrowName+"\" id=\"p-arrow-bottom-right-"+this.arrIndex+"\"/></td></tr></table></nobr></div>\n";
			} else if(this.type == "2") {
				strHTML+="<div class=\"p-ls-hover-container-2 p-click\" onmouseover=\"_page.arrLS["+this.arrIndex+"]._mRC2CountryOver()\" onmouseout=\"_page.arrLS["+this.arrIndex+"]._mRC2CountryClose()\" onclick=\"_page.arrLS["+this.arrIndex+"]._mRC2CountryClick()\"><table class=\"p-ls-hover\" id=\"p-ls-hover-"+this.arrIndex+"\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td class=\"p-ls-hover-left\"><img alt=\""+strLocaleText+"\" src=\""+contentPrefixAttribute+"/images/" + flag_src + "\" id=\"p-flag-"+this.arrIndex+"\" class=\"p-flag\" /></td><td class=\"p-ls-hover-center\"><span id=\"p-ls-header-text-"+this.arrIndex+"\">"+strLocaleText+"</span></td><td class=\"p-ls-hover-right\"><img alt=\"Show locale list\" src=\""+contentPrefixAttribute+"/images/"+strArrowName+"\" id=\"p-arrow-bottom-right-"+this.arrIndex+"\"/></td></tr></table></div>\n";
			}
			

			strHTML+="					<div id=\"p-ls-container-"+this.arrIndex+"\" class=\"p-ls-container\" onmouseover=\"_page.arrLS["+this.arrIndex+"]._mRC2CountryOver()\" onmouseout=\"_page.arrLS["+this.arrIndex+"]._mRC2CountryClose()\" style=\"visibility:hidden;\">\n";
			var strHeader = "<div id=\"p-ls-header-"+this.arrIndex+"\" class=\"p-ls-header\"><table cellspacing=\"0\" class=\"p-ls-header-table\"><tr><td><span id=\"p-ls-header-text-"+this.arrIndex+"\">"+strLocaleText+"</span></td></tr></table></div>\n";
			
			var strOverflow = (browser.isSafari?'auto':'hidden');
			var strClass = (this.type=='1'?'p-ls-body-down':'p-ls-body-up');
			var strBody = "<div id=\"p-ls-body-"+this.arrIndex+"\" class=\""+strClass+"\" style=\"overflow:"+strOverflow+"\">Loading...</div>\n";
			if(this.type == "1") {
				strHTML+= strHeader + strBody;	
			} else if(this.type == "2") {
				strHTML+= strBody;
			}
			strHTML+="</div>";		
			if(useRC2Iframe) {
				strHTML+="		<iframe frameborder=0 id=\"p-lsIF-"+this.arrIndex+"\" src=\""+"" +contentPrefixAttribute+ "/images/t.gif\" scroll=none style=\"FILTER:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);visibility:hidden;height:0;position:absolute;width:0px;top:0px;z-index:0\"></iframe>";
		    }
			this.html = strHTML;
		},
		_rc2countryRenderImages:function() {
			if(this.imagesRendered) return;
			var strLocale, strCurCountry, objLink, strNewClass;
			for(var i=0;i < arrLocales.length;i++) {
				strLocale = arrLocales[i][0];
				strCurCountry = (strLocale.indexOf("_")==-1?strLocale:strLocale.substring(3,5));
				objLink = gE("p-ls-list-"+this.arrIndex+"-flag-" + strCurCountry);
				strNewClass = "p-flag-" + strCurCountry;
				if(objLink)
					applyRC2Style(objLink,strNewClass);
			}
			this.imagesRendered = false;	
		},
		_rc2countryupdate:function() {
			if(this.updated) return;
			if(!blnLocalesProcessed) processGlobalLocales();
			var rc2server = "";
			var strHTML = '';
			var strCurCountry = '';
			var strLastCountry = '';
                     var strLastLocale = '';
			var strLocale = '';
			strHTML += "<table class=\"p-ls-list\" cellspacing=\"0\" border=\"0\">\n";
			
			for(var i=0;i < arrLocales.length;i++) {
				strLocale = arrLocales[i][0];
				strCurCountry = (strLocale.indexOf("_")==-1?strLocale:strLocale.substring(3,5));
				
				if (strCurCountry != strLastCountry) {					
					var objFlagDimensions = {width:'17',height:'13'};
					strHTML += 
					(i!=0?"</ul></td><td class=\"p-ls-list-left"+(!arrLocales[i]?" p-nobottomborder":"")+"\"><a id=\"p-ls-list-"+((this.arrIndex))+"-flag-"+strLastCountry+"\" href=\""+arrLocales[i-1][3]+"\" onclick=\"_page.changelocale('"+strLastLocale+"');return false;\" /></td></tr>\n":"")+
					"<tr><td  class=\"p-ls-list-right"+(!arrLocales[i+1]?" p-nobottomborder":"")+"\"><ul class=\"p-ls-localelist\">\n";					
				}
				if(strLocale=="na_CN"){
					strHTML += "<li><a href=\""+arrLocales[i][3]+"\" >"+arrLocales[i][4]+"</a></li>";
				}
				else {
					strHTML += "<li><a href=\""+arrLocales[i][3]+"\" onclick=\"_page.changelocale('"+strLocale+"');return false;\">"+arrLocales[i][4]+"</a></li>";
				}
				
				strLastCountry = strCurCountry;
                           strLastLocale  = strLocale; 
			}
			strHTML += "</ul></td><td class=\"p-ls-list-left"+(!arrLocales[arrLocales.length-1]?" p-nobottomborder":"")+"\"><a id=\"p-ls-list-"+((this.arrIndex))+"-flag-"+strLastCountry+"\" href=\""+arrLocales[(arrLocales.length-1)][3]+"\" onclick=\"_page.changelocale('"+strLastLocale+"');return false;\" /></td></tr>\n";
			strHTML += "</table>\n";
			var obj = gE('p-ls-body-'+this.arrIndex);
			if(obj) obj.innerHTML = strHTML;
			this.updated = true;
		},
		_rc2countryresize:function() {
			if(this.resized) return;
			
			var intMaxRows = this.rows;
			var objDD = document.getElementById('p-ls-body-'+this.arrIndex);
			var arrRows = objDD.getElementsByTagName('tr');
			var intHeight = 0;
			var i= 0;
			while (i <= intMaxRows-1) {
				if(arrRows[i]) {
					var objCell = arrRows[i].childNodes[1];
					intHeight += objCell.offsetHeight;
				} 
				i++;
			}
			if(arrRows.length > intMaxRows) {
				intHeight--;
				this.overflow = true;
			} else if(!browser.isSafari) {
				var objList = objDD.firstChild;
				sW(objList,objDD.offsetWidth-2);
			}
			sH(objDD,intHeight);
			this.resized = true;
		},
		_rc2countryposition:function () {
			var posX = 0;
			var posY = 0;
			var objLS = gE('p-ls-container-'+this.arrIndex);
			var objRef = null;
			if(this.type == '1') {
				objRef = gE('p-arrow-bottom-right-'+this.arrIndex);
				if(_page.direction == 'rtl') {
					posX = getLeftCountryPos(objRef) + objRef.offsetWidth - 2; //  Extra border
				} else {
					posX = getLeftCountryPos(objRef) - objLS.offsetWidth + objRef.offsetWidth + 6; //  Extra border
					if(isMacIE) 
						posX -= findCountryPosX(gE('p-topcontainer'));
				}
				posY = findCountryPosY(objRef)-14;
			} else if(this.type == '2') {
				objRef = gE('p-ls-hover-'+this.arrIndex);
				posX = getLeftCountryPos(objRef) +2 //  Extra border
				posY = findCountryPosY(objRef)-objLS.offsetHeight;
			}
			sX(objLS,posX);
			sY(objLS,posY);
			
			if (useRC2Iframe) {
				var	objIframe = gE('p-lsIF-'+this.arrIndex);
				sH(objIframe,(objLS.offsetHeight+3));
				sW(objIframe,(objLS.offsetWidth+3));
				sX(objIframe,posX);
				sY(objIframe,posY);
			}
		}
	}

	
	var arrLocales = [];
	var blnLocalesProcessed = false;
	function processGlobalLocales() {
		
		var i = 0;
		for(anItem in _page.rc2locales){
			if(anItem != "global") {
				var strCountry = _page.rc2intlcountries[anItem.substring(3,5)];
				var strLanguage = _page.rc2intllanguages[anItem.substring(0,2)];
				arrLocales[i] = [];
				arrLocales[i][0] = anItem;
				arrLocales[i][1] = strCountry;
				arrLocales[i][2] = strLanguage;
				arrLocales[i][3] = _page.rc2locales[anItem];
				arrLocales[i][4] = strCountry+" / "+strLanguage;
				
				i++;
			}
		}
	
		var sortCol=4;
		//var sortOrder="asc";
		//arrLocales.sort(sortArray);
		function sortArray(a,b) {
			if (a[sortCol]<b[sortCol]) return (sortOrder=="asc"?-1:1);
			if (a[sortCol]>b[sortCol]) return (sortOrder=="asc"?1:-1);
			return 0;
		}
	
		blnLocalesProcessed = true;
	}
	
	function getLeftCountryPos(objElement) {
		var offsetLeft = findCountryPosX(objElement);
		return offsetLeft - 2;
	};

	function getCountryTopPosBottom(objElement) {
		var offsetTop = 0;
		var adjust = 0;		
		if(objElement != null){
			if(objElement.offsetHeight!=33){				
				if(objElement.offsetHeight==34){					
					adjust = objElement.offsetHeight - 18;
				}else{
					adjust = objElement.offsetHeight - 20;
				}		
			}
			return findCountryPosY(objElement) + objElement.offsetHeight - adjust;
		}
		return 0;
	};

	
	function positionRC2CountryDropDown(section){
		
		var objButton = gE(section + 'button');
		var dd = gE('p-' + section + 'DD');
		var extra_left = 1;		
		if(_page.direction=="rtl"){			
			extra_left = objButton.offsetWidth - dd.offsetWidth + 3;
		}
		
		sX(dd, getLeftCountryPos(objButton)+extra_left);
		sY(dd, getCountryTopPosBottom(objButton));
		
		if (useRC2Iframe) {
			var	ddframe = gE('p-' + section + 'IF');
			sH(ddframe, (dd.offsetHeight));
			sW(ddframe, (dd.offsetWidth));
			sX(ddframe, getLeftCountryPos(objButton)+extra_left);
			sY(ddframe, getCountryTopPosBottom(objButton));
		}
	};

	_page.showRC2Popup = function(url) {
		var wHeight=_page.popupHeight;
		var wWidth=_page.popupWidth;
		var w=window.open(url,'_blank','height='+wHeight+',width='+wWidth+',toolbar=no,scrollbars=yes,resizable=yes')
		return false;
	};
	
	

	function addOnLoadEvent(strEvent) {
		var curContainer = arrLoad.length;
		arrLoad[curContainer] = strEvent;
	};
	

	function addDOMOnLoadEvent(strEvent) {
		var curContainer = arrDOMLoad.length;
		arrDOMLoad[curContainer] = strEvent;
	};
	
	
	d=document;l=d.layers;op=navigator.userAgent.indexOf('Opera')!=-1;px='px';	
	function gE(e,f){if(l){f=(f)?f:self;var V=f.document.layers;if(V){if(V[e])return V[e];for(var W=0;W<V.length;)t=gE(e,V[W++]);return t;}}if(d.getElementById)return d.getElementById(e);if(d.all)return d.all[e];else return null;};
	function sE(e){l?e.visibility='show':e.style.visibility='inherit';};
	function hE(e){l?e.visibility='hide':e.style.visibility='hidden';};
	function dE(e){e.style.display='';};
	function nE(e){e.style.display='none';};
	function sZ(e,z){l?e.zIndex=z:e.style.zIndex=z;};
	function sX(e,x){l?e.left=x:op?e.style.pixelLeft=x:e.style.left=x+px;};
	function sY(e,y){l?e.top=y:op?e.style.pixelTop=y:e.style.top=y+px;};
	function sW(e,w){l?e.clip.width=w:op?e.style.pixelWidth=w:e.style.width=w+px;};
	function gW(e){if(l){return e.clip.width}else if(op){return e.style.pixelWidth}else{return e.style.width;}};
	function sH(e,h){l?e.clip.height=h:op?e.style.pixelHeight=h:e.style.height=h+px;};
	function sC(e,t,r,b,x){l?(X=e.clip,X.top=t,X.right=r,X.bottom=b,X.left=x):e.style.clip='rect('+t+px+' '+r+px+' '+b+px+' '+x+px+')';};
	function wH(e,h){if(l){Y=e.document;Y.open();Y.write(h);Y.close();}if(e.innerHTML)e.innerHTML=h;};
	function goW(e){return(e.clip?e.clip.width:e.offsetWidth)};
	function goH(e){return(e.clip?e.clip.height:e.offsetHeight)};
	function gsW(){return(screen.availWidth?screen.availWidth:screen.width)};
	function gsH(){return(screen.availHeight?screen.availHeight:screen.height)};
	

	function applyRC2Style(elementId, className) {
		if(browser.isIE){
			elementId.setAttribute("className", className);
		} else {
			elementId.setAttribute("class", className);
		}
	};
	

	function getRC2Style(elementId) {
		if(browser.isIE){
			return elementId.getAttribute("className");
		} else {
			return elementId.getAttribute("class");
		}
	};
	

	function findCountryPosX(obj) {
		var curleft = 0;
		if(obj != null) {
			if (obj.offsetParent) {			
				while (obj.offsetParent) {
					curleft += obj.offsetLeft;
					obj = obj.offsetParent;
				}
			}
			else if (obj.x) curleft += obj.x;
		}
		return curleft;
	};

	function findCountryPosY(obj) {
		var curtop = 0;
		if(obj != null) {
			if (obj.offsetParent) {
				while (obj.offsetParent) {
					curtop += obj.offsetTop;
					obj = obj.offsetParent;
				}
			}
			else if (obj.y)	curtop += obj.y;
		}
		return curtop;
	};

	
	function RC2BrowserInfo() {
   		var ua = navigator.userAgent.toLowerCase(); 
   		
   		this.isGecko       = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
		this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);
   		
   		if(ua.indexOf('opera') != -1) {this.isOpera = true; this.name = "Opera"};
   		if((ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) )) {this.isIE=true; this.name = "Internet Explorer"};
   		if(this.isGecko && ua.indexOf('gecko/') + 14 == ua.length) {this.isMozilla=true; this.name = "Mozilla"};
		if((this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) )) {this.isNS=true; this.name = "Netscape"};
   		if(ua.indexOf('firebird/') != -1) {this.isFirebird=true; this.name = "Firebird"};
		if(ua.indexOf('firefox/') != -1) {this.isFirefox=true; this.name = "FireFox"};
		if(ua.indexOf('safari/') != -1) {this.isSafari=true; this.name = "Safari"};
   		if(ua.indexOf('konqueror') != -1) {this.isKonqueror=true; this.name = "Konqueror"};
		if(ua.indexOf('omniweb') != -1) {this.isOmniweb=true; this.name = "Omniweb"};
		if(ua.indexOf('webtv') != -1) {this.isWebtv=true; this.name = "WebTV"};
		if(ua.indexOf('icab') != -1) {this.isICab=true; this.name = "Icab"};
		if(ua.indexOf('camino') != -1) {this.isCamino=true; this.name = "Camino"};
   		
   		this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
   		this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
		
   		this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
   		this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
   	
		this.versionMinor = parseFloat(navigator.appVersion); 
   	  
   		if (this.isGecko && !this.isMozilla) {
			if(this.isFirefox) {
				this.versionMinor = parseFloat(ua.substring(ua.indexOf('firefox/')+8,ua.length));
			} else {
				this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
			}
   		}
   		else if (this.isMozilla) this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
	   	else if (this.isIE && this.versionMinor >= 4) this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
		else if(this.isSafari) this.versionMinor = parseFloat( ua.substring( ua.indexOf('safari/') + 7) );
		else if(this.isOmniweb) this.versionMinor = parseFloat(ua.substring( ua.indexOf('omniweb/v') + 9));
		else if(this.isOpera && !this.isMac) this.versionMinor = parseFloat(ua.substring( ua.indexOf('opera') + 6));
   		this.versionMajor = parseInt(this.versionMinor); 
   		
		this.isDOM = (document.getElementById && document.createElement?true:false);
   		this.isDOM1 = (document.getElementById?true:false);
  		this.isDOM2Event = (document.addEventListener && document.removeEventListener?true:false);
		
		this.isDHTML = (document.getElementById || document.all || document.layers?true:false);
   		
   		this.mode = document.compatMode ? document.compatMode : 'BackCompat';
   		
		if(ua.indexOf('win') != -1) {this.isWin=true; this.platform="win"}
		if(this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1)){this.isWin32=true; this.platform = "win32"}
		if(ua.indexOf('mac') != -1){this.isMac=true; this.platform = "mac"}
		if(ua.indexOf('x11') != -1){this.isMac=true; this.platform = "unix"}
		if(ua.indexOf('linux') != -1){this.isMac=true; this.platform = "linux"}
   		
   		this.isNS6x = (this.isNS && this.versionMajor == 6);
   		this.isNS6up = (this.isNS && this.versionMajor >= 6);
   		this.isNS7x = (this.isNS && this.versionMajor == 7);
   		this.isNS7up = (this.isNS && this.versionMajor >= 7);
   		this.isIE5x = (this.isIE && this.versionMajor == 5);
   		this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   		this.isIE5up = (this.isIE && this.versionMajor >= 5);
   		this.isIE6x = (this.isIE && this.versionMajor == 6);
   		this.isIE6up = (this.isIE && this.versionMajor >= 6);
	};
	
	
	_page.stylesheetArray = [];
	
	_page.stylesheet = function(css) {
		this.id = "p-style-injection-"+_page.stylesheetArray.length;
		this.css = css;
		this.index = _page.stylesheetArray.length;
		_page.stylesheetArray[_page.stylesheetArray.length] = this;
	}

	_page.stylesheet.prototype = {
		add:function(css) {
			if(css) this.css = css;
			if(document.createStyleSheet){
				if(!this.ref) this.ref = document.createStyleSheet();
				this.ref.cssText = this.css;
				this.ref.title = this.id;
			} else {
				this.ref = document.createElement('link');
				this.ref.id = this.id;
				this.ref.rel = "stylesheet";
				this.ref.type = "text/css";
				this.ref.title = this.id;
				this.ref.href = "data:text/css,"+escape(this.css);
				document.getElementsByTagName("head")[0].appendChild(this.ref);
				this.ref.disabled = false; 
			}
		},
		update:function(css) {
			if(document.createStyleSheet){
				this.remove();
				this.add(css);
			} else {			
				this.ref.id = this.ref.id+"_remove";
				this.add(css);
				setTimeout("new function(){_page.stylesheetArray["+this.index+"].remove('"+this.id+"_remove')}",1000);
			}
		},
		remove:function(id) {
			if(document.createStyleSheet){
				var intSSRules = this.ref.rules.length;
				while(intSSRules--) 
					this.ref.removeRule(intSSRules);						
			} else {				
				var obj = (id?gE(id):this.ref);
				if(obj) obj.parentNode.removeChild(obj);	
			}	
		}
	};

	

_page.locale = Get_Cookie("rc2CountryFlagSelection");

_page.direction="ltr";
_page.rc2locales["en_US"]="http://www.usa.learningcurve.com/index.html";
_page.rc2locales["en_CA"]="http://www.learningcurve.co.ca/index.html";
_page.rc2locales["na_CN"]="http://www.learningcurve.cn/index.php";
_page.rc2locales["de_DE"]="http://www.learningcurve.de/index.html";
_page.rc2locales["fr_FR"]="http://www.learningcurve.fr/index.html";
_page.rc2locales["en_GB"]="http://www.learningcurve.co.uk/index.html";
_page.rc2locales["en_AU"]="http://www.learningcurve.com/wps/portal/global?locale=en_AU";






_page.rc2message["alert1"]="You are already using this country/language combination!";
_page.rc2message["alert2"]="Please choose a country/language combination.";
_page.rc2message["confirmation1"]="Do you want to save this country/language as your default setting? If so, click OK. If not, click Cancel.";
_page.rc2message["confirmation2"]="This page is not available in your current language, but only in {LANGUAGE}. Do you want to switch to this page?";
	