// JavaScript Document
function match_mails()
	{
		if(document.form1.email2.value!="")
			{
				var mail=document.form1.email2.value; var mailchar="@"; var mailchar1=".";
				var fals=0; var fals1=0; for(var i=0;i<mail.length;i++) {  if( mailchar.indexOf(mail.substr(i,1))!=(-1)) {
				fals=1; }  if( mailchar1.indexOf(mail.substr(i,1))!=(-1)) { fals1=1; } }
				if((fals==1)&&(fals1==1)) { /*return true;*/ } else { alert("Enter a valid Email ID"); return false; }
			}	
		if(document.form1.email.value!=document.form1.email2.value)
			{
				alert("Confirmation email does'nt match");
				return false;
			}
	}
function checkmail()
	{
		if(document.form1.email.value!="")
			{
				var mail=document.form1.email.value; var mailchar="@"; var mailchar1=".";
				var fals=0; var fals1=0; for(var i=0;i<mail.length;i++) {  if( mailchar.indexOf(mail.substr(i,1))!=(-1)) {
				fals=1; }  if( mailchar1.indexOf(mail.substr(i,1))!=(-1)) { fals1=1; } }
				if((fals==1)&&(fals1==1)) { /*return true;*/ } else { alert("Enter a valid Email ID"); return false; }
			}	
	}	
function checklen()
	{
		if(document.form1.password.value.length<6 || document.form1.password.value.length>60)
			{
				alert("password length must be within 6 to 60 charecter");
			}
	}	
function conf_password()
	{
		if(document.form1.password.value!=document.form1.confirm_password.value)
		{ 
			alert("confirmation password does'nt match !"); 
			return false;
		}
	}	
//this is function is also called from manage directory so the check is here. if the flag is 1 it is called from manage directory else from outside	
function checkprofile(flg)
	{
		//checkavailable.php
		tr=document.form1.memprofile.value;
		if(flg==1){ window.open('../checkprofile.php?pr='+tr,'check','width=400,height=200,top=300,left=600'); }
		else { window.open('checkprofile.php?pr='+tr,'check','width=400,height=200,top=300,left=600'); }
	}
function checkme1()
	{	
		if(document.form1.email.value=="") { alert("Please provide email address!"); document.form1.email.focus(); return false; }
		if(document.form1.email2.value=="") { alert("Please provide email2 address!"); document.form1.email2.focus(); return false; }
		if(document.form1.password.value==""){ alert("Please provide password!"); document.form1.password.focus(); return false; }
		if(document.form1.confirm_password.value=="") { alert("Please provide confirmation password!"); document.form1.confirm_password.focus(); return false; }
		if(document.form1.first_name.value=="") { alert("Please provide your first name!"); document.form1.first_name.focus(); return false; }
		if(document.form1.last_name.value==""){alert("Please provide your last name!");document.form1.last_name.focus();return false;	}
		if(document.form1.dc1.value==""){alert("Please Select Your Date Of Birth!");document.form1.dc1.focus();return false;}
		if(document.form1.add1.value==""){ alert("Please provide your address!"); document.form1.add1.focus(); return false;}	
		if(document.form1.country_id.value=="India")
		{			
		if(document.form1.msia_state_id.value=="" || document.form1.msia_state_id.value=="---Select a state---"){ alert("Please choose State!"); document.form1.msia_state_id.focus(); return false;}			
		}
		if(document.form1.course.value==""){ alert("Please choose any Course!"); document.form1.course.focus(); return false;}			
		//if(document.form1.college_name1.value=="") { alert("Please Specify your university");document.form1.college_name1.focus();return false; }
		if(document.form1.file.value==""){ alert("Please attach picture!"); document.form1.file.focus(); return false;}	
	}	
var India = new Array();
India[0] = "---Select a state---";
India[1] = "Andaman & Nicobar";
India[2] = "Andhra Pradesh";
India[3] = "Assam";
India[4] = "Arunachal Pradesh";
India[5] = "Bihar";
India[6] = "Chandigarh";
India[7] = "Chhattisgarh";
India[8] = "Daman & Diu";
India[9] = "Delhi";
India[10] = "Dadra & Nagar Haveli";
India[11] = "Goa";
India[12] = "Gujarat";
India[13] = "Haryana";
India[14] = "Himachal Pradesh";
India[15] = "Jammu & Kashmir";
India[16] = "Jharkhand";
India[17] = "Karnataka";
India[18] = "Kerala";
India[19] = "Lakshadweep";
India[20] = "Maharashtra";
India[21] = "Meghalaya";
India[22] = "Mizoram";
India[23] = "Manipur";
India[24] = "Madhya Pradesh";
India[25] = "Nagaland";
India[26] = "Orissa";
India[27] = "Pondicherry";
India[28] = "Punjab";
India[29] = "Rajasthan";
India[30] = "Sikkim";
India[31] = "Tamil Nadu";
India[32] = "Tripura";
India[33] = "Uttaranchal";
India[34] = "Uttar Pradesh";
India[35] = "West Bengal";

function showstate()
	{
		i=0;
		sindex=document.form1.country_id.value;
				document.form1.msia_state_id.length=1;
		//alert(sindex);
		if(sindex=="India" )
			{ 
				document.form1.msia_state_id.style.disabled = 'false';
				//document.form1.state.style.visibility = 'hidden'; 
				for(j=0;j<=35;j++)
					{
						document.form1.msia_state_id.length=i+1;
						document.form1.msia_state_id.options[i].text=India[j];
						document.form1.msia_state_id.options[i].value=India[j];					
						i=i+1;
					}
			}
		else
			{
				document.form1.msia_state_id.style.disabled = 'true';
				//document.form1.state.style.visibility = 'visible';    
			}
	}	
function stud_field()
	{
		document.form1.field_id1.disabled=false;
	}	

