//---------------------------------Script for DATE check() function-------------------------------------

/**
 * DHTML date validation script for dd/mm/yyyy. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2009;
mydate=new Date();
//var maxYear=mydate.getYear();

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr)
{
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strDay=dtStr.substring(0,pos1)
	var strMonth=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : dd/mm/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}


//---------------------------------Script for check() function-------------------------------------------------
function check1()
{
 //To check whether Text_box are not empty  
 var sname = document.exam.sname.value;
 var fname = document.exam.fname.value; 
 var mname = document.exam.mname.value;
 var dob = document.exam.dob.value;
 var gender=document.exam.gender.value ;

 var address=document.exam.address.value;
 var city=document.exam.city.value;
 var state = document.exam.state.value;
 var pin = document.exam.pin.value;
 var phone = document.exam.phone.value;
 var mobile = document.exam.mobile.value;
 var email = document.exam.email.value;

var categary = document.exam.categary.value;
var phyhandicap = document.exam.phyhandi.value;
var noncreamy = document.exam.noncreamy.value;
var typeofdisability = document.exam.typeofdisability.value;

var Entracenter = document.exam.Entracenter.value;

var nameofexam = document.exam.nameofexam.value;
var status = document.exam.status1.value;
var uniboard = document.exam.uniboard.value;
var PassMonth = document.exam.MM3.value;
var PassYear = document.exam.YY3.value;
var aggmarks = document.exam.aggmarks.value;
var permarks = document.exam.permarks.value;

var ddamount = document.exam.ddamount.value;
var ddno = document.exam.ddno.value;
var dddate = document.exam.dddate.value;
var bnknm = document.exam.bnknm.value;
var branchnm = document.exam.branchnm.value;

var hscsub = document.exam.hscsub.value;
var fysub = document.exam.fysub.value;
var sysub = document.exam.sysub.value;
var tysub = document.exam.tysub.value;

var hscmark = document.exam.hscmark.value;
var fymark = document.exam.fymark.value;
var symark = document.exam.symark.value;
var tymark = document.exam.tymark.value;

var hscoutof = document.exam.hscoutof.value;
var fyoutof = document.exam.fyoutof.value;
var syoutof = document.exam.syoutof.value;
var tyoutof = document.exam.tyoutof.value;

var hscpercentage = document.exam.hscpercentage.value;
var fypercentage = document.exam.fypercentage.value;
var sypercentage = document.exam.sypercentage.value;
var typercentage = document.exam.typercentage.value;
var domicile = document.exam.domicile.value;
var chk6 = document.exam.chk6.value;
var sscpercentage=document.exam.sscpercentage.value;




 var blankField = "";
//======================================For Surname=================================
  if(sname.length==0) 
 {
		alert("Please enter the SurName!");
		document.exam.sname.focus();
		return false;
 }
 

 else 
   {
   var myString=new String(sname);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.sname.value="";
        document.exam.sname.focus();
        return false;
        }
        } 
        //-------check only text validation----------  
  		var surname = document.getElementById('sname').value;
  		if (!surname.match(/^[a-zA-Z ]+$/)) 
    		{
   			 alert("you entered some weird characters in your Surname...");
    		document.exam.sname.focus();
    		return false;
    		}     
  }
 //==========================For First Name==========================
 if(fname.length==0) 
 {
	alert("Please enter the First Name!");
	document.exam.fname.focus();
	return false;

 }
 else 
   {
        var myString=new String(fname);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.fname.value="";
        document.exam.fname.focus();
        return false;
        }
        }
        //-------check only text validation----------
        var firstname = document.getElementById('fname').value;
  	 	if (!firstname.match(/^[a-zA-Z ]+$/)) 
    		{
   			 alert("you entered some weird characters in your First Name...");
    		document.exam.fname.focus();
    		return false;
    		}  
    }
    
//============================Middle name===========================
 if(document.exam.mname.value!="")
 {
 if(mname.length==0) 
 {
	alert("Please enter the Middle Name!");
	document.exam.mname.focus();
	return false;

 }
 else 
   {
        var myString=new String(mname);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.mname.value="";
        document.exam.mname.focus();
        return false;
        }
        }
        //-------check only text validation----------
        var middlename = document.getElementById('mname').value;
  	 	if (!middlename.match(/^[a-zA-Z ]+$/)) 
    		{
   			 alert("you entered some weird characters in your Middle Name...");
    		document.exam.mname.focus();
    		return false;
    		}  
    }
    
}
//--------------------------------For Date of Birth
  if(dob.length==0) 
 {
		alert("Please enter the Date of Birth!");
		document.exam.dob.focus();
		return false;

 }
 else 
   {
        var myString=new String(dob);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.dob.value="";
        document.exam.dob.focus();
        return false;
        }
        }
    }
if (isDate(dob)==false)
	{
		document.exam.dob.focus()
		return false;
	}

 //===========================For Gender
if(document.exam.gender.value =="Select")
{
alert("Select Gender!");
document.exam.gender.focus();
return false;
}

//===================================For Address
 if(address.length==0) 
 {
	alert("Please enter the Address information!");
	document.exam.address.focus();
	return false;
 }
 else 
   {
        var myString=new String(address);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.address.value="";
        document.exam.address.focus();
        return false;
        }
        }
    }

 //================================For City
 if(city.length==0)
 {
	alert("Please enter City information ! "+blankField);
	document.exam.city.focus();
	return false;
 }
 else 
   {
        var myString=new String(city);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.city.value="";
        document.exam.city.focus();
        return false;
        }
        }
	//-------check only text validation----------
        var cityname = document.getElementById('city').value;
  	 	if (!cityname.match(/^[a-zA-Z ]+$/)) 
    		{
   		alert("you entered some weird characters in your City Name...");
    		document.exam.city.focus();
    		return false;
    		}  
    }

 
 //====================================For State========================
if(document.exam.state.value=="Select")
{
alert("Select State !");
document.exam.state.focus();
return false;
}
 
//============================For Pin=================================
 if(pin.length==0)
 {
	alert("Please enter Pin information ! "+blankField);
	document.exam.pin.focus();
	return false;
 }
 else 
   {
        var myString=new String(pin);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.pin.value="";
        document.exam.pin.focus();
        return false;
        }
        } 
}
 if(isNaN(pin))
	 {
		 alert("Enter Numaric values for pincode!");
		 document.exam.pin.focus();
		 return false;
	 }
if(pin.length>6 || pin.length<6)
        {
	        alert("Enter 6 digit values for pincode!");
			document.exam.pin.focus();
			return false;
        }	 
  
 //------------------------------For Phone---------------------------

   
//-----------------------------For Mobile------------------------------------
if(mobile!="")
{
	if(isNaN(mobile))
	 {
		 alert("Enter Numaric values !");
		 document.exam.mobile.focus();
		 return false;
	 }	
}
  
 //------------------------------------------For Email 
if(document.exam.email.value != "")
 {
  var email = document.exam.email.value 
  var regexp=/[0-9,a-z,A-Z]+[0-9,a-z,A-Z,\.,\-,_]*@[0-9,a-z,A-Z]+[0-9,a-z,A-Z,\.,\-,_]*\.[0-9,a-z,A-Z]+[0-9,a-z,A-Z,\.,\-,_]*/g;
	var answerarray=email.match(regexp);
	if(answerarray==null)
	{
	alert("Please check your email address.");
	window.document.exam.email.focus();
	return false;	
	}
 }
  
  //==========================For Domicile
 if(document.exam.domicile.value=="Select")
{
alert("Select State of Domicile");
document.exam.domicile.focus();
return false;
}


  //=================For Categary==================================================
