function DoSaveCat(cat){
//alert("ok7");
	var totalCredCat="";
	if(cat=="AQTUpdt")
		totalCredCat="totalCat1Credits";
	else
		totalCredCat="total"+cat+"Credits";
	var totalCred=document.getElementById(totalCredCat).innerHTML;
	var param = "list=S|"+GetValue("cid")+"|"+escape(GetInnerHTML("AppPrint"))+"|"+totalCred+"|";
	if(confirm("All changes will be saved. Continue?")){
		switch(cat)
		{
			case "Cat1":
				getResponseWithScript('myContent',param,'LoadingPanel','Forms/ContinueEducation.aspx');
			break;
			case "Cat2":
				getResponseWithScript('myContent',param,'LoadingPanel','Forms/HigherEducation.aspx');
			break;	
			case "Cat3":
				getResponseWithScript('myContent',param,'LoadingPanel','Forms/IndustryContribution.aspx');
			break;	
			case "Cat4":
				getResponseWithScript('myContent',param,'LoadingPanel','Forms/IndustryExperience.aspx');
			break;	
			case "Cat5":
				getResponseWithScript('myContent',param,'LoadingPanel','Forms/NAContinueEducation.aspx');
			break;
			case "Cat6":
				getResponseWithScript('myContent',param,'LoadingPanel','Forms/Awards.aspx');
			break;	
			case "Biogr":
				getResponseWithScript('myContent',param,'LoadingPanel','Forms/Biography.aspx');
			break;	
			case "AQTUpdt":
				param = "list=A|"+GetValue("cid")+"|"+escape(GetInnerHTML("AppPrint"))+"|"+totalCred+"|";
				getResponseWithScript('myContent',param,'LoadingPanel','Forms/ContinueEducation.aspx');
			break;																														
		}
	}
}

function DoSaveBiog(cat){

	var param = "list=S|"+GetValue("cid")+"|"+escape(GetInnerHTML("AppPrint"))+"|";
	if(confirm("All changes will be saved. Continue?")){
		switch(cat)
		{
			case "Biogr":
				getResponseWithScript('myContent',param,'LoadingPanel','Forms/Biography.aspx');
			break;														
		}
	}
}





var imgPath='/jo/images/';
function DoCheck(e)
{
	if(e.src.indexOf('chck_off.gif')>=0)
	{
		e.src=imgPath+'chck_on.gif';
	}
	else
	{
		e.src=imgPath+'chck_off.gif';
	}
}
/*function DoCheck(e)
{
	if(e.src.indexOf('chck_off.gif')>=0)
	{
		e.src=imgPath+'chck_on.gif';
	}
	else
	{
		e.src=imgPath+'chck_off.gif';
	}
}*/
	function DoPrint2()
	{
		var headID = EmpPrint.document.getElementsByTagName("head")[0];
		var cssNode = EmpPrint.document.createElement('link');
		cssNode.type = 'text/css';
		cssNode.rel = 'stylesheet';
		cssNode.href = '/webs/css/86/style.css';
		headID.appendChild(cssNode);

		EmpPrint.document.body.innerHTML=document.getElementById('AppPrint').innerHTML;
		EmpPrint.document.execCommand('print');
}

function DoSelectedChanged()
{

	var ddb = document.getElementById("CountryId_value");
	getResponseWithScript('State','cid='+ddb.value+'|','LoadingPanel2','/adminmodulescompany/user/StateDDB.aspx')

}

function ChangeContent(id)
{
	switch(id){
		case 41882:
			DoLinks('632');
		break;
		case 45726:
			DoLinks('415');
			break;
		default:	
			DoLinks('415');
		break;
	}	
}

