/*
 * This is the function that actually highlights a text string by
 * adding HTML tags before and after all occurrences of the search
 * term. You can pass your own tags if you'd like, or if the
 * highlightStartTag or highlightEndTag parameters are omitted or
 * are empty strings then the default <font> tags will be used.
 */
function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) 
{
  // the highlightStartTag and highlightEndTag parameters are optional
  if ((!highlightStartTag) || (!highlightEndTag)) {
    highlightStartTag = "<font style='color:blue; background-color:yellow;'>";
    highlightEndTag = "</font>";
  }
  
  // find all occurences of the search term in the given text,
  // and add some "highlight" tags to them (we're not using a
  // regular expression search, because we want to filter out
  // matches that occur within HTML tags and script blocks, so
  // we have to do a little extra validation)
  var newText = "";
  var i = -1;
  var lcSearchTerm = searchTerm.toLowerCase();
  var lcBodyText = bodyText.toLowerCase();
    
  while (bodyText.length > 0) {
    i = lcBodyText.indexOf(lcSearchTerm, i+1);
    if (i < 0) {
      newText += bodyText;
      bodyText = "";
    } else {
      // skip anything inside an HTML tag
      if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
        // skip anything inside a <script> block
        if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
          newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;
          bodyText = bodyText.substr(i + searchTerm.length);
          lcBodyText = bodyText.toLowerCase();
          i = -1;
        }
      }
    }
  }
  
  return newText;
}


/*
 * This is sort of a wrapper function to the doHighlight function.
 * It takes the searchText that you pass, optionally splits it into
 * separate words, and transforms the text on the current web page.
 * Only the "searchText" parameter is required; all other parameters
 * are optional and can be omitted.
 */
function highlightSearchTerms(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)
{
  // if the treatAsPhrase parameter is true, then we should search for 
  // the entire phrase that was Entered; otherwise, we will split the
  // search string so that each word is searched for and highlighted
  // individually
  if (treatAsPhrase) {
    searchArray = [searchText];
  } else {
    searchArray = searchText.split(" ");
  }
  
  if (!document.body || typeof(document.body.innerHTML) == "undefined") {
    if (warnOnFailure) {
      alert("Sorry, for some reason the text of this page is unavailable. Searching will not work.");
    }
    return false;
  }
  
  var bodyText = document.body.innerHTML;
  for (var i = 0; i < searchArray.length; i++) {
    bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);
  }
  
  document.body.innerHTML = bodyText;
  return true;
}


/*
 * This displays a dialog box that allows a user to Enter their own
 * search terms to highlight on the page, and then passes the search
 * text or phrase to the highlightSearchTerms function. All parameters
 * are optional.
 */
function searchPrompt(treatAsPhrase, textColor, bgColor)
{
  // This function prompts the user for any words that should
  // be highlighted on this web page
   
  // we can optionally use our own highlight tag values
  if ((!textColor) || (!bgColor)) {
    highlightStartTag = "";
    highlightEndTag = "";
  } else {
    highlightStartTag = "<font style='color:" + textColor + "; background-color:" + bgColor + ";'>";
    highlightEndTag = "</font>";
  }
  
    
  searchText = document.getElementById('search').value;

  if (!searchText)  {
    alert("No search terms were Entered.");
    return false;
  }
  
  return highlightSearchTerms(searchText, treatAsPhrase, true, highlightStartTag, highlightEndTag);
}


/*
 * This function takes a referer/referrer string and parses it
 * to determine if it contains any search terms. If it does, the
 * search terms are passed to the highlightSearchTerms function
 * so they can be highlighted on the current page.
 */
function highlightGoogleSearchTerms(referrer)
{
  // This function has only been very lightly tested against
  // typical Google search URLs. If you wanted the Google search
  // terms to be automatically highlighted on a page, you could
  // call the function in the onload event of your <body> tag, 
  // like this:
  //   <body onload='highlightGoogleSearchTerms(document.referrer);'>
  
  //var referrer = document.referrer;
  if (!referrer) {
    return false;
  }
  
  var queryPrefix = "q=";
  var startPos = referrer.toLowerCase().indexOf(queryPrefix);
  if ((startPos < 0) || (startPos + queryPrefix.length == referrer.length)) {
    return false;
  }
  
  var endPos = referrer.indexOf("&", startPos);
  if (endPos < 0) {
    endPos = referrer.length;
  }
  
  var queryString = referrer.substring(startPos + queryPrefix.length, endPos);
  // fix the space characters
  queryString = queryString.replace(/%20/gi, " ");
  queryString = queryString.replace(/\+/gi, " ");
  // remove the quotes (if you're really creative, you could search for the
  // terms within the quotes as phrases, and everything else as single terms)
  queryString = queryString.replace(/%22/gi, "");
  queryString = queryString.replace(/\"/gi, "");
  
  return highlightSearchTerms(queryString, false);
}


/*
 * This function is just an easy way to test the highlightGoogleSearchTerms
 * function.
 */
function testHighlightGoogleSearchTerms()
{
  var referrerString = "http://www.google.com/search?q=javascript%20highlight&start=0";
  referrerString = prompt("Test the following referrer string:", referrerString);
  return highlightGoogleSearchTerms(referrerString);
}




/******************************************************************************************
Function Name : f_isEmpty
Input : String 
Output : true or false
Description : This function returns true if string is not empty o.w. returns false.
******************************************************************************************/
function f_isEmpty(msStr)
{   

    var   msTemp=msStr;
    for(mnI=0;mnI<msTemp.length;mnI++)
    {
     // find out ascii value of each character   
     temp=msTemp.charCodeAt(mnI);
    if ( temp != 10 &&  temp != 13 &&  temp != "@" &&  temp != 32)
                    {
                        return false;
                    }
    }
    msStr.value="";
    return true;
}

/******************************************************************************************
Function Name : f_isNumber
Input : String 
Output : true or false
Description : This function returns true if string is numeric o.w. returns false.
******************************************************************************************/
function f_isNumber(str)
{
	nstr = '0123456789';
    err = 0;
    for (f=0;f<str.length;f++){
      if (nstr.indexOf(str.charAt(f)) == -1) err++;
    }
    if (err!=0) return false;
    else return true;
}

/******************************************************************************************
Function Name : f_isFloatNumber
Input : String 
Output : true or false
Description : This function returns true if string is numeric o.w. returns false.
******************************************************************************************/
function f_isFloatNumber(sStr)
{
var msStr = "0123456789.";
var d1 = sStr.indexOf(".");
var d2 = sStr.lastIndexOf(".");

if ((d1 >= 0 && d2 >= 0) && d1 != d2)
{
return false;
}
for (i=0;i<sStr.length;i++)
{
if ( msStr.indexOf(sStr.charAt(i)) == -1 )
{
return false; // Not Numeric....
}
}
return true; // string is Numeric....
}

/******************************************************************************************
Function Name : f_isValidPhone
Input : String i.e. an email address
Output : true or false
Description : This function returns true if email id is valid o.w. returns false.
******************************************************************************************/
function IsValidPhone(phone)
{
 var list="0123456789- + _.()";
  var str = phone
  for(var i=0; i<str.length; i++){
	if(list.indexOf(str.charAt(i))<0){      
      return false;
	}
   }
	return true;
 }

/******************************************************************************************
Function Name : IsValidName
Input : String 
Output : true or false
Description : This function returns true if name is valid o.w. returns false.
******************************************************************************************/
function IsValidName(Name)
{
  var list="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ~!@#$%^&*()_+=\|]}[{';:/?.,><";
  var str = Name
  err = 0;
  for(i=0; i<str.length; i++){
  	if(list.indexOf(str.charAt(i))==-1)
  		err++;
  	}
  		if(err!=0) return true;
  	else return false;
 }
 
 
 
/******************************************************************************************
Function Name : Check_email
Input : String i.e. an email address
Output : true or false
Description : This function returns true if email id is valid o.w. returns false.
******************************************************************************************/
function Check_email(emailStr) 
{
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var matchArray=emailStr.match(emailPat)
	
	if (matchArray==null) 
	{  
		alert("Email address seems incorrect (check @ and .'s)")
		return false
	}
	var user=matchArray[1]
	var domain=matchArray[2]
	if (user.match(userPat)==null) 
	{
	    alert("The username doesn't seem to be valid.")
	    return false
	}
	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) 
	{  
		  for (var i=1;i<=4;i++) 
		  {
		    if (IPArray[i]>255) 
			{
		        alert("Destination IP address is invalid!")
				return false
		    }
	    }
	    return true
	}
	var domainArray=domain.match(domainPat)
	if (domainArray==null) 
	{
		alert("The domain name doesn't seem to be valid.")
	    return false
	}
	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) 
	{   
	   alert("The address must end in a three-letter domain, or two letter country.")
	   return false
	}
	if (len<2) 
	{
	   var errStr="This address is missing a hostname!"
	   alert(errStr)
	   return false
	}
	return true;
}
/******************************************************************************************/