if(document.exam.categary.value=="Select")
{
alert("Select categary !");
document.exam.categary.focus();
return false;
}

//============================Other categary====================
if(document.exam.categary.value=="Other")
{
if(document.exam.typeofreservation.value=="")

	{
	alert("Specify Other Categary!...");
	document.exam.typeofreservation.focus();
	return false;
	}
}

//===============================For Non_Creamy====================================
if(document.exam.categary.value=="OBC")
{
if(document.exam.noncreamy.value=="Select")
{
alert("Select noncreamy option!");
document.exam.noncreamy.focus();
return false;
}
}

//==================for  Physically Handicapped====================================
if(document.exam.phyhandi.value=="Select")
{
alert("Select Physical Handicapped!");
document.exam.phyhandi.focus();
return false;
}


//======================For Type of Disability===============================
if(document.exam.phyhandi.value=="Yes")
{
if(typeofdisability.length==0) 
 {
		alert("Please enter Type of Disability information !");
		document.exam.typeofdisability.focus();
		return false;

 }
 else 
   {
        var myString=new String(typeofdisability);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.typeofdisability.value="";
        document.exam.typeofdisability.focus();
        return false;
        }
        }
    }
}


//-----------------------For Center for entracne test----------------------
 if(Entracenter.length==0) 
 {
	alert("Please enter the Center Name!");
	document.exam.Entracenter.focus();
	return false;
 }
 else 
   {
        var myString=new String(Entracenter);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.Entracenter.value="";
        document.exam.Entracenter.focus();
        return false;
        }
        }
    }

