<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/////////*****************************************************
function checkEmail()
	{
	var strEmail, strError, countAtRate, countDot, i;
	var checkAtRate, checkDot;
	var ValidChars,CountValidChars;
	ValidChars="abcdefghijklmnopqrstuvwxyz0123456789_.@ABCDEFGHIJKLMNOPQRSTUVWXYZ-";
	strEmail = checkEmail.arguments[0];
	countAtRate=0;
	countDot=0;
	CountValidChars=0;
	if (strEmail.length >= 7)
		{
		for(i=0;i<strEmail.length;i++)
			{
			if(strEmail.charAt(i)=="@")
				countAtRate++;
			if(strEmail.charAt(i)==".")
				countDot++;
			CountValidChars=0;
			for(j=0;j<ValidChars.length;j++)
				{
				if(strEmail.charAt(i)==ValidChars.charAt(j))
					{
					CountValidChars++;
					}
				}
			if(CountValidChars==0)
				{
				strError=0;
				break;
				}
			}
		}
	checkAtRate=strEmail.indexOf("@",1);
	checkDot=strEmail.indexOf(".",1);
	for(i=1;i<countDot;i++)
		checkDot=strEmail.indexOf(".",checkDot+1);
	if(countAtRate==1 && countDot > 0 && strEmail.length >=7 && strError != 0)
		strError=1;
	else
		strError=0;
	if(checkDot>=strEmail.length-2)
		strError=0;
	if(strEmail.charAt(0)=="@" || strEmail.charAt(strEmail.length-1)=="@")
		strError=0;
	if(strEmail.charAt(0)=="." || strEmail.charAt(strEmail.length-1)==".")
		strError=0;
	if(checkDot < checkAtRate)
		strError=0;

	return strError;
}
////*****************************************************
var StrInitialMsg="Alert !!! Check the following fields\n---------------------------------------------------"
var StrVal="";
////*****************************************************

//To Check Space on text box
function chkSpace(txtfield){
	var i,j,txtval;
	j=0;
		txtfield=eval(txtfield)
		txtval=txtfield.value;
		for(i=0;i<txtval.length;i++){
			j++
		    if(txtval.substr(i,1)!=" ")
	    	break;
	    }

		txtval=txtval.substr(j-1,txtval.length);
		if(txtval==" ")
			txtval="";
			txtfield.value=txtval;
			return(txtval);
}

////*****************************************************
function postdata(value_leene)
 {
	document.frm.method="post";
	document.frm.action=value_leene;
	document.frm.submit();
 }
////*****************************************************
function pledge_form(pledge_form)
{
	var strError="";

	if((chkSpace(document.frm.txtname)=="") || (document.frm.txtname.value.length<5))
		strError=strError+"\nEnter Valid Name";

	if((chkSpace(document.frm.txtemail)=="") || checkEmail(document.frm.txtemail.value) == 0)
		strError=strError+"\nEnter Valid Email";

	if(document.frm.chk1.checked==false && document.frm.chk2.checked==false && document.frm.chk3.checked==false)
		strError=strError+"\nSelect Any One Contribution Categoy";
		
	if((chkSpace(document.frm.txtamt)=="") || isNaN(document.frm.txtamt.value))
		strError=strError+"\nEnter Pledge Amount";

	if(chkSpace(document.frm.txtCur)=="")
		strError=strError+"\nEnter Currency";

	if(strError!="")
	alert(StrInitialMsg + strError);
	else
		{
		 document.frm.method="post";
		 document.frm.action=pledge_form;
		 document.frm.submit();
		}
	
}
////*****************************************************

function contact(contact)
{
	var strError="";

	if(chkSpace(document.frm_contactus.txtname)=="")
		strError=strError+"\nEnter Valid Name";

	if((chkSpace(document.frm_contactus.txtemail)=="") || checkEmail(document.frm_contactus.txtemail.value) == 0)
		strError=strError+"\nEnter Valid Email";

	if(chkSpace(document.frm_contactus.txtsub)=="") 
		strError=strError+"\nEnter Subject";

	if(strError!="")
	alert(StrInitialMsg + strError);
	else
		{
		 document.frm_contactus.method="post";
		 document.frm_contactus.action=contact;
		 document.frm_contactus.submit();
		}
	
}

////*****************************************************

function checkEnter()
{
 if(event.keyCode==13)
	{
	dologin('check_login.asp');
	}
}

 function dologin()
	{
	var strError="";
	var StrInitialMsg="Alert !!! Check the following fields\n---------------------------------------------------";
	var err_focus="";
		if(document.frm.user_name.value=="")
		  {
	 	 	strError=strError+"\nUser Name";
	 	 	err_focus="u"
 	 	  }
 	 	if(document.frm.pass_word.value=="")
	 	  {
	 	  strError=strError+"\nPassword";
	 	   if (err_focus!="u")
	 	   		err_focus="p"
		  }
	  	if(strError!=""){
	  	alert(StrInitialMsg + strError);

		if (err_focus=="p")
		 	document.frm.pass_word.focus();
		else
		 	document.frm.user_name.focus();

		}
	  	else
	  		{
	  		 document.frm.method="post";
	  		 document.frm.action=dologin.arguments[0];
	  		 document.frm.submit();
			 return true;
	  		}

	}

////*****************************************************

function forgot()
{
 if(event.keyCode==13)
	{
	doforgot('save_forgotpassword.asp');
	}
}

 function doforgot()
	{
	 document.frm.method="post";
	 document.frm.action=doforgot.arguments[0];
	 document.frm.submit();
	 return true;
	}
////*****************************************************

function student_marks(student_marks)
{
	var strError="";

	if(document.frm.ac_year.options[document.frm.ac_year.selectedIndex].value=="")
		strError=strError+"\nSelect Academic Year";

	if(strError!="")
	alert(StrInitialMsg + strError);
	else
		{
		 document.frm.method="post";
		 document.frm.action=student_marks;
		 document.frm.submit();
		}
	
}

 // ***************************for add/edit sponsor**************************
function edit_sponsor(sponsor)
{
	var strError="";

	if((chkSpace(document.frm.txtname)=="") || (document.frm.txtname.value.length<5))
		strError=strError+"\nEnter Valid Name";

	if((chkSpace(document.frm.txtemail)=="") || checkEmail(document.frm.txtemail.value) == 0)
		strError=strError+"\nEnter Valid Email";

	if(strError!="")
	alert(StrInitialMsg + strError);
	else
		{
		 document.frm.method="post";
		 document.frm.action=sponsor;
		 document.frm.submit();
		}
	
}

function change_pass(change_pass)
{
	var strError="";

	if(chkSpace(document.frm.txtOPass)=="")
		strError=strError+"\nEnter Old Password";

	if(chkSpace(document.frm.txtNPass)=="")
		strError=strError+"\nEnter New Password";

	if(chkSpace(document.frm.txtCPass)=="")
		strError=strError+"\nEnter Confirm Password";

	if (chkSpace(document.frm.txtNPass)!=chkSpace(document.frm.txtCPass))
		strError=strError+"\nEnter Same Password";
		
	if(strError!="")
	alert(StrInitialMsg + strError);
	else
		{
		 document.frm.method="post";
		 document.frm.action=change_pass;
		 document.frm.submit();
		}
	
}

function PopUp(val)
{
	window.open(val,"prvwo","width=650,height=400,scrollbars=yes,resizable=yes,status=0,top=0,left=0");
}

//-->
//************ add user