/******************************************************************************************
Function Name : Compares two dates
Input : accepts two dates - date1, date2
Output : true or false
Description : This function returns        
		0 if two dates are equal
		1 if date1 is greater than date 2 
	   -1 if date1 is less than date2
******************************************************************************************/
function f_DateCompare(nMonth,nDay,nYear,date2)
{
		var str=nMonth+"/"+nDay+"/"+nYear;
		var dateStr1=str;
		var dateStr2=date2;
			
		var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;
		
		var matchArray1 = dateStr1.match(datePat); // is the format ok?
		var ma1=dateStr1
		maarray1=ma1.match(datePat);
		if (matchArray1 == null) 
			{
				alert("Date1 is not in a valid format.")
				return false;
			}
		
		var matchArray2 = dateStr2.match(datePat); // 
		var ma2=date2;
		maarray2=ma2.match(datePat);
		
		if (matchArray2 == null) 
			{
				alert("Date2 is not in a valid format.")
				return false;
			}
	
		month1 = matchArray1[1]; // parse date into variables
		day1 = matchArray1[3];
		year1 = matchArray1[4];
		yea1=year1.length
		if(yea1 < 4)
		{
			alert("Date1 should be in mm/dd/yyyy format");
			return false;
		}
		month2 = matchArray2[1]; // parse date into variables
		day2 = matchArray2[3];
		year2 = matchArray2[4];
		yea2=year2.length
		if(yea2 < 4)
		{
			alert("Date2 should be in mm/dd/yyyy format");
			return false;
		}
	if (month1 < 1 || month1 > 12) 
		{ 
			// check month range
			alert("Date1 Error: Month must be between 1 and 12.");
			return false;
		}
	if (day1 < 1 || day1 > 31) 
		{
			alert("Date1 Error: Day must be between 1 and 31.");
			return false;
		}

	if ((month1==4 || month1==6 || month1==9 || month1==11) && day1==31) 
		{
			alert("Date1 Error: Month in Date1  doesn't have 31 days!");
			return false;
		}
	if (month1 == 2) 
		{ // check for february 29th
			var isleap = (year1 % 4 == 0 && (year1 % 100 != 0 || year1 % 400 == 0));
			if (day1>29 || (day1==29 && !isleap)) 
				{
					alert("Wrong Date1: February " + year1 + " doesn't have " + day1 + " days! \n As it is not a Leap Year");
					return false;
			   }
		}
	
	if (month2 < 1 || month2 > 12) 
		{ 
			// check month range
			alert("Date2 Error: Month must be between 1 and 12.");
			return false;
		}

	if (day2 < 1 || day2 > 31) 
		{
			alert("Date2 Error: Day must be between 1 and 31.");
			return false;
		}

	if ((month2==4 || month2==6 || month2==9 || month2==11) && day2==31) 
		{
			alert("Month in Date2  doesn't have 31 days!");
			return false;
		}
	if (month2 == 2) 
		{ // check for february 29th
			var isleap = (year2 % 4 == 0 && (year2 % 100 != 0 || year2 % 400 == 0));
			if (day2>29 || (day2==29 && !isleap)) 
				{
					alert("Wrong Date1: February " + year2 + " doesn't have " + day2 + " days! \n As it is not a Leap Year");
					return false;
			   }
		}
	
 // Till here both dates are OK... Now actual Comparison starts from here....!!!
		if (year1 == year2)
		{
			if (month1 == month2)
			{
				if (day1 == day2)
				{
					return 0; // dates are equal
				}
				else if (day1 > day2)
				{
					return 1; // date1 > date2
				}
				else 
				{
					return -1; // date1 < date2
				}
			}
			else if (month1 > month2 )
			{                   
				return 1; //date1 > date 2
			}
			else
			{
				return -1; // date1 < date 2
			}
		}
		else if (year1 > year2)
		{
			return 1; // date1 > date 2
		}
		else
		{
			return -1; // date1 < date2
		}
}

/******************************************************************************************
Function Name : Validation of date
Input : accepts date - date1
Output : true or false
Description : This function returns true or fasle if date is not in valid format       
		
******************************************************************************************/
function f_ValidDate(nMonth,nDay,nYear)
{
		var str=nMonth+"/"+nDay+"/"+nYear;
		var dateStr1=str;
					
		var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;
		
		var matchArray1 = dateStr1.match(datePat); // is the format ok?
		var ma1=dateStr1
		maarray1=ma1.match(datePat);
		if (matchArray1 == null) 
			{
				alert("Date1 is not in a valid format.")
				return false;
			}
		
		month1 = matchArray1[1]; // parse date into variables
		day1 = matchArray1[3];
		year1 = matchArray1[4];
		yea1=year1.length
		if(yea1 < 4)
		{
			alert("Date1 should be in mm/dd/yyyy format");
			return false;
		}
		
	if (month1 < 1 || month1 > 12) 
		{ 
			// check month range
			alert("Date1 Error: Month must be between 1 and 12.");
			return false;
		}
	if (day1 < 1 || day1 > 31) 
		{
			alert("Date1 Error: Day must be between 1 and 31.");
			return false;
		}

	if ((month1==4 || month1==6 || month1==9 || month1==11) && day1==31) 
		{
			alert("Date1 Error: Month in Date1  doesn't have 31 days!");
			return false;
		}
	if (month1 == 2) 
		{ // check for february 29th
			var isleap = (year1 % 4 == 0 && (year1 % 100 != 0 || year1 % 400 == 0));
			if (day1==29 && !isleap) 
				{
					alert("February " + year1 + " doesn't have " + day1 + " days! \n As it is not a Leap Year");
					return false;
			   }
			if (day1>29) 
				{
					alert("February " + year1 + " doesn't have " + day1 + " days!");
					return false;
			   }   
		}
		return true;
}