//------------------------------For Name of Exam------------------------
  if(nameofexam.length==0) 
 {
		alert("Please enter name of  exam !");
		document.exam.nameofexam.focus();
		return false;
 }
 else 
   {
        var myString=new String(nameofexam);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.nameofexam.value="";
        document.exam.nameofexam.focus();
        return false;
        }
        }
    }
    
    //=================================================For Status==================
if(document.exam.status1.value=="Select")
{
alert("Select Status!");
document.exam.status1.focus();
return false;
}
//=========================================For University-board=================================
  if(uniboard.length==0) 
 {
		alert("Please enter the University-board information !");
		document.exam.uniboard.focus();
		return false;
 }
 else 
   {
        var myString=new String(uniboard);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        	{
        	if(idx==0)
        		{
        		alert("Starting Spaces Not allowed");
        		document.exam.uniboard.value="";
        		document.exam.uniboard.focus();
        		return false;
        		}
        	}
      } 
//========================================================Passing Month & Year
if(document.exam.MM3.value=="-")
{
alert("Select Month of passing! ");
	document.exam.MM3.focus();
	return false;	
	} 
if(document.exam.YY3.value=="-")
{
	alert("Select Year of passing! ");
	document.exam.YY3.focus();
	return false;
}

      
//-------------------the aggregated Percentage of marks/CGPA Subject-------------------
if(document.exam.status1.value=="Passed")
{
var aggmarks=document.exam.aggmarks.value;

	if(aggmarks.length==0) 
		{
			alert("Please enter the aggregated Percentage of marks/CGPA Subject's information!");
			document.exam.aggmarks.disabled=false;
			document.exam.aggmarks.focus();
			return false;
 		}
 		else 
 		{
        	var myString=new String(aggmarks);
        	var myRegExp = / /g;
        	var idx=myString.search(myRegExp);
        	if(idx!=-1)
        	{
        	if(idx==0)
       		{
        	alert("Starting Spaces Not allowed");
        	document.exam.aggmarks.value="";
        	document.exam.aggmarks.focus();
        	return false;
        	}
        	}
    	} 
    	          
        	if(aggmarks>=100)
	 		{
	 			alert("The aggregated Percentage of marks/CGPA  must be less than or equal to 100!");
				document.exam.aggmarks.focus();
				return false;
	 		}
     		if(isNaN(aggmarks))
	 		{
		 		alert("Enter Numaric values for aggregated pecentage of marks !");	
				document.exam.aggmarks.focus();	 		
		 		return false;
	 		} 
}
//------------------------the Percentage of marks/CGPA  Principal Subject---------------------------------- 
if (document.exam.status1.value=="Passed")