function DoLogout(){

		var param = "list=O|Out";
		getResponseWithScript('myContent',param,'LoadingPanel','content.aspx');	

}
function DoRedirect(){
	
	document.location.href='/webs/arda/training.aspx';

}
function DoRedirectForm2(){
	
	document.location.href='/webs/arda/training.aspx?fid=2';

}
function DoRedirect2(){
	
	document.location.href='/webs/arda/default.aspx';

}
function DoRedirect3(){
	getResponseWithScript('myContent','list=C|414','LoadingPanel','content.aspx');
		
	var strURL = "http://www.arda.org/AM/Template.cfm?Section=About_the_Foundation1";
	window.open(strURL, "NewDocWindow", "toolbar=1,location=1, menubar=1, scrollbars=1, resizable=1"); 	

	
	//document.location.href='http://www.arda.org/AM/Template.cfm?Section=About_the_Foundation1';

}
function DoRedirect4(){
	
	//alert("All data has been stored. Please activate your account from the link, provided in a confirmation email. Then use login box to login to your account. Thanks for your time."); 
	getResponseWithScript('myContent','list=C|414','LoadingPanel','content.aspx');
}

function DoRedirect5(){
	
	//alert("All data has been stored. Please activate your account from the link, provided in a confirmation email. Then use login box to login to your account. Thanks for your time."); 
	getResponseWithScript('myContent','list=C|416','LoadingPanel','content.aspx');
}


function OnClientItemClickingHandler(sender, e)
{
	if(e.Item.Value!="0"){
		switch(e.Item.GetAttribute("ItemType")){
			case "MA":
				var param = 'list=D|'+e.Item.Value;
				getResponseWithScript('myContent',param,'LoadingPanel','/webs/arda/forms/manage_Attendy.aspx');
			break;
			case "MC":
				var param = 'list=D|'+e.Item.Value;
				getResponseWithScript('myContent',param,'LoadingPanel','/webs/arda/forms/manage_company.aspx');			
			break;			
			default:
				var param = 'list=D|'+e.Item.Value;
				getResponseWithScript('myContent',param,'LoadingPanel','content.aspx');
			break;
		}
	}
}

function OnClientItemClickingHandlerARPRRP(sender, e)
{
	if(e.Item.Value!="0"){
		var param = 'list=ARP|'+e.Item.Value;
		alert(param);
		//getResponseWithScript('myContent',param,'LoadingPanel','content.aspx');
	}
}




//---------LINKS HANDLER-----------//
function DoLinks(i)
{
	var param="list=C|"+i;
	getResponseWithScript('myContent',param,'LoadingPanel','content.aspx');
}

//---------FORM HANDLER-----------//
function DoSeals()
{
  	var tb = document.getElementById("seals");
  	
	if (tb.style.display="")
	{
		tb.style.display="none";
	}
	else
	{
		tb.style.display="";
	}	

}


function DoStep(i)
{
	switch (i)
	{
		case 1:
			//alert("Following signup process is for Consumer Centric Selling Program only.");
			var param="list=0";
			//alert(document.location.href);
			getResponseWithScript('myContent',param,'LoadingPanel','forms/FormSignup1.aspx');	
			//alert('ok');
	
			if(document.location.href.indexOf("https")!=-1 && document.location.href.indexOf("/signup.aspx")!=-1)
				document.location.href=(document.location.href);//+'/forms/FormSignup1.aspx'
			else
				document.location.href=(document.location.href).replace('http','https').replace('/default.aspx','').replace('/training.aspx','')+'/signup.aspx';//+'/forms/FormSignup1.aspx'
			//DoSeals();	
			break;		
		case 2:
			var param="list=1";
			getResponseWithScript('myContent',param,'LoadingPanel','forms/FormSignup2.aspx');
			break;			
	}

}



//-----------ARDA LOGIN-------------//

function DoNavMenu(){
	var param = "list=C|"+GetPageId();
	getResponseWithScript('content',param,'LoadingPanel','content.aspx')	
}	

function GetPageId(){


}
function DoLogin(){
	if(checkString3(document.getElementById("UserName"),"USER NAME", false)
		&& checkString(document.getElementById("Password"),"PASSWORD", false))
	{
		var param = "list=L|"+GetLoginInfo();
		getResponseWithScript('myContent',param,'LoadingPanel','content.aspx');	
	}


}
function GetLoginInfo(){
	var s=document.getElementById("UserName").value+"|";
		s+=document.getElementById("Password").value+"|";
	return s;
}

function SetLoginMsg(msg){
	
	var s = "SetMsg('"+msg+"');";
	window.setTimeout(s,100);
}
function SetMsg(msg){

	document.getElementById("loginMsg").innerHTML=msg;

}