function comparedate(value1,value2)
{
   var date1, date2;
   var month1, month2;
   var year1, year2;

   month1 = value1.substring (0, value1.indexOf ("/"));
   date1 = value1.substring (value1.indexOf ("/")+1, value1.lastIndexOf ("/"));
   year1 = value1.substring (value1.lastIndexOf ("/")+1, value1.length);

   month2 = value2.substring (0, value2.indexOf ("/"));
   date2 = value2.substring (value2.indexOf ("/")+1, value2.lastIndexOf ("/"));
   year2 = value2.substring (value2.lastIndexOf ("/")+1, value2.length);

   if (year1 > year2) return 1;
   else if (year1 < year2) return -1;
   else if (month1 > month2) return 1;
   else if (month1 < month2) return -1;
   else if (date1 > date2) return 1;
   else if (date1 < date2) return -1;
   else return 0;
}
/******************************************************************************************/


function validate_qc()
{
 if(f_isEmpty(document.getElementById("txtname").value))
 {
	window.alert("Please Enter Your Name");
	document.getElementById("txtname").value='';
	document.getElementById("txtname").focus();
	return false;
 }
 if(IsValidName(document.getElementById("txtname").value))
 {
	window.alert("Please Enter Valid Name");
	document.getElementById("txtname").value='';
	document.getElementById("txtname").focus();
	return false;
 }
 
 if(f_isEmpty(document.getElementById("txtemail").value))
 {
	window.alert("Please Enter Your Email Address");
	document.getElementById("txtemail").value='';
	document.getElementById("txtemail").focus();
	return false;	
 }
 if(!(Check_email(document.getElementById("txtemail").value)))
 {
    document.getElementById("txtemail").value='';
    document.getElementById("txtemail").focus();
    return false;
 } 
 if(f_isEmpty(document.getElementById("txtcourse").value))
 {
	window.alert("Please Enter Course");
	document.getElementById("txtcourse").value='';
	document.getElementById("txtcourse").focus();
	return false;	
 } 
  if(IsValidName(document.getElementById("txtcourse").value))
 {
	window.alert("Please Enter Valid Course");
	document.getElementById("txtcourse").value='';
	document.getElementById("txtcourse").focus();
	return false;
 }
 if(f_isEmpty(document.getElementById("txtphone").value))
 {
	window.alert("Please Enter Your Phone number");
	document.getElementById("txtphone").value='';
	document.getElementById("txtphone").focus();
	return false;
 }
 if(!(IsValidPhone(document.getElementById("txtphone").value)))
 {
	window.alert("Please Enter Valid Phone number");
	document.getElementById("txtphone").value='';
	document.getElementById("txtphone").focus();
	return false;
 }
 
}