{
   	if(permarks.length==0) 
		{
			alert("Please enter the Percentage of marks/CGPA  Principal Subject's information!");
			document.exam.permarks.disabled=false;
			document.exam.permarks.focus();
			
			return false;
 		}
 		else 
 		{
        	var myString=new String(permarks);
        	var myRegExp = / /g;
        	var idx=myString.search(myRegExp);
        	if(idx!=-1)
        	{
        	if(idx==0)
       		{
        	alert("Starting Spaces Not allowed");
        	document.exam.permarks.disabled=false;
        	document.exam.permarks.value="";
        	document.exam.permarks.focus();
        	return false;
        	}
        	}
    	}       
   	
     	if(permarks>=100)
	 		{
	 			alert("The Percentage of marks/CGPA  Principal Subject must be less than or equal to 100!");
	 			document.exam.permarks.disabled=false;
				document.exam.permarks.focus();
				return false;
			}    	
		if(isNaN(permarks))
	 		{
			 alert("Enter Numaric values for pecentage of marks/CGPA in principal subject !");
			 document.exam.permarks.disabled=false;
			 document.exam.permarks.focus();
			 return false;
	 		}	
}

//
//==========================For State 10th
 if(document.exam.state10.value=="Select")
{
alert("Select State from which you have passed your 10th");
document.exam.state10.focus();
return false;
}

//==========================For State 12th
 if(document.exam.state12.value=="Select")
{
alert("Select State from which you have passed your 12th");
document.exam.state12.focus();
return false;
}

//================================S.S.C. %Percentage
 if(sscpercentage.length==0) 
 {
	alert("Please enter the S.S.C. / 10th Equivalent Percentage obtained information!");
	document.exam.sscpercentage.focus();
	return false;
 }
 else 
{
	 if(isNaN(sscpercentage))
	 {
		 alert("Enter Numaric values the S.S.C. Percentage !");
		 document.exam.sscpercentage.focus();
		 return false;
	 }
	if(sscpercentage>100)
	 {
	 	alert("The S.S.C./10th Equivalent Percentage Percentage must be less than or equal to 100!");
		document.exam.sscpercentage.focus();
		return false;
	 }
}	
  
//======================== H. S. C.  Details of qualifying Examination ==============================
  if(hscsub.length==0) 
 {
	alert("Please enter the H.S.C. Subject's information!");
	document.exam.hscsub.focus();
	return false;
 }
 else 
   {
        var myString=new String(hscsub);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.hscsub.value="";
        document.exam.hscsub.focus();
        return false;
        }
        }
    }
//=============================month & year    
if(document.exam.MM.value=="-")
{
alert("Select Month of HSC! ");
	document.exam.MM.focus();
	return false;	
	} 
if(document.exam.YY.value=="-")
{
	alert("Select Year of HSC! ");
	document.exam.YY.focus();
	return false;
}

//===========================H.S.C. Total marks obtained


 if(hscmark.length==0) 
 {
	alert("Please enter the H.S.C. Total marks obtained information!");
	document.exam.hscmark.focus();
	return false;
 }
 else 
 	{
	 if(isNaN(hscmark))
	 {
		 alert("Enter Numaric values H.S.C. Total marks !");
		 document.exam.hscmark.focus();
		 return false;
	 }
	 }
    
//===========================H.S.C. Out Of marks obtained

 if(hscoutof.length==0) 
 {
	alert("Please enter the H.S.C. Out Of marks obtained information!");
	document.exam.hscoutof.focus();
	return false;
 }
 else 
 	{
	 if(isNaN(hscoutof))
	 {
		 alert("Enter Numaric values H.S.C. Out Of marks !");
		 document.exam.hscoutof.focus();
		 return false;
	 }
	 
	 }
	 	if(hscmark!="" && hscoutof!="")
	 	{
	if(parseInt(hscmark) > parseInt(hscoutof))
	 {
		//alert("Obtained marks: "+hscmark);
		//alert("Out of marks: "+hscoutof)
	 	alert("H.S.C.obtained marks must be less than or equal to Out Of marks !");
		 document.exam.hscmark.focus();
		 return false;
	 }
	 }

