// JavaScript Document
var counter;
counter=0;
var RefreshRate;
var RunFor;
var PageStr;
var start_change;
function LoadALlPages()
{	
	var WCH = new WCH_Constructor();
	DivPageList=PageStr.split(" * ");
	
	if (counter==0)
	{
		DivPageName=DivPageList[counter].split("|");
		URLStr=DivPageName[1].split("?");
		getval("POST",URLStr[0],DivPageName[0],"","Loading Page...","&" + URLStr[1]);
		counter=counter+1;	
	//	if (DivPageList.length!=1)
		//	t = setTimeout('LoadALlPages()', RefreshRate);
	}
	if ((counter>0) && (xmlHttp.readyState==4))
	{
		start_change=true;
		DivPageName=DivPageList[counter].split("|");
		URLStr=DivPageName[1].split("?");
		getval("POST",URLStr[0],DivPageName[0],"","Loading Page...","&" + URLStr[1]);
		counter=counter+1;	
	//	if (RunFor!=counter)
		//	t = setTimeout('LoadALlPages()', RefreshRate);
		
	}
	else
	{
		document.getElementById("result_section").innerHTML="<div align='center'> <span class='LoadingText' > <strong>" +  g_loadText + "</strong></span></div>";
		if (g_loadText=="Data Vadidation Process ...")
			width_size=250;
		else
			width_size=135;
		
		toggleBox("result_section",1,width_size,22);
		WCH.Apply("result_section","",true);
	}
}
function CloseMe()
{
	toggleBox("result_section",0,0,0);
	WCH.Discard("result_section","");
	
	
}
function ReadyToMove(SetRefreshRate,SetRunFor,SetPageStr)
{
	counter=0;
	RefreshRate=SetRefreshRate;
	RunFor=SetRunFor;
	PageStr=SetPageStr;
	
	LoadALlPages();
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function LoadMultipleUser()
{
	getID="";
	loop_end=document.suSearch.total_check.value;
	count=0;
	for (i=1;i<loop_end;i++)
	{
		getObj=eval("document.suSearch.chk_" + i);
		if (getObj.checked)
		{
			getID=getID + getObj.value + "-";
		}
		getObj=null;
	}
	if (getID=="")
	{
		alert("Select atleast one alumni.");
	}
	else
	{
		MM_openBrWindow('alumni_detail.php?ids=' + getID,'PopuImage','scrollbars=yes,resizable=yes,width=750,height=550')
//		getval("POST","alumni_detail.php","main_section","","Loading Page...","&ids=" + getID);
	}
	
}
function CheckCount(getID)
{
	loop_end=document.suSearch.total_check.value;
	count=0;
	for (i=1;i<loop_end;i++)
	{
		getObj=eval("document.suSearch.chk_" + i);
		if (getObj.checked)
			count=count+1;
		
		getObj=null;
	}
	if (count>10)
	{
		alert("Only 10 Alumni informaton can be viewed at a time");
		getObj=eval("document.suSearch.chk_" + getID);
		getObj.checked=false;
		getObj=null;
	}

}

function ReloadMe()
{
	
	document.getElementById('captcha').src = 'captcha/CaptchaSecurityImages.php?width=100&height=40&characters=5&' + Math.round(Math.random()*100000) ; 	


}
function Enable_Disable_Child()
{
	value=document.suForm.cmb_child.options[document.suForm.cmb_child.selectedIndex].value;
	if ( (value=="Yes") )
		document.suForm.txt_child_number.disabled=false;
	else
		document.suForm.txt_child_number.disabled=true;
	
}
function Enable_Disable_Spouse()
{
	value=document.suForm.cmb_accompanied.options[document.suForm.cmb_accompanied.selectedIndex].value;
	if ( (value=="0") || (value=="None") )
	{
		document.suForm.txt_s_name.disabled=true;
		document.suForm.cmb_yes_no.disabled=true;
		document.suForm.cmb_s_year.disabled=true;
		document.suForm.cmb_s_program.disabled=true;	
		
		
		document.suForm.txt_s_name.value="";
		document.suForm.cmb_yes_no.selectedIndex=0;
		document.suForm.cmb_s_year.selectedIndex=0;
		document.suForm.cmb_s_program.selectedIndex=0;
	}
	else
	{
		document.suForm.txt_s_name.disabled=false;
		document.suForm.cmb_yes_no.disabled=false;
		document.suForm.cmb_s_year.disabled=false;
		document.suForm.cmb_s_program.disabled=false;					
	}
	Enable_Disable_LUMS();
}

function Enable_Disable_LUMS()
{
	value=document.suForm.cmb_yes_no.options[document.suForm.cmb_yes_no.selectedIndex].value;
	if (value=="Yes")
	{
		document.suForm.cmb_s_year.disabled=false;
		document.suForm.cmb_s_program.disabled=false;
	}
	else
	{
		document.suForm.cmb_s_year.disabled=true;
		document.suForm.cmb_s_program.disabled=true;
	}
}