function validate_online()
{
 if(f_isEmpty(document.getElementById("txtEnrollmentNo").value))
 {
	window.alert("Please Enter Enrollment No.");
	document.getElementById("txtEnrollmentNo").value='';
	document.getElementById("txtEnrollmentNo").focus();
	return false;
 }
  
 if(f_isEmpty(document.getElementById("score").value))
 {
	window.alert("Please Enter your score");
	document.getElementById("score").value='';
	document.getElementById("score").focus();
	return false;	
 }
 
 if(!f_isNumber(document.getElementById("score").value))
 {
	window.alert("Please Enter valid score(only number)");
	document.getElementById("score").value='';
	document.getElementById("score").focus();
	return false;	
 }
 
 
 if(f_isEmpty(document.getElementById("txtFullName").value))
 {
	window.alert("Please Enter your Full Name");
	document.getElementById("txtFullName").value='';
	document.getElementById("txtFullName").focus();
	return false;	
 }
 
 if(IsValidName(document.getElementById("txtFullName").value))
 {
	window.alert("Please Enter valid Full Name");
	document.getElementById("txtFullName").value='';
	document.getElementById("txtFullName").focus();
	return false;	
 }
 
if(IsValidName(document.getElementById("txtPerCity").value))
 {
	window.alert("Please Enter valid City");
	document.getElementById("txtPerCity").value='';
	document.getElementById("txtPerCity").focus();
	return false;	
 }


 if(!f_isNumber(document.getElementById("txtPerPin").value))
 {
	window.alert("Please Enter valid pin number");
	document.getElementById("txtPerPin").value='';
	document.getElementById("txtPerPin").focus();
	return false;	
 }
  if(f_isEmpty(document.getElementById("txtPerEmail").value))
 {
	window.alert("Please Enter your Email Id");
	document.getElementById("txtPerEmail").value='';
	document.getElementById("txtPerEmail").focus();
	return false;	
 }
 
 if(!(Check_email(document.getElementById("txtPerEmail").value)))
 {
    document.getElementById("txtPerEmail").value='';
    document.getElementById("txtPerEmail").focus();
    return false;
 } 
 
 if(f_isEmpty(document.getElementById("txtPerPhone").value))
 {
	window.alert("Please Enter your phone number");
	document.getElementById("txtPerPhone").value='';
	document.getElementById("txtPerPhone").focus();
	return false;
 }
 if(!(IsValidPhone(document.getElementById("txtPerPhone").value)))
 {
	window.alert("Please Enter valid phone number");
	document.getElementById("txtPerPhone").value='';
	document.getElementById("txtPerPhone").focus();
	return false;
 }
 
  if(IsValidName(document.getElementById("txtFatherName").value))
 {
	window.alert("Please Enter valid Father Name");
	document.getElementById("txtFatherName").value='';
	document.getElementById("txtFatherName").focus();
	return false;	
 }
  if(IsValidName(document.getElementById("txtContactCity").value))
 {
	window.alert("Please Enter valid Contact City Name");
	document.getElementById("txtContactCity").value='';
	document.getElementById("txtContactCity").focus();
	return false;	
 }
 
 if(!f_isNumber(document.getElementById("txtContactPin").value))
 {
	window.alert("Please Enter valid contact address pin number");
	document.getElementById("txtContactPin").value='';
	document.getElementById("txtContactPin").focus();
	return false;	
 }
 
 if(!(IsValidPhone(document.getElementById("txtContactFax").value)))
 {
	window.alert("Please Enter valid contact fax number");
	document.getElementById("txtContactFax").value='';
	document.getElementById("txtContactFax").focus();
	return false;
 }
 if(!(IsValidPhone(document.getElementById("txtContactPhone").value)))
 {
	window.alert("Please Enter valid contact phone number");
	document.getElementById("txtContactPhone").value='';
	document.getElementById("txtContactPhone").focus();
	return false;
 }
  if(IsValidName(document.getElementById("txtUniBoard").value))
 {
	window.alert("Please Enter valid University/Board Name");
	document.getElementById("txtUniBoard").value='';
	document.getElementById("txtUniBoard").focus();
	return false;	
 }
 
 if(!f_isNumber(document.getElementById("yearofpassing").value))
 {
	window.alert("Please Enter valid year of passing");
	document.getElementById("yearofpassing").value='';
	document.getElementById("yearofpassing").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtPerMark_D").value))
 {
	window.alert("Please Enter valid percentage of marks");
	document.getElementById("txtPerMark_D").value='';
	document.getElementById("txtPerMark_D").focus();
	return false;	
 }
 
 if(!f_isNumber(document.getElementById("drpYearOfPassing_XII").value))
 {
	window.alert("Please Enter valid year of passing for XII");
	document.getElementById("drpYearOfPassing_XII").value='';
	document.getElementById("drpYearOfPassing_XII").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtPerMark_XII").value))
 {
	window.alert("Please Enter valid percentage of marks of XII");
	document.getElementById("txtPerMark_XII").value='';
	document.getElementById("txtPerMark_XII").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("drpYearOfPassing_X").value))
 {
	window.alert("Please Enter valid year of passing for X");
	document.getElementById("drpYearOfPassing_X").value='';
	document.getElementById("drpYearOfPassing_X").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtPerMark_X").value))
 {
	window.alert("Please Enter valid percentage of marks of X");
	document.getElementById("txtPerMark_X").value='';
	document.getElementById("txtPerMark_X").focus();
	return false;	
 }
 
}



function Validate_PI()
{
 if(f_isEmpty(document.getElementById("txtname").value))
 {
	window.alert("Please Enter Your Name");
	document.getElementById("txtname").value='';
	document.getElementById("txtname").focus();
	return false;
 }
 if(IsValidName(document.getElementById("txtname").value))
 {
	window.alert("Please Enter Valid Name");
	document.getElementById("txtname").value='';
	document.getElementById("txtname").focus();
	return false;
 }
 
 if(!f_isNumber(document.getElementById("txtscore").value))
 {
	window.alert("Please Enter Valid Score.");
	document.getElementById("txtscore").value='';
	document.getElementById("txtscore").focus();
	return false;	
 }
 if(f_isEmpty(document.getElementById("txtemail").value))
 {
	window.alert("Please Enter your email address");
	document.getElementById("txtemail").value='';
	document.getElementById("txtemail").focus();
	return false;	
 }
 if(!(Check_email(document.getElementById("txtemail").value)))
 {
    document.getElementById("txtemail").value='';
    document.getElementById("txtemail").focus();
    return false;
 } 
  
 if(f_isEmpty(document.getElementById("txttelephone").value))
 {
	window.alert("Please Enter your phone number");
	document.getElementById("txttelephone").value='';
	document.getElementById("txttelephone").focus();
	return false;
 }
 if(!(IsValidPhone(document.getElementById("txttelephone").value)))
 {
	window.alert("Please Enter valid phone number");
	document.getElementById("txttelephone").value='';
	document.getElementById("txttelephone").focus();
	return false;
 }
 
}

function Validate_PI_PartTime()
{
 if(f_isEmpty(document.getElementById("txtname").value))
 {
	window.alert("Please Enter Your Name");
	document.getElementById("txtname").value='';
	document.getElementById("txtname").focus();
	return false;
 }
 if(IsValidName(document.getElementById("txtname").value))
 {
	window.alert("Please Enter Valid Name");
	document.getElementById("txtname").value='';
	document.getElementById("txtname").focus();
	return false;
 }
 
 if(f_isEmpty(document.getElementById("txtemail").value))
 {
	window.alert("Please Enter your email address");
	document.getElementById("txtemail").value='';
	document.getElementById("txtemail").focus();
	return false;	
 }
 if(!(Check_email(document.getElementById("txtemail").value)))
 {
    document.getElementById("txtemail").value='';
    document.getElementById("txtemail").focus();
    return false;
 } 
  
 if(f_isEmpty(document.getElementById("txttelephone").value))
 {
	window.alert("Please Enter your phone number");
	document.getElementById("txttelephone").value='';
	document.getElementById("txttelephone").focus();
	return false;
 }
 if(!(IsValidPhone(document.getElementById("txttelephone").value)))
 {
	window.alert("Please Enter valid phone number");
	document.getElementById("txttelephone").value='';
	document.getElementById("txttelephone").focus();
	return false;
 }
 
}




function validate_joinus()
{
	
	if(f_isEmpty(document.getElementById("txtName").value))
 {
	window.alert("Please Enter name.");
	document.getElementById("txtName").value='';
	document.getElementById("txtName").focus();
	return false;
 }
  if(IsValidName(document.getElementById("txtName").value))
 {
	window.alert("Please Enter valid Name");
	document.getElementById("txtName").value='';
	document.getElementById("txtName").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtPin").value))
 {
	window.alert("Please Enter valid pin");
	document.getElementById("txtPin").value='';
	document.getElementById("txtPin").focus();
	return false;	
 }
 
 if(f_isEmpty(document.getElementById("txtPhone").value))
 {
	window.alert("Please Enter your phone number");
	document.getElementById("txtPhone").value='';
	document.getElementById("txtPhone").focus();
	return false;
 }
 if(!(IsValidPhone(document.getElementById("txtPhone").value)))
 {
	window.alert("Please Enter valid phone number");
	document.getElementById("txtPhone").value='';
	document.getElementById("txtPhone").focus();
	return false;
 }
  if(f_isEmpty(document.getElementById("txtMail").value))
 {
	window.alert("Please Enter your Email Id");
	document.getElementById("txtMail").value='';
	document.getElementById("txtMail").focus();
	return false;	
 }
 
 if(!(Check_email(document.getElementById("txtMail").value)))
 {
    document.getElementById("txtMail").value='';
    document.getElementById("txtMail").focus();
    return false;
 } 
 if(!(IsValidPhone(document.getElementById("txtMobile").value)))
 {
	window.alert("Please Enter valid mobile number");
	document.getElementById("txtMobile").value='';
	document.getElementById("txtMobile").focus();
	return false;
 }
 
 if(f_isEmpty(document.getElementById("txtPostApp").value))
 {
	window.alert("Please Enter name of the post applying for.");
	document.getElementById("txtPostApp").value='';
	document.getElementById("txtPostApp").focus();
	return false;
 }
  if(IsValidName(document.getElementById("txtPostApp").value))
 {
	window.alert("Please Enter valid post name");
	document.getElementById("txtPostApp").value='';
	document.getElementById("txtPostApp").focus();
	return false;	
 }
 
  if(IsValidName(document.getElementById("txtBScUni").value))
 {
	window.alert("Please Enter valid University Name of Graduation");
	document.getElementById("txtBScUni").value='';
	document.getElementById("txtBScUni").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtBScYearOfPass").value))
 {
	window.alert("Please Enter valid passing year of Graduation");
	document.getElementById("txtBScYearOfPass").value='';
	document.getElementById("txtBScYearOfPass").focus();
	return false;	
 }
  if(IsValidName(document.getElementById("txtBscSub").value))
 {
	window.alert("Please Enter valid subjects of Graduation");
	document.getElementById("txtBscSub").value='';
	document.getElementById("txtBscSub").focus();
	return false;	
 }
 
 if(!f_isNumber(document.getElementById("txtBscMarks").value))
 {
	window.alert("Please Enter valid marks of Graduation");
	document.getElementById("txtBscMarks").value='';
	document.getElementById("txtBscMarks").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtBscPercentage").value))
 {
	window.alert("Please Enter valid percentages of Graduation");
	document.getElementById("txtBscPercentage").value='';
	document.getElementById("txtBscPercentage").focus();
	return false;	
 }
 if(IsValidName(document.getElementById("txtBscGrade").value))
 {
	window.alert("Please Enter valid grade of Graduation");
	document.getElementById("txtBscGrade").value='';
	document.getElementById("txtBscGrade").focus();
	return false;	
 }
 
 if(IsValidName(document.getElementById("txtMScUni").value))
 {
	window.alert("Please Enter valid University Name of Post Graduation");
	document.getElementById("txtMScUni").value='';
	document.getElementById("txtMScUni").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtMScYearOfPass").value))
 {
	window.alert("Please Enter valid passing year of Post Graduation");
	document.getElementById("txtMScYearOfPass").value='';
	document.getElementById("txtMScYearOfPass").focus();
	return false;	
 }
  if(IsValidName(document.getElementById("txtMscSub").value))
 {
	window.alert("Please Enter valid subjects of Post Graduation");
	document.getElementById("txtMscSub").value='';
	document.getElementById("txtMscSub").focus();
	return false;	
 }
 
 if(!f_isNumber(document.getElementById("txtMscMarks").value))
 {
	window.alert("Please Enter valid Marks of Post Graduation");
	document.getElementById("txtMscMarks").value='';
	document.getElementById("txtMscMarks").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtMscPercentage").value))
 {
	window.alert("Please Enter valid percentage of Post Graduation");
	document.getElementById("txtMscPercentage").value='';
	document.getElementById("txtMscPercentage").focus();
	return false;	
 }
 if(IsValidName(document.getElementById("txtMscGrade").value))
 {
	window.alert("Please Enter valid grade of Graduation");
	document.getElementById("txtMscGrade").value='';
	document.getElementById("txtMscGrade").focus();
	return false;	
 }
 
  if(IsValidName(document.getElementById("txtMPhilUni").value))
 {
	window.alert("Please Enter valid University Name of Post Graduation");
	document.getElementById("txtMPhilUni").value='';
	document.getElementById("txtMPhilUni").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtMPhilYearOfPass").value))
 {
	window.alert("Please Enter valid passing year of Post Graduation");
	document.getElementById("txtMPhilYearOfPass").value='';
	document.getElementById("txtMPhilYearOfPass").focus();
	return false;	
 }
  if(IsValidName(document.getElementById("txtMPhilSub").value))
 {
	window.alert("Please Enter valid subjects of Post Graduation");
	document.getElementById("txtMPhilSub").value='';
	document.getElementById("txtMPhilSub").focus();
	return false;	
 }
 
 if(!f_isNumber(document.getElementById("txtMPhilMarks").value))
 {
	window.alert("Please Enter valid Marks of Post Graduation");
	document.getElementById("txtMPhilMarks").value='';
	document.getElementById("txtMPhilMarks").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtMPhilPercentage").value))
 {
	window.alert("Please Enter valid percentage of Post Graduation");
	document.getElementById("txtMPhilPercentage").value='';
	document.getElementById("txtMPhilPercentage").focus();
	return false;	
 }
 if(IsValidName(document.getElementById("txtMPhilGrade").value))
 {
	window.alert("Please Enter valid grade of Graduation");
	document.getElementById("txtMPhilGrade").value='';
	document.getElementById("txtMPhilGrade").focus();
	return false;	
 }
 
 
  if(IsValidName(document.getElementById("txtPhdUni").value))
 {
	window.alert("Please Enter valid University Name of Post Graduation");
	document.getElementById("txtPhdUni").value='';
	document.getElementById("txtPhdUni").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtPhDYearOfPass").value))
 {
	window.alert("Please Enter valid passing year of Ph.D.");
	document.getElementById("txtPhDYearOfPass").value='';
	document.getElementById("txtPhDYearOfPass").focus();
	return false;	
 }
  if(IsValidName(document.getElementById("txtPhDSub").value))
 {
	window.alert("Please Enter valid subjects of Ph.D.");
	document.getElementById("txtPhDSub").value='';
	document.getElementById("txtPhDSub").focus();
	return false;	
 }
 
 if(!f_isNumber(document.getElementById("txtPhDMarks").value))
 {
	window.alert("Please Enter valid Marks of Ph.D.");
	document.getElementById("txtPhDMarks").value='';
	document.getElementById("txtPhDMarks").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtPhDPercentage").value))
 {
	window.alert("Please Enter valid percentage of Ph.D.");
	document.getElementById("txtPhDPercentage").value='';
	document.getElementById("txtPhDPercentage").focus();
	return false;	
 }
 if(IsValidName(document.getElementById("txtPhDGrade").value))
 {
	window.alert("Please Enter valid grade of Ph.D.");
	document.getElementById("txtPhDGrade").value='';
	document.getElementById("txtPhDGrade").focus();
	return false;	
 }
  if(IsValidName(document.getElementById("txtNetSetUni").value))
 {
	window.alert("Please Enter valid University Name of Post Graduation");
	document.getElementById("txtNetSetUni").value='';
	document.getElementById("txtNetSetUni").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtNetSetYearOfPass").value))
 {
	window.alert("Please Enter valid passing year of Set/Net");
	document.getElementById("txtNetSetYearOfPass").value='';
	document.getElementById("txtNetSetYearOfPass").focus();
	return false;	
 }
  if(IsValidName(document.getElementById("txtNetSetSub").value))
 {
	window.alert("Please Enter valid subjects of Set/Net.");
	document.getElementById("txtNetSetSub").value='';
	document.getElementById("txtNetSetSub").focus();
	return false;	
 }
 
 if(!f_isNumber(document.getElementById("txtNetSetMarks").value))
 {
	window.alert("Please Enter valid Marks of Set/Net");
	document.getElementById("txtNetSetMarks").value='';
	document.getElementById("txtNetSetMarks").focus();
	return false;	
 }
 if(!f_isNumber(document.getElementById("txtNetSetPercentage").value))
 {
	window.alert("Please Enter valid percentage of Set/Net.");
	document.getElementById("txtNetSetPercentage").value='';
	document.getElementById("txtNetSetPercentage").focus();
	return false;	
 }
 if(IsValidName(document.getElementById("txtNetSetGrade").value))
 {
	window.alert("Please Enter valid grade of Set/Net");
	document.getElementById("txtNetSetGrade").value='';
	document.getElementById("txtNetSetGrade").focus();
	return false;	
 }
 
if(IsValidName(document.getElementById("txtExpUni1").value))
 {
	window.alert("Please Enter valid University Name");
	document.getElementById("txtExpUni1").value='';
	document.getElementById("txtExpUni1").focus();
	return false;	
 } 
 if(IsValidName(document.getElementById("txtExpDesg1").value))
 {
	window.alert("Please Enter valid Designation of post held");
	document.getElementById("txtExpDesg1").value='';
	document.getElementById("txtExpDesg1").focus();
	return false;	
 } 
 
 if(IsValidName(document.getElementById("txtExpSub1").value))
 {
	window.alert("Please Enter valid subject names you taught");
	document.getElementById("txtExpSub1").value='';
	document.getElementById("txtExpSub1").focus();
	return false;	
 } 

 if(IsValidName(document.getElementById("txtExpUni2").value))
 {
	window.alert("Please Enter valid University Name");
	document.getElementById("txtExpUni2").value='';
	document.getElementById("txtExpUni2").focus();
	return false;	
 } 
 if(IsValidName(document.getElementById("txtExpDesg2").value))
 {
	window.alert("Please Enter valid Designation of post held");
	document.getElementById("txtExpDesg2").value='';
	document.getElementById("txtExpDesg2").focus();
	return false;	
 } 
 
 if(IsValidName(document.getElementById("txtExpSub2").value))
 {
	window.alert("Please Enter valid subject names you taught");
	document.getElementById("txtExpSub2").value='';
	document.getElementById("txtExpSub2").focus();
	return false;	
 } 
 
 if(IsValidName(document.getElementById("txtExpUni3").value))
 {
	window.alert("Please Enter valid University Name");
	document.getElementById("txtExpUni3").value='';
	document.getElementById("txtExpUni3").focus();
	return false;	
 } 
 if(IsValidName(document.getElementById("txtExpDesg3").value))
 {
	window.alert("Please Enter valid Designation of post held");
	document.getElementById("txtExpDesg3").value='';
	document.getElementById("txtExpDesg3").focus();
	return false;	
 } 
 
 if(IsValidName(document.getElementById("txtExpSub3").value))
 {
	window.alert("Please Enter valid subject names you taught");
	document.getElementById("txtExpSub3").value='';
	document.getElementById("txtExpSub3").focus();
	return false;	
 } 
 
if(IsValidName(document.getElementById("txtExpUni4").value))
 {
	window.alert("Please Enter valid University Name");
	document.getElementById("txtExpUni4").value='';
	document.getElementById("txtExpUni4").focus();
	return false;	
 } 
 if(IsValidName(document.getElementById("txtExpDesg4").value))
 {
	window.alert("Please Enter valid Designation of post held");
	document.getElementById("txtExpDesg4").value='';
	document.getElementById("txtExpDesg4").focus();
	return false;	
 } 
 
 if(IsValidName(document.getElementById("txtExpSub4").value))
 {
	window.alert("Please Enter valid subject names you taught");
	document.getElementById("txtExpSub4").value='';
	document.getElementById("txtExpSub4").focus();
	return false;	
 } 
 
if(IsValidName(document.getElementById("txtExpUni5").value))
 {
	window.alert("Please Enter valid University Name");
	document.getElementById("txtExpUni5").value='';
	document.getElementById("txtExpUni5").focus();
	return false;	
 } 
 if(IsValidName(document.getElementById("txtExpDesg5").value))
 {
	window.alert("Please Enter valid Designation of post held");
	document.getElementById("txtExpDesg5").value='';
	document.getElementById("txtExpDesg5").focus();
	return false;	
 } 
 
 if(IsValidName(document.getElementById("txtExpSub5").value))
 {
	window.alert("Please Enter valid subject names you taught");
	document.getElementById("txtExpSub5").value='';
	document.getElementById("txtExpSub5").focus();
	return false;	
 } 
 
  if(IsValidName(document.getElementById("txtAreaExp").value))
 {
	window.alert("Please Enter valid area of expertise");
	document.getElementById("txtAreaExp").value='';
	document.getElementById("txtAreaExp").focus();
	return false;	
 } 
  if(IsValidName(document.getElementById("txtSubTeach").value))
 {
	window.alert("Please Enter valid subject name which you able to teach");
	document.getElementById("txtSubTeach").value='';
	document.getElementById("txtSubTeach").focus();
	return false;	
 } 
}


function name1()
{
if(f_isEmpty(document.getElementById("txtname").value))
 {
	window.alert("Please Enter Your Name");
	document.getElementById("txtname").value='';
	document.getElementById("txtname").focus();
	return false;
 }
 if(IsValidName(document.getElementById("txtname").value))
 {
	window.alert("Please Enter Valid Name");
	document.getElementById("txtname").value='';
	document.getElementById("txtname").focus();
	return false;
 }
}
function score()
{ 
	
	 if(!f_isNumber(document.getElementById("txtscore").value))
	 {
		window.alert("Please enter valid score.");
		document.getElementById("txtscore").value='';
		document.getElementById("txtscore").focus();
		return false;	
	 }
}
function email()
{
 if(f_isEmpty(document.getElementById("txtemail").value))
 {
	window.alert("Please Enter Your Email Address");
	document.getElementById("txtemail").value='';
	document.getElementById("txtemail").focus();
	return false;	
 }
 if(!(Check_email(document.getElementById("txtemail").value)))
 {
    document.getElementById("txtemail").value='';
    document.getElementById("txtemail").focus();
    return false;
 } 
}
function city()
{
	if(IsValidName(document.getElementById("txtcity").value))
 {
	window.alert("Please Enter Valid City");
	document.getElementById("txtcity").value='';
	document.getElementById("txtcity").focus();
	return false;
 }
}
function course()
{
 if(f_isEmpty(document.getElementById("txtcourse").value))
 {
	window.alert("Please Enter Course");
	document.getElementById("txtcourse").value='';
	document.getElementById("txtcourse").focus();
	return false;	
 } 
  if(IsValidName(document.getElementById("txtcourse").value))
 {
	window.alert("Please Enter Valid Course");
	document.getElementById("txtcourse").value='';
	document.getElementById("txtcourse").focus();
	return false;
 }
}
function phone()
{
 if(f_isEmpty(document.getElementById("txtphone").value))
 {
	window.alert("Please Enter Your Phone Number");
	document.getElementById("txtphone").value='';
	document.getElementById("txtphone").focus();
	return false;
 }
 if(!(IsValidPhone(document.getElementById("txtphone").value)))
 {
	window.alert("Please Enter Valid Phone Number");
	document.getElementById("txtphone").value='';
	document.getElementById("txtphone").focus();
	return false;
 }
}
function phone_PI()
{
 if(f_isEmpty(document.getElementById("txttelephone").value))
 {
	window.alert("Please Enter Your Phone Number");
	document.getElementById("txttelephone").value='';
	document.getElementById("txttelephone").focus();
	return false;
 }
 if(!(IsValidPhone(document.getElementById("txttelephone").value)))
 {
	window.alert("Please Enter Valid Phone Number");
	document.getElementById("txttelephone").value='';
	document.getElementById("txttelephone").focus();
	return false;
 }
}

function state()
{
	if(IsValidName(document.getElementById("txtstate").value))
 {
	window.alert("Please Enter Valid State");
	document.getElementById("txtstate").value='';
	document.getElementById("txtstate").focus();
	return false;
 }
}
function zip()
{
	if(!(IsValidPhone(document.getElementById("txtzip").value)))
 {
	window.alert("Please Enter Valid Zipcode");
	document.getElementById("txtzip").value='';
	document.getElementById("txtzip").focus();
	return false;
 }
}
function mobile()
{
	if(!(IsValidPhone(document.getElementById("txtmobile").value)))
	{
		window.alert("Please enter valid mobile number");
		document.getElementById("txtmobile").value='';
		document.getElementById("txtmobile").focus();
		return false;
	}
}

 
function postapp()
{
	if(f_isEmpty(document.getElementById("txtpost").value))
	{
		window.alert("Please enter name of the post applying for.");
		document.getElementById("txtpost").value='';
		document.getElementById("txtpost").focus();
		return false;
	}
	if(IsValidName(document.getElementById("txtpost").value))
	{
		window.alert("Please enter valid post name");
		document.getElementById("txtpost").value='';
		document.getElementById("txtpost").focus();
		return false;	
	}
}

function BscUni()
{
	if(IsValidName(document.getElementById("Bachelor_Degree_University").value))
	{
		window.alert("Please enter valid University Name of Graduation");
		document.getElementById("Bachelor_Degree_University").value='';
		document.getElementById("Bachelor_Degree_University").focus();
		return false;	
	}
}

function BscYearOfPass()
{
 if(!f_isNumber(document.getElementById("Bachelor_Degree_Month_Year_Passing").value))
 {
	window.alert("Please enter valid passing year of Graduation");
	document.getElementById("Bachelor_Degree_Month_Year_Passing").value='';
	document.getElementById("Bachelor_Degree_Month_Year_Passing").focus();
	return false;	
 }
}
function BscSub()
{
	if(IsValidName(document.getElementById("Bachelor_Degree_Subject_Offered").value))
 {
	window.alert("Please enter valid subjects of Graduation");
	document.getElementById("Bachelor_Degree_Subject_Offered").value='';
	document.getElementById("Bachelor_Degree_Subject_Offered").focus();
	return false;	
 }
}
function BscMarks()
{
	if(!f_isNumber(document.getElementById("Bachelor_Degree_Marks_Obtained").value))
 {
	window.alert("Please enter valid marks of Graduation");
	document.getElementById("Bachelor_Degree_Marks_Obtained").value='';
	document.getElementById("Bachelor_Degree_Marks_Obtained").focus();
	return false;	
 }
}
function BscPercentage()
{
	if(!f_isNumber(document.getElementById("Bachelor_Degree_Percentage_Marks").value))
 {
	window.alert("Please enter valid percentages of Graduation");
	document.getElementById("Bachelor_Degree_Percentage_Marks").value='';
	document.getElementById("Bachelor_Degree_Percentage_Marks").focus();
	return false;	
 }
}
function BscGrade()
{
	if(IsValidName(document.getElementById("Bachelor_Degree_Class_Division").value))
 {
	window.alert("Please enter valid grade of Graduation");
	document.getElementById("Bachelor_Degree_Class_Division").value='';
	document.getElementById("Bachelor_Degree_Class_Division").focus();
	return false;	
 }
}
 function MscUni()
{
	 if(IsValidName(document.getElementById("Masters_Degree_University").value))
 {
	window.alert("Please enter valid University Name of Post Graduation");
	document.getElementById("Masters_Degree_University").value='';
	document.getElementById("Masters_Degree_University").focus();
	return false;	
 }
}
function MscYearOfPass()
{
	if(!f_isNumber(document.getElementById("Masters_Degree_Month_Year_Passing").value))
 {
	window.alert("Please enter valid passing year of Post Graduation");
	document.getElementById("Masters_Degree_Month_Year_Passing").value='';
	document.getElementById("Masters_Degree_Month_Year_Passing").focus();
	return false;	
 }
}
function MscSub()
{
  if(IsValidName(document.getElementById("Masters_Degree_Subject_Offered").value))
 {
	window.alert("Please enter valid subjects of Post Graduation");
	document.getElementById("Masters_Degree_Subject_Offered").value='';
	document.getElementById("Masters_Degree_Subject_Offered").focus();
	return false;	
 }
}

 function MscMarks()
{
	if(!f_isNumber(document.getElementById("Masters_Degree_Marks_Obtained").value))
 {
	window.alert("Please enter valid Marks of Post Graduation");
	document.getElementById("Masters_Degree_Marks_Obtained").value='';
	document.getElementById("Masters_Degree_Marks_Obtained").focus();
	return false;	
 }
}
function MscPercentage()
{
	 if(!f_isNumber(document.getElementById("Masters_Degree_Percentage_Marks").value))
 {
	window.alert("Please enter valid percentage of Post Graduation");
	document.getElementById("Masters_Degree_Percentage_Marks").value='';
	document.getElementById("Masters_Degree_Percentage_Marks").focus();
	return false;	
 }
}

 function MscGrade()
{
	if(IsValidName(document.getElementById("Masters_Degree_Class_Division").value))
 {
	window.alert("Please enter valid grade of Graduation");
	document.getElementById("Masters_Degree_Class_Division").value='';
	document.getElementById("Masters_Degree_Class_Division").focus();
	return false;	
 }
}
 
function MPhilUni()
{
	 if(IsValidName(document.getElementById("M_Phil_Degree_University").value))
 {
	window.alert("Please enter valid University Name of Post Graduation");
	document.getElementById("M_Phil_Degree_University").value='';
	document.getElementById("M_Phil_Degree_University").focus();
	return false;	
 }
}
 function MPhilYearOfPass()
{
	if(!f_isNumber(document.getElementById("M_Phil_Degree_Month_Year_Passing").value))
 {
	window.alert("Please enter valid passing year of Post Graduation");
	document.getElementById("M_Phil_Degree_Month_Year_Passing").value='';
	document.getElementById("M_Phil_Degree_Month_Year_Passing").focus();
	return false;	
 }
}
 
  function MPhilSub()
{
	if(IsValidName(document.getElementById("M_Phil_Degree_Subject_Offered").value))
 {
	window.alert("Please enter valid subjects of Post Graduation");
	document.getElementById("M_Phil_Degree_Subject_Offered").value='';
	document.getElementById("M_Phil_Degree_Subject_Offered").focus();
	return false;	
 }
}
  
  function MPhilMarks()
{
	 if(!f_isNumber(document.getElementById("M_Phil_Degree_Marks_Obtained").value))
 {
	window.alert("Please enter valid Marks of Post Graduation");
	document.getElementById("M_Phil_Degree_Marks_Obtained").value='';
	document.getElementById("M_Phil_Degree_Marks_Obtained").focus();
	return false;	
 }
}
  function MPhilPercentage()
{
	if(!f_isNumber(document.getElementById("M_Phil_Degree_Percentage_Marks").value))
 {
	window.alert("Please enter valid percentage of Post Graduation");
	document.getElementById("M_Phil_Degree_Percentage_Marks").value='';
	document.getElementById("M_Phil_Degree_Percentage_Marks").focus();
	return false;	
 }
}
 
  function MPhilGrade()
{
	if(IsValidName(document.getElementById("M_Phil_Degree_Class_Division").value))
 {
	window.alert("Please enter valid grade of Graduation");
	document.getElementById("M_Phil_Degree_Class_Division").value='';
	document.getElementById("M_Phil_Degree_Class_Division").focus();
	return false;	
 }
 
}
 function PhdUni()
{
	 if(IsValidName(document.getElementById("PhD_Degree_Degree_University").value))
 {
	window.alert("Please enter valid University Name of Post Graduation");
	document.getElementById("PhD_Degree_Degree_University").value='';
	document.getElementById("PhD_Degree_Degree_University").focus();
	return false;	
 }
}
 function PhDYearOfPass()
{
	if(!f_isNumber(document.getElementById("PhD_Degree_Degree_Month_Year_Passing").value))
 {
	window.alert("Please enter valid passing year of Ph.D.");
	document.getElementById("PhD_Degree_Degree_Month_Year_Passing").value='';
	document.getElementById("PhD_Degree_Degree_Month_Year_Passing").focus();
	return false;	
 }
} 
 
  function PhDSub()
{
	 if(IsValidName(document.getElementById("PhD_Degree_Degree_Subject_Offered").value))
 {
	window.alert("Please enter valid subjects of Ph.D.");
	document.getElementById("PhD_Degree_Degree_Subject_Offered").value='';
	document.getElementById("PhD_Degree_Degree_Subject_Offered").focus();
	return false;	
 }
} 
 
   function PhDMarks()
{
	if(!f_isNumber(document.getElementById("PhD_Degree_Degree_Marks_Obtained").value))
 {
	window.alert("Please enter valid Marks of Ph.D.");
	document.getElementById("PhD_Degree_Degree_Marks_Obtained").value='';
	document.getElementById("PhD_Degree_Degree_Marks_Obtained").focus();
	return false;	
 }
} 
  function PhDPercentage()
{
	 if(!f_isNumber(document.getElementById("PhD_Degree_Degree_Percentage_Marks").value))
 {
	window.alert("Please enter valid percentage of Ph.D.");
	document.getElementById("PhD_Degree_Degree_Percentage_Marks").value='';
	document.getElementById("PhD_Degree_Degree_Percentage_Marks").focus();
	return false;	
 }
} 
 function PhDGrade()
{
	if(IsValidName(document.getElementById("PhD_Degree_Degree_Class_Division").value))
 {
	window.alert("Please enter valid grade of Ph.D.");
	document.getElementById("PhD_Degree_Degree_Class_Division").value='';
	document.getElementById("PhD_Degree_Degree_Class_Division").focus();
	return false;	
 }
} 
 
 function NetSetUni()
{
	if(IsValidName(document.getElementById("NET_SET_CSIR_Degree_University").value))
 {
	window.alert("Please enter valid University Name of Post Graduation");
	document.getElementById("NET_SET_CSIR_Degree_University").value='';
	document.getElementById("NET_SET_CSIR_Degree_University").focus();
	return false;	
 }
} 
 
 function NetSetYearOfPass()
{
	if(!f_isNumber(document.getElementById("NET_SET_CSIR_Degree_Month_Year_Passing").value))
 {
	window.alert("Please enter valid passing year of Set/Net");
	document.getElementById("NET_SET_CSIR_Degree_Month_Year_Passing").value='';
	document.getElementById("NET_SET_CSIR_Degree_Month_Year_Passing").focus();
	return false;	
 }
} 
 
function NetSetSub()
{
	 if(IsValidName(document.getElementById("NET_SET_CSIR_Degree_Subject_Offered").value))
 {
	window.alert("Please enter valid subjects of Set/Net.");
	document.getElementById("NET_SET_CSIR_Degree_Subject_Offered").value='';
	document.getElementById("NET_SET_CSIR_Degree_Subject_Offered").focus();
	return false;	
 }
}  
 function NetSetMarks()
{
	if(!f_isNumber(document.getElementById("NET_SET_CSIR_Degree_Marks_Obtained").value))
 {
	window.alert("Please enter valid Marks of Set/Net");
	document.getElementById("NET_SET_CSIR_Degree_Marks_Obtained").value='';
	document.getElementById("NET_SET_CSIR_Degree_Marks_Obtained").focus();
	return false;	
 }
} 
  function NetSetPercentage()
{
	 if(!f_isNumber(document.getElementById("NET_SET_CSIR_Degree_Percentage_Marks").value))
 {
	window.alert("Please enter valid percentage of Set/Net.");
	document.getElementById("NET_SET_CSIR_Degree_Percentage_Marks").value='';
	document.getElementById("NET_SET_CSIR_Degree_Percentage_Marks").focus();
	return false;	
 }
} 
 
  function NetSetGrade()
{
	if(IsValidName(document.getElementById("NET_SET_CSIR_Degree_Class_Division").value))
 {
	window.alert("Please enter valid grade of Set/Net");
	document.getElementById("NET_SET_CSIR_Degree_Class_Division").value='';
	document.getElementById("NET_SET_CSIR_Degree_Class_Division").focus();
	return false;	
 }
 
} 

 function ExpUni1()
{
	if(IsValidName(document.getElementById("University_College_Institute_1").value))
 {
	window.alert("Please enter valid University Name");
	document.getElementById("University_College_Institute_1").value='';
	document.getElementById("University_College_Institute_1").focus();
	return false;	
 } 
} 
function ExpDesg1()
{
	if(IsValidName(document.getElementById("Designation_Post_Held_1").value))
 {
	window.alert("Please enter valid Designation of post held");
	document.getElementById("Designation_Post_Held_1").value='';
	document.getElementById("Designation_Post_Held_1").focus();
	return false;	
 } 
} 

function ExpSub1()
{
	if(IsValidName(document.getElementById("Subjects_Classes_Taught_1").value))

 {
	window.alert("Please enter valid subject names you taught");
	document.getElementById("Subjects_Classes_Taught_1").value='';
	document.getElementById("Subjects_Classes_Taught_1").focus();
	return false;	
 } 
}   
function ExpUni2()
{
	if(IsValidName(document.getElementById("University_College_Institute_2").value))
 {
	window.alert("Please enter valid University Name");
	document.getElementById("University_College_Institute_2").value='';
	document.getElementById("University_College_Institute_2").focus();
	return false;	
 } 
}  
 
function ExpDesg2()
{
	if(IsValidName(document.getElementById("Designation_Post_Held_2").value))
 {
	window.alert("Please enter valid Designation of post held");
	document.getElementById("Designation_Post_Held_2").value='';
	document.getElementById("Designation_Post_Held_2").focus();
	return false;	
 }
}   
function ExpSub2()
{
	if(IsValidName(document.getElementById("Subjects_Classes_Taught_2").value))
 {
	window.alert("Please enter valid subject names you taught");
	document.getElementById("Subjects_Classes_Taught_2").value='';
	document.getElementById("Subjects_Classes_Taught_2").focus();
	return false;	
 } 
}   
function ExpUni3()
{
	if(IsValidName(document.getElementById("University_College_Institute_3").value))
 {
	window.alert("Please enter valid University Name");
	document.getElementById("University_College_Institute_3").value='';
	document.getElementById("University_College_Institute_3").focus();
	return false;	
 } 
}   
 
function ExpDesg3()
{
	if(IsValidName(document.getElementById("Designation_Post_Held_3").value))
 {
	window.alert("Please enter valid Designation of post held");
	document.getElementById("Designation_Post_Held_3").value='';
	document.getElementById("Designation_Post_Held_3").focus();
	return false;	
 } 
}   
 
function ExpSub3()
{
	if(IsValidName(document.getElementById("Subjects_Classes_Taught_3").value))
 {
	window.alert("Please enter valid subject names you taught");
	document.getElementById("Subjects_Classes_Taught_3").value='';
	document.getElementById("Subjects_Classes_Taught_3").focus();
	return false;	
 } 
}    
 
function ExpUni4()
{
	if(IsValidName(document.getElementById("University_College_Institute_4").value))
 {
	window.alert("Please enter valid University Name");
	document.getElementById("University_College_Institute_4").value='';
	document.getElementById("University_College_Institute_4").focus();
	return false;	
 } 
} 
 
 function ExpDesg4()
{
	if(IsValidName(document.getElementById("Designation_Post_Held_4").value))
 {
	window.alert("Please enter valid Designation of post held");
	document.getElementById("Designation_Post_Held_4").value='';
	document.getElementById("Designation_Post_Held_4").focus();
	return false;	
 } 
}  
 
 function ExpSub4()
{
	if(IsValidName(document.getElementById("Subjects_Classes_Taught_4").value))
 {
	window.alert("Please enter valid subject names you taught");
	document.getElementById("Subjects_Classes_Taught_4").value='';
	document.getElementById("Subjects_Classes_Taught_4").focus();
	return false;	
 } 
} 
 
 function ExpUni5()
{
	if(IsValidName(document.getElementById("University_College_Institute_5").value))
 {
	window.alert("Please enter valid University Name");
	document.getElementById("University_College_Institute_5").value='';
	document.getElementById("University_College_Institute_5").focus();
	return false;	
 } 
} 
 function ExpDesg5()
{
	 if(IsValidName(document.getElementById("Designation_Post_Held_5").value))
 {
	window.alert("Please enter valid Designation of post held");
	document.getElementById("Designation_Post_Held_5").value='';
	document.getElementById("Designation_Post_Held_5").focus();
	return false;	
 } 
}
 
function ExpSub5()
{
	if(IsValidName(document.getElementById("Subjects_Classes_Taught_5").value))
 {
	window.alert("Please enter valid subject names you taught");
	document.getElementById("Subjects_Classes_Taught_5").value='';
	document.getElementById("Subjects_Classes_Taught_5").focus();
	return false;	
 } 
} 
 function AreaExp()
{
	
  if(IsValidName(document.getElementById("Area_Expertise").value))
 {
	window.alert("Please enter valid area of expertise");
	document.getElementById("Area_Expertise").value='';
	document.getElementById("Area_Expertise").focus();
	return false;	
 } 
} 

function SubTeach()
{
	if(IsValidName(document.getElementById("Subject_able_to_teach").value))
 {
	window.alert("Please enter valid subject name which you able to teach");
	document.getElementById("Subject_able_to_teach").value='';
	document.getElementById("Subject_able_to_teach").focus();
	return false;	
 } 
}  