//================================H.S.C. %Percentage
 if(hscpercentage.length==0) 
 {
	alert("Please enter the H.S.C. Percentage obtained information!");
	document.exam.hscpercentage.focus();
	return false;
 }
 else 
{
	 if(isNaN(hscpercentage))
	 {
		 alert("Enter Numaric values the H.S.C. Percentage !");
		 document.exam.hscpercentage.focus();
		 return false;
	 }
	if(hscpercentage >100)
	 {
	 	alert("The H.S.C. Percentage must be less than or equal to 100!");
		document.exam.hscpercentage.focus();
		return false;
	 }
}	
    
//====================================First Year Details of qualifying Examination===============================
if(document.exam.fysub.value!="")    
{
if(fysub.length==0)
	{
	  	alert("Please enter the First Year Subject's information!");
		document.exam.fysub.focus();
		return false;
	}
	else
	{
	
        var myString=new String(fysub);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.fysub.value="";
        document.exam.fysub.focus();
        return false;
        }
        }  
	}
	//=============================month & year  First Year  
if(document.exam.MM0.value=="-")
{
	alert("Select Month of First Year! ");
	document.exam.MM0.focus();
	return false;	
} 
if(document.exam.YY0.value=="-")
{
	alert("Select Year of First Year! ");
	document.exam.YY0.focus();
	return false;
}

//===========================First Year Total marks obtained
if(fymark.length==0) 
 {
	alert("Please enter the First Year Total marks obtained information!");
	document.exam.fymark.focus();
	return false;
 }
 else 
 	{
	 if(isNaN(fymark))
	 {
		 alert("Enter Numaric values First Year Total marks !");
		 document.exam.fymark.focus();
		 return false;
	 }
	 }
    
//===========================First Year Out Of marks obtained

 if(fyoutof.length==0) 
 {
	alert("Please enter the First Year Out Of marks obtained information!");
	document.exam.fyoutof.focus();
	return false;
 }
 else 
 	{
	 if(isNaN(fyoutof))
	 {
		 alert("Enter Numaric values First Year Out Of marks !");
		 document.exam.fyoutof.focus();
		 return false;
	 }
	 
	 }
if(fymark!="" && fyoutof!="")
	 	{
	if(parseInt(fymark) > parseInt(fyoutof))
	 {
		//alert("Obtained marks: "+fymark);
		//alert("Out of marks: "+fyoutof)
	 	alert("First Year obtained marks must be less than or equal to Out Of marks !");
		 document.exam.fymark.focus();
		 return false;
	 }
	 }

//================================First Year %Percentage
 if(fypercentage.length==0) 
 {
	alert("Please enter the First Year Percentage obtained information!");
	document.exam.fypercentage.focus();
	return false;
 }
 else 
{
	 if(isNaN(fypercentage))
	 {
		 alert("Enter Numaric values the First Year Percentage !");
		 document.exam.fypercentage.focus();
		 return false;
	 }
	if(fypercentage >100)
	 {
	 	alert("The First Year Percentage must be less than or equal to 100!");
		document.exam.fypercentage.focus();
		return false;
	 }
}
}
//===================================Second Year  Details of qualifying Examination==============================
if(document.exam.symark.value!="")    
{
if(sysub.length==0)
	{
	  	alert("Please enter the Second Year Subject's information!");
		document.exam.sysub.focus();
		return false;
	}
	else
	{
	
        var myString=new String(sysub);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.sysub.value="";
        document.exam.sysub.focus();
        return false;
        }
        }  
	}
	//=============================month & year Second Year  
if(document.exam.MM1.value=="-")
{
	alert("Select Month of Second Year! ");
	document.exam.MM1.focus();
	return false;	
} 
if(document.exam.YY1.value=="-")
{
	alert("Select Year of Second Year! ");
	document.exam.YY1.focus();
	return false;
}

//===========================Second Year Total marks obtained
if(symark.length==0) 
 {
	alert("Please enter the Second Year Total marks obtained information!");
	document.exam.symark.focus();
	return false;
 }
 else 
 	{
	 if(isNaN(symark))
	 {
		 alert("Enter Numaric values Second Year Total marks !");
		 document.exam.symark.focus();
		 return false;
	 }
	 }
    
