/* Component for sign up process */
function funFormLoad(type,schid)
{
	//document.getElementById("SignupForm").innerHTML='<span class="loading">Loading...</span>';
	var url="mem_signup_form.php?type="+type+"&schid="+schid;
	ajaxrequest(url,"displayAppList",document.getElementById("SignupForm"),0);
}
function funcEvents(type,check)
{
		
	var schoolId=document.getElementById('sesSchool');	
	var url="mem_school_events.php?type="+type+"&schoolId="+schoolId.value+'&check='+check;
	document.frmSignup.sesEvent.options.length = 0; 
	ajaxrequest(url,"displayDiv",document.getElementById('sesEvent'),0);

}

function displayDiv(txt,obj)
{
	var aEventDetails=txt.split("##");
	var vCnt=aEventDetails.length
	if(vCnt > 1)
	{
		for(i=0;i<aEventDetails.length;i++)
		{
			var aEvent=aEventDetails[i].split("||")
			var anOption = document.createElement("OPTION")
			anOption.value = aEvent[1]
			anOption.text = aEvent[0]
			obj.options.add(anOption)
		}
	}
	else
	{
		var aEvent=txt.split("||")
		var anOption = document.createElement("OPTION")
		anOption.value = aEvent[1]
		anOption.text = aEvent[0]	
		obj.options.add(anOption)
	}
	
}

function displayAppList(txt,obj)
{
	obj.innerHTML=txt;
	buttonizeall(document.body);
}
//* Not allow the space character */
function funNotAllowSpace(e)
{	
	var unicode=e.charCode? e.charCode : e.keyCode
	if(unicode==32)
	{ //if the key isn't the backspace key (which we should allow)
		return false //disable key press
	}
}
function funSchooAddition(id)
{
	document.frmSignup.hidTSchoolId.value=id;
	setTimeout('nopopup()',1000);
}
function addPopup(e,edate,color,type)
{	
	var url="mem_school.php?MemType="+type;
	captionierpopup( {event:e, width:350, url:url, data:'curdate='+edate+'&rnd='+Math.random(),color:color } );
}
function funDelay(pmRedirectURL)
{
	//alert(pmRedirectURL);
	window.setTimeout('window.location="' + pmRedirectURL + '"',3000);
}
function redirect(pmUrl)
{
	window.location.href=pmUrl;
}