var FILESITE="http://fs.lifeplat.com";
var subMenuDelay;
var subMenuACCDelay;
var subMenuACC=true; //allow Click Close
var fcpControl=true;
var addthis_config = {
     ui_cobrand: "LIFEPLAT"
}

// start --- Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-16748782-1']);
_gaq.push(['_setDomainName', '.lifeplat.com']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
// end --- Google Analytics

function fcpGeneralRA(rText) {
	document.getElementById('fcpContentDiv').innerHTML=rText;
}
function signUp(title) {
	loadMask(800,450,title);
	dynamicJsCssLoader("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js","js",function() {
		signUp_fn_ck();
	});	
}
function signUp_fn_ck() {	
	dynamicJsCssLoader('/members/js/select_account.js','js',function() {
		$("#maskContentDiv").load("/members/select_account.php");
	});
}
function signIn() {
	loadMask(600,400);
	dynamicJsCssLoader("/si/js/si.js?0628v1","js");
	dynamicJsCssLoader("/si/css/si.css","css");
	startRequest("/si/si.php","","maskGeneralRA(xmlhttp.responseText)");
}
function signOutRA(rText) { //response action
	top.window.location=rText;
}
function toggleLanguageSelect() {
	if (document.getElementById('languageChangeDiv').style.display=="none") {
		document.getElementById('footerContentDiv').style.display="none";
		document.getElementById('languageChangeDiv').style.display="block";
	} else {
		document.getElementById('footerContentDiv').style.display="block";
		document.getElementById('languageChangeDiv').style.display="none";
	}
}
function changeLS(lang) {
	startRequest("/lang/change.php","language="+lang,"changeLSRA(xmlhttp.responseText)");
}
function changeLSRA(rText) {
	window.location.reload();
}
function toggleSubMenu() {
	if (document.getElementById('subMenuDiv').style.display=="none") {
		document.getElementById('subMenuDiv').style.display="block";
		if (document.getElementById('iDirectSiDiv')) document.getElementById('iDirectSiDiv').style.display="none";
	} else if (subMenuACC==true) {
		document.getElementById('subMenuDiv').style.display="none";
		if (document.getElementById('iDirectSiDiv')) document.getElementById('iDirectSiDiv').style.display="block";
	}
}
function subMenuOpen() {
	subMenuACC=false;
	clearTimeout(subMenuACCDelay);
	subMenuACCDelay=setTimeout("subMenuACC=true;",1000);
	clearTimeout(subMenuDelay);
	document.getElementById('subMenuDiv').style.display="block";
	if (document.getElementById('iDirectSiDiv')) document.getElementById('iDirectSiDiv').style.display="none";
}
function subMenuClose() {
	document.getElementById('subMenuDiv').style.display="none";
	if (document.getElementById('iDirectSiDiv')) document.getElementById('iDirectSiDiv').style.display="block";
}
function subMenuDelayClose() {
	subMenuDelay=setTimeout("subMenuClose();", 300);
}
function subMenuClearDelay() {
	clearTimeout(subMenuDelay);
}
function fcpShow() {
	if (fcpControl) {
		fcpControl=false;
		document.getElementById('fcptDiv').style.display="none";
		document.getElementById('fcpDiv').style.display="block";
		document.getElementById('fcpTitleDiv').innerHTML=document.getElementById('fcptTitleDiv').innerHTML;
		showLoading('fcpContentDiv');
		startRequest("/notes/fcpdirect.php","","fcpGeneralRA(xmlhttp.responseText);");
		fcpOpen(-78,-236,88,282,10,1);
	}
}
function fcpOpen(sX, sY, cX, cY, t, i) {
	document.getElementById('fcpDiv').style.right=sX+Math.round(cX/t*i)+"px";
	document.getElementById('fcpDiv').style.bottom=sY+Math.round(cY/t*i)+"px";
	if (i<t) {
		setTimeout("fcpOpen("+sX+","+sY+","+cX+","+cY+","+t+","+(i+1)+")",30);
	} else {
		fcpControl=true;
	}
}
function fcpHide() {
	if (fcpControl) {
		fcpControl=false;
		fcpClose(-78,-236,88,282,10,9);
	}
}
function fcpClose(sX, sY, cX, cY, t, i) {
	document.getElementById('fcpDiv').style.right=sX+Math.round(cX/t*i)+"px";
	document.getElementById('fcpDiv').style.bottom=sY+Math.round(cY/t*i)+"px";
	if (i>0) {
		setTimeout("fcpClose("+sX+","+sY+","+cX+","+cY+","+t+","+(i-1)+")",30);
	} else {
		fcpControl=true;
		document.getElementById('fcptDiv').style.display="block";
		document.getElementById('fcpDiv').style.display="none";
		document.getElementById('fcpTitleDiv').innerHTML="";
		document.getElementById('fcpContentDiv').innerHTML="";
	}
}