//===========================Second Year Out Of marks obtained

 if(syoutof.length==0) 
 {
	alert("Please enter the Second Year Out Of marks obtained information!");
	document.exam.syoutof.focus();
	return false;
 }
 else 
 	{
	 if(isNaN(syoutof))
	 {
		 alert("Enter Numaric values Second Year Out Of marks !");
		 document.exam.syoutof.focus();
		 return false;
	 }
	 
	 }
if(symark!="" && syoutof!="")
	 	{
	if(parseInt(symark) > parseInt(syoutof))
	 {
		//alert("Obtained marks: "+symark);
		//alert("Out of marks: "+syoutof)
	 	alert("Second Year obtained marks must be less than or equal to Out Of marks !");
		 document.exam.symark.focus();
		 return false;
	 }
	 }

//================================Second Year %Percentage
 if(sypercentage.length==0) 
 {
	alert("Please enter the Second Year Percentage obtained information!");
	document.exam.sypercentage.focus();
	return false;
 }
 else 
{
	 if(isNaN(sypercentage))
	 {
		 alert("Enter Numaric values the Second Year Percentage !");
		 document.exam.sypercentage.focus();
		 return false;
	 }
	if(sypercentage >100)
	 {
	 	alert("The Second Year Percentage must be less than or equal to 100!");
		document.exam.sypercentage.focus();
		return false;
	 }
}
}

/*
//===================================Third Year  Details of qualifying Examination===============================
if(tysub.length==0)
	{
	  	alert("Please enter the Third Year Subject's information!");
		document.exam.tysub.focus();
		return false;
	}
	else
	{
	
        var myString=new String(tysub);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.tysub.value="";
        document.exam.tysub.focus();
        return false;
        }
        }  
	}
	//=============================month & year Third Year  
	
if(document.exam.MM2.value!="")
{
if(document.exam.MM2.value=="-")
{
	alert("Select Month of Third Year! ");
	document.exam.MM2.focus();
	return false;	
} 
if(document.exam.YY2.value=="-")
{
	alert("Select Year of Third Year! ");
	document.exam.YY2.focus();
	return false;
}

//===========================Third Year Total marks obtained
if(tymark.length==0) 
 {
	alert("Please enter the Third Year Total marks obtained information!");
	document.exam.tymark.focus();
	return false;
 }
 else 
 	{
	 if(isNaN(tymark))
	 {
		 alert("Enter Numaric values Third Year Total marks !");
		 document.exam.tymark.focus();
		 return false;
	 }
	 }
    
//===========================Third Year Out Of marks obtained

 if(tyoutof.length==0) 
 {
	alert("Please enter the Third Year Out Of marks obtained information!");
	document.exam.tyoutof.focus();
	return false;
 }
 else 
 	{
	 if(isNaN(tyoutof))
	 {
		 alert("Enter Numaric values Third Year Out Of marks !");
		 document.exam.tyoutof.focus();
		 return false;
	 }
	 
	 }
if(tymark!="" && tyoutof!="")
	 	{
	if(parseInt(tymark) > parseInt(tyoutof))
	 {
		//alert("Obtained marks: "+tymark);
		//alert("Out of marks: "+tyoutof)
	 	alert("Third Year obtained marks must be less than or equal to Out Of marks !");
		 document.exam.tymark.focus();
		 return false;
	 }
	 }

//================================Third Year %Percentage
 if(typercentage.length==0) 
 {
	alert("Please enter the Third Year Percentage obtained information!");
	document.exam.typercentage.focus();
	return false;
 }
 else 
{
	 if(isNaN(typercentage))
	 {
		 alert("Enter Numaric values the Third Year Percentage !");
		 document.exam.typercentage.focus();
		 return false;
	 }
	if(typercentage >100)
	 {
	 	alert("The Third Year Percentage must be less than or equal to 100!");
		document.exam.typercentage.focus();
		return false;
	 }
}
}

*/

//===================================Application Fee Details=====================================================

//For DD Acconut
  if(ddamount.length==0) 
 {
		alert("Please enter the DD Acconut information !");
		document.exam.ddamount.focus();
		return false;
 }
 else 
   {
        var myString=new String(ddamount);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.ddamount.value="";
        document.exam.ddamount.focus();
        return false;
        }
        }
    }
if(isNaN(ddamount))
	 {
		 alert("Enter Numaric values for DD Acconut !");
		 document.exam.ddamount.focus();
		 return false;
	 }
        
    
//==================================================For DD No.===========================================
  if(ddno.length==0) 
 {
		alert("Please enter the  DD No. information !");
		document.exam.ddno.focus();
		return false;
 }
 else 
   {
        var myString=new String(ddno);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.ddno.value="";
        document.exam.ddno.focus();
        return false;
        }
        }
    }
  
  

//=================================================For DD Date==========================================
  if(dddate.length==0) 
 {
		alert("Please enter the DD Date information !");
		document.exam.dddate.focus();
		return false;
 }
 else 
   {
        var myString=new String(dddate);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.dddate.value="";
        document.exam.dddate.focus();
        return false;
        }
        }
    }
/*if (isDate(dddate)==false)
	{
		document.exam.dddate.focus()
		return false;
	}
else
{
var daysInMonth = DaysArray(12);
var dtCh="/";

var dtStr = document.exam.dddate.value;
	var pos1=dtStr.indexOf(dtCh);
	var pos2=dtStr.indexOf(dtCh,pos1+1);
	var strDay=dtStr.substring(0,pos1);
	var strMonth=dtStr.substring(pos1+1,pos2);
	var strYear=dtStr.substring(pos2+1);

strMonth=parseInt(strMonth);
strMonth=strMonth-1;
var dddate1=new Date();
var dateto=new Date();

dateto.setDate(23);
dateto.setMonth(4);
dateto.setFullYear(2007);
//dddate1=Date.parse(dddate);

dddate1.setDate(strDay);
dddate1.setMonth(strMonth);
dddate1.setFullYear(strYear);
//dddate1=Date.parse(dddate);
//dateto=Date.parse("23/05/2007");

if( dddate1 > dateto)
{
//alert(strMonth);
alert("DD date should be less than 23rd May 2007");
document.exam.dddate.focus();
return false;
}

}*/
  

//========================================For Bank Name==================================
  if(bnknm.length==0) 
 {
		alert("Please enter the Bank Name information!");
		document.exam.bnknm.focus();
		return false;
 }
 else 
   {
        var myString=new String(bnknm);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.bnknm.value="";
        document.exam.bnknm.focus();
        return false;
        }
        }
    }
    
    //======================Domicile Certificate
if(document.exam.chk6.checked==false) 
 {
	//	alert("Attested True Copy for Domicile Certificate is compulsory");
	//	document.exam.chk6.focus();
	//	return false;
 }
//=======end
//For Branch Name
  if(branchnm.length==0) 
 {
		alert("Please enter the Branch Name information !");
		document.exam.branchnm.focus();
		return false;
 }
 else 
   {
        var myString=new String(branchnm);
        var myRegExp = / /g;
        var idx=myString.search(myRegExp);
        if(idx!=-1)
        {
        if(idx==0)
        {
        alert("Starting Spaces Not allowed");
        document.exam.branchnm.value="";
        document.exam.branchnm.focus();
        return false;
        }
        }
    }
}//End check() function........

//===================================Function for OBC selection==================================
function obc()
{
if (document.exam.categary.value=="OBC" || document.exam.categary.value=="NTC" || document.exam.categary.value=="NTD")
	{
		//alert("Select Yes or No "+document.exam.categary.value);
		document.exam.noncreamy.disabled=false;
		document.exam.chk1.disabled=false;
		document.exam.chk2.disabled=false;
		document.exam.typeofreservation.disabled=true;
 //document.exam.ddamount.value=350;

		return false;
	}
	
 		if(document.exam.categary.value=="Other")
		{
		//alert("Specify Other Categary!...");
		//document.exam.noncreamy.value="";
		document.exam.typeofreservation.disabled=false;
		document.exam.noncreamy.disabled=true;	
//document.exam.ddamount.value=500;
		return false;
		}
		else
		{
		document.exam.typeofreservation.disabled=true;
		//return false;
		}
if(document.exam.categary.value=="Open")
{
document.exam.chk1.disabled=true;
document.exam.chk2.disabled=true;
document.exam.chk1.checked=false;
document.exam.chk2.checked=false;
document.exam.typeofreservation.disabled=true;
document.exam.noncreamy.disabled=true;
}

else
{
//document.exam.typeofreservation.value="";
document.exam.typeofreservation.disabled=true;
document.exam.noncreamy.value="Select";
	document.exam.noncreamy.disabled=true;
	document.exam.chk1.disabled=false;
	document.exam.chk2.disabled=false;
	
//document.exam.chk3.disabled=true;
//document.exam.chk3.checked=false;
return false;
}

	
		

	

	
}//================================end fun()=====================================================

//=================================Function for Handicapped======================================
function handicapped()
{
if(document.exam.phyhandi.value=="Yes")
{
	//alert("Enter type of disability !");
	document.exam.typeofdisability.value="";
	document.exam.typeofdisability.disabled=false;
	document.exam.chk3.disabled=false;
	return false;
}
else
{
//document.exam.typeofdisability.value="";
document.exam.typeofdisability.disabled=true;
document.exam.chk3.disabled=true;
document.exam.chk3.checked=false;
return false;
}
}//=============================end fun()=====================================================

//==========================start function state_domicile()========================
function state_domicile()
{
if(document.exam.domicile.value=="Maharashtra" || document.exam.domicile.value=="Jammu and Kashmir")
{
	//alert("Enter type of disability !");
	//document.exam.categary.value="Open";
	document.exam.categary.disabled=false;
	document.exam.chk1.disabled=false;
document.exam.chk2.disabled=false;
		return false;
}
else
{
//document.exam.typeofdisability.value="";
document.exam.categary.value="Open";
document.exam.categary.disabled=true;
document.exam.chk1.checked=false;
document.exam.chk1.disabled=true;
document.exam.chk2.checked=false;
document.exam.chk2.disabled=true;
return false;
}
}//==========================end function state_domicile()========================

//===================================Function for Status1======================================
function status2()
{
if (document.exam.status1.value=="Passed")
	{	
		document.exam.MM3.disabled=false;
		document.exam.YY3.disabled=false;	
		document.exam.aggmarks.disabled=false;
		document.exam.permarks.disabled=false;	
		return false;	
	} 

if (document.exam.status1.value=="Appeared")
	{		
		document.exam.aggmarks.disabled=true;
		document.exam.permarks.disabled=true;
		return false;
	}
}
//=============================end fun()======================================================

//==============================Function for Disability=======================================
function loadfirst()

{

if (document.exam.categary.value=="OBC" || document.exam.categary.value=="NTC" || document.exam.categary.value=="NTD") 
{
document.exam.noncreamy.disabled=false;
}
else
{
document.exam.noncreamy.disabled=true;
}
if(document.exam.phyhandi.value=="Yes")
{
document.exam.typeofdisability.disabled=false;
}
else
{
document.exam.typeofdisability.disabled=true;
}

if(document.exam.status1.value=="Passed")
{
document.exam.aggmarks.disabled=false;
document.exam.permarks.disabled=false;}
else
{
document.exam.aggmarks.disabled=true;
document.exam.permarks.disabled=true;
}

if (document.exam.categary.value=="Other") 
{
document.exam.typeofreservation.disabled=false;
}
else
{
document.exam.typeofreservation.disabled=true;
}
if (document.exam.categary.value=="Open")
{
document.exam.chk1.disabled=true;
document.exam.chk2.disabled=true;
}
if(document.exam.phyhandi.value!="Yes")
{
document.exam.chk3.disabled=true;
}

if(document.exam.domicile.value!="Maharashtra")
{
	//alert("Enter type of disability !");
	//document.exam.categary.value="Open";
	document.exam.categary.disabled=true;
	document.exam.chk1.disabled=true;
document.exam.chk2.disabled=true;
		
}

}//=========end fun()==========

