/***************************************************************************/
/*     PROGRAMMER     :  SDYA                                              */
/*     SCRIPT NAME    :  js1.js					                           */
/*     CREATED ON     :  24/MAR/2005                                       */
/*     LAST MODIFIED  :  26/MAR/2005									   */
/*     Modified On    :  29/MAR/2005 									   */
/*     Modified By    :  DPT 											   */
/*     Modified On    :  06/APR/2005 									   */
/*     Modified By    :  SDYA 											   */
/*     Modified On    :  07/APR/2005 									   */
/*     Modified By    :  SDYA 											   */
/*     Modified On    :  13/APR/2005 									   */
/*     Modified By    :  SDYA 											   */ 
/*     MODIFIED ON    :  20/APR/2005									   */
/*     MODIFIED BY    :  SDYA         									   */
/*     MODIFIED ON    :  23/APR/2005									   */
/*     MODIFIED BY    :  SDYA         									   */
/*     MODIFIED ON    :  25/APR/2005									   */
/*     MODIFIED BY    :  SDYA         									   */
/*     MODIFIED ON    :  26/APR/2005									   */
/*     MODIFIED BY    :  SDYA         									   */
/*     MODIFIED ON    :  29/APR/2005									   */
/*     MODIFIED BY    :  SDYA         									   */
/*                                                                         */
/*     Java Script Functions For the Site                                  */
/***************************************************************************/

    /*----------------------------------------------------------------
    Description   :- function to validate the login form
    Programmer    :- SDYA
    Last Modified :- 24/MAR/2005
    -------------------------------------------------------------------*/
    function signin_validate()
    {
        // user name
        if(document.frm_login.txt_username.value=='')
        {
            alert("Please enter your user name");
            document.frm_login.txt_username.focus();
            return false;
        }
        // password
        if(document.frm_login.txt_password.value=='')
        {
            alert("Please enter your password");
            document.frm_login.txt_password.focus();
            return false;
        }
        return true;
    }

    /*----------------------------------------------------------------
    Description   :- function to validate the login form on the left menu
    Programmer    :- SDYA
    Last Modified :- 28/MAR/2005
    -------------------------------------------------------------------*/
    function signin1_validate()
    {
        // user name
        if(document.frm_login1.txt_username.value=='')
        {
            alert("Please enter your user name");
            document.frm_login1.txt_username.focus();
            return false;
        }
        // password
        if(document.frm_login1.txt_password.value=='')
        {
            alert("Please enter your password");
            document.frm_login1.txt_password.focus();
            return false;
        }
        return true;
    }

    /*----------------------------------------------------------------
    Description   :- function to validate the forgot password form
    Programmer    :- SDYA
    Last Modified :- 24/MAR/2005
    -------------------------------------------------------------------*/
    function forgotpassword_validate()
    {
    	// user name
        if(document.frm_forgotpassword.txt_username.value=='')
        {
        	alert("Please enter your user name");
            document.frm_forgotpassword.txt_username.focus();
            return false;
        }
        return true;
    }

    /*----------------------------------------------------------------
    Description   :- function to validate the sign up page
    Programmer    :- SDYA
    Last Modified :- 25/MAR/2005
	Modified On   :- 29/MAR/2005
	Modified By   :- DPT
    -------------------------------------------------------------------*/
    function signup_validate()
    {
    	// first name
        if(document.frm_signup.txt_firstname.value=='')
        {
        	alert("Please enter the first name");
            document.frm_signup.txt_firstname.focus();
            return false;
        }

        // last name
        if(document.frm_signup.txt_lastname.value=='')
        {
        	alert("Please enter the last name");
            document.frm_signup.txt_lastname.focus();
            return false;
        }

		//country
        if(document.frm_signup.cbocountry.value=='')
        {
        	alert("Please select your country name");
            document.frm_signup.cbocountry.focus();
            return false;
        }

        // email
        if(document.frm_signup.txt_email.value=='')
        {
        	alert("Please enter your email id");
            document.frm_signup.txt_email.focus();
            return false;
        }

        //if user type is Company then ask for logo
        if(document.frm_signup.rad_usertype[0].checked)
        {
        	//if no logo chosen
            if(document.frm_signup.txt_image.value=="")
            {
            	alert("Please upload your company logo");
                document.frm_signup.txt_image.focus();
                return false;
            }
        }

        // username
        if(document.frm_signup.txt_username.value=='')
        {
        	alert("Please enter the user name");
            document.frm_signup.txt_username.focus();
            return false;
        }

        // password
        if(document.frm_signup.txt_password.value=='')
        {
        	alert("Please enter your password");
            document.frm_signup.txt_password.focus();
            return false;
        }

        // re password
        if(document.frm_signup.txt_repassword.value=='')
        {
        	alert("Please confirm your password");
            document.frm_signup.txt_repassword.focus();
            return false;
        }

        // confirm password
        if(document.frm_signup.txt_repassword.value!=document.frm_signup.txt_password.value)
        {
        	alert("Please confirm your password");
            document.frm_signup.txt_repassword.focus();
            return false;
        }

    }

	/*----------------------------------------------------------------
    Description   :- function to validate the change profile page
    Programmer    :- SDYA
    Last Modified :- 25/MAR/2005
    -------------------------------------------------------------------*/
	function change_profile_validate()
	{
    	// first name
        if(document.frm_signup.txt_firstname.value=='')
        {
        	alert("Please enter the first name");
            document.frm_signup.txt_firstname.focus();
            return false;
        }

        // last name
        if(document.frm_signup.txt_lastname.value=='')
        {
        	alert("Please enter the last name");
            document.frm_signup.txt_lastname.focus();
            return false;
        }

		//country
        if(document.frm_signup.cbocountry.value=='')
        {
        	alert("Please select your country name");
            document.frm_signup.cbocountry.focus();
            return false;
        }

        // email
        if(document.frm_signup.txt_email.value=='')
        {
        	alert("Please enter your email id");
            document.frm_signup.txt_email.focus();
            return false;
        }
	}

    /*----------------------------------------------------------------
    Description   :- function to validate change password form
    Programmer    :- SDYA
    Last Modified :- 25/MAR/2005
    -------------------------------------------------------------------*/
    function changepassword_validate()
    {
		// old password
    	if(document.frm_password.txt_oldpassword.value=='')
        {
        	alert("Please enter your old password");
            document.frm_password.txt_oldpassword.focus();
            return false;
        }

		// new password
    	if(document.frm_password.txt_password.value=='')
        {
        	alert("Please enter your new password");
            document.frm_password.txt_password.focus();
            return false;
        }

		// retype password
    	if(document.frm_password.txt_repassword.value=='')
        {
        	alert("Please re-type your password");
            document.frm_password.txt_repassword.focus();
            return false;
        }

        // confirm password
        if(document.frm_password.txt_password.value!=document.frm_password.txt_repassword.value)
        {
			alert("Please confirm your password");
            document.frm_password.txt_repassword.focus();
            return false;
        }
    }

    /*----------------------------------------------------------------
    Description   :- function to validate the post bid form
    Programmer    :- SDYA
    Last Modified :- 24/MAR/2005
    -------------------------------------------------------------------*/
    function bidding_validate()
    {
    	// company name
        if(document.frm_bidding.cbocompany.value=='')
        {
        	alert("Please select the company name");
            document.frm_bidding.cbocompany.focus();
            return false;
        }
    	// bid amount
        if(document.frm_bidding.txt_bidamount.value=='')
        {
        	alert("Please enter the bid amount");
            document.frm_bidding.txt_bidamount.focus();
            return false;
        }
        return true;
    }

    /*----------------------------------------------------------------
    Description   :- function to validate add resume form
    Programmer    :- SDYA
    Last Modified :- 26/MAR/2005
    -------------------------------------------------------------------*/
    function addresume_validate()
    {
    	// resume title
        if(document.frm_resume.txt_title.value=='')
        {
        	alert("Please enter the resume title");
            document.frm_resume.txt_title.focus();
            return false;
        }
		// resume file
		 if(document.frm_resume.txt_resume_file.value=='')
        {
        	alert("Please upload your resume.");
            document.frm_resume.txt_resume_file.focus();
            return false;
        }
        return true;
    }
	
	/*----------------------------------------------------------------
    Description   :- function to validate add resume form
    Programmer    :- SDYA
    Last Modified :- 26/MAR/2005
    -------------------------------------------------------------------*/
    function manage_coverletter_validate()
    {
    	// letter title
        if(document.frm_coverletter.txt_title.value=='')
        {
        	alert("Please enter the letter title");
            document.frm_coverletter.txt_title.focus();
            return false;
        }
    	// letter subject
        if(document.frm_coverletter.txt_subject.value=='')
        {
        	alert("Please enter the letter subject");
            document.frm_coverletter.txt_subject.focus();
            return false;
        }
    	// letter content
        if(document.frm_coverletter.txta_body.value=='')
        {
        	alert("Please enter the letter content");
            document.frm_coverletter.txta_body.focus();
            return false;
        }
        return true;
    }

    /*----------------------------------------------------------------
    Description   :- function to confirm the deletion of a record
    				 id1 and id2 are other extra ids which are to be passed
    Programmer    :- SDYA
    Last Modified :- 26/MAR/2005
    Modified On   :- 30/MAR/2005
    Modified By   :- DPT
    -------------------------------------------------------------------*/
    function deleteconfirm(page,name,id,id1,id2)
    {
	  if(id1==undefined) id1 = 0;
        if(id2==undefined) id2 = 0;
        if(confirm("Are you sure you want to delete this " + name + "?\nIf 'OK' all the information associated with this " + name + " will be removed from the system."))
        	window.location = page + "?id=" + id + "&name=" + name + "&id1=" + id1 + "&id2=" + id2;
    }

    /*----------------------------------------------------------------
    Description   :- function to start pop up window
    Programmer    :- SDYA
    Last Modified :- 30/MAR/2005
    -------------------------------------------------------------------*/
	function MM_openBrWindow(theURL,winName,features)
	{ //v2.0
  		window.open(theURL,winName,features);
	}

    /*----------------------------------------------------------------
    Description   :- function to check the form
    Programmer    :- SDYA
    Last Modified :- 31/MAR/2005
    -------------------------------------------------------------------*/
	//start check form
	function MM_findObj(n, d)
    { //v4.01
  		var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  		if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function YY_checkform()
    { //v4.71
//copyright (c)1998,2002 Yaromat.com
  var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
  for (i=1; i<a.length;i=i+4){
    if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
    o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
    o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
    v=o.value;t=a[i+2];
    if (o.type=='text'||o.type=='password'||o.type=='hidden'||o.type=='file'){ 
      if (r&&v.length==0){err=true}
      if (v.length>0)
      if (t==1){ //fromto
        ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
      } else if (t==2){
        rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
      } else if (t==3){ // date
        ma=a[i+1].split("#");at=v.match(ma[0]);
        if(at){
          cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
          dte=new Date(cy,cm,cd);
          if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
        }else{err=true}
      } else if (t==4){ // time
        ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
      } else if (t==5){ // check this 2
            if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!o1.checked){err=true}
      } else if (t==6){ // the same
            if(v!=MM_findObj(a[i+1]).value){err=true}
      }
    } else
    if (!o.type&&o.length>0&&o[0].type=='radio'){
          at = a[i].match(/(.*)\[(\d+)\].*/i);
          o2=(o.length>1)?o[at[2]]:o;
      if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
      if (t==2){
        oo=false;
        for(j=0;j<o.length;j++){oo=oo||o[j].checked}
        if(!oo){s+='* '+a[i+3]+'\n'}
      }
    } else if (o.type=='checkbox'){
      if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
    } else if (o.type=='select-one'||o.type=='select-multiple'){
      if(t==1&&o.selectedIndex/1==0){err=true}
    }else if (o.type=='textarea'){
      if(v.length<a[i+1]){err=true}
    }
    if (err){s+='* '+a[i+3]+'\n'; err=false}
  }

  //in case of sign up check for password length
  if(a[0]=="sign_up1")
  {
  	o = MM_findObj(a[17]);
    var password = o.value;
    if(password.length>0)
    {
    	if(password.length<6)
    	{
    		s+='Password should have minimum 6 characters';
	    }
    	if(password.length>30)
    	{
    		s+='Password should have maximum 30 characters';
	    }
    }
  }

  if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)}
  document.MM_returnValue = (s=='');
}
//end check form

    /*----------------------------------------------------------------
    Description   :- function onload display
    Programmer    :- SDYA
    Last Modified :- 02/APR/2005
    -------------------------------------------------------------------*/
	function onload_display()
	{
	    for (var i = 0; i < document.resume17.rdo_resume_setting.length; i++)
	    {
	      if (document.resume17.rdo_resume_setting[i].checked)
	        {
	            str = document.resume17.rdo_resume_setting[i].value;
	            if(str=="0")
	            {
	                document.resume17.chk_employer.checked=false;
	                document.resume17.chk_staff_firm.checked=false;
	                document.resume17.chk_employer.disabled=true;
	                document.resume17.chk_staff_firm.disabled=true;
	            }
	            break;
	        }
	    }
	}

    /*----------------------------------------------------------------
    Description   :- function rdo_resume_setting_onchange 
    Programmer    :- SDYA
    Last Modified :- 02/APR/2005
    -------------------------------------------------------------------*/
	function rdo_resume_setting_onchange()
	{
	    document.resume17.chk_employer.checked=false;
	    document.resume17.chk_staff_firm.checked=false;
	    document.resume17.chk_employer.disabled=true;
	    document.resume17.chk_staff_firm.disabled=true;
	}

    /*----------------------------------------------------------------
    Description   :- function nonpvt_resume_setting onchange
    Programmer    :- SDYA
    Last Modified :- 02/APR/2005
    -------------------------------------------------------------------*/
	function nonpvt_resume_setting_onchange()
	{
	    document.resume17.chk_employer.disabled=false;
	    document.resume17.chk_staff_firm.disabled=false;
	    document.resume17.chk_employer.checked=true;
	    document.resume17.chk_staff_firm.checked=true;
	}

    /*----------------------------------------------------------------
    Description   :- function check_validate
    Programmer    :- SDYA
    Last Modified :- 02/APR/2005
    -------------------------------------------------------------------*/
	function check_validate()
	{
	    for (var i = 0; i < document.resume17.rdo_resume_setting.length; i++)
	    {
	        if (document.resume17.rdo_resume_setting[i].checked)
	        {
	            str = document.resume17.rdo_resume_setting[i].value;
	            if(str!="0")
	            {
	                if(!((document.resume17.chk_employer.checked || document.resume17.chk_staff_firm.checked )))
	                {
	                    alert("You must chooses at least one type of employer for searchable by option");
	                    return false;
	                }
	            }
	        }
	    }
	}

    /*----------------------------------------------------------------
    Description   :- function nosearchable
    Programmer    :- SDYA
    Last Modified :- 02/APR/2005
    -------------------------------------------------------------------*/
	function nosearchable(max)
	{
	/*	alert("here");
		alert(max);*/
		if(max=="Undefined")
		{
		 var del = window.confirm("No Searchable Resume will be There")
         if(del==false)  return false;
		}
		else
		{
			if(document.resume17.rdo_resume_setting[max].checked)
			{
				var con = window.confirm("Your Resume will not Get Listed in Any Company Search Results, if you Chooses All private")
				if(con == false)  return false;
			}
		}
	}
	
	function delvalidate()
    {
         var del = window.confirm("Are you sure you need to Delete this Resume? You cannot Recover this Resume Back.")
         if(del==false)  return false;
   	}

	function delevalidate()
	{
        var del = window.confirm("Are you sure you need to Reset the Statistic")
       	if(del==false)  return false;
   	}

	/*function nosearchable()
	{
         var del = window.confirm("No Searchable Resume will be There")
         if(del==false)  return false;
   	}*/
	
    /*----------------------------------------------------------------
    Description   :- function to validate applicant add/edit
    Programmer    :- SDYA
    Last Modified :- 05/APR/2005
    -------------------------------------------------------------------*/
	function applicant_add_validate()
	{
    	// first name
        if(document.frm_applicant.txt_firstname.value=='')
        {
        	alert("Please enter the first name");
            document.frm_applicant.txt_firstname.focus();
            return false;
        }

        // last name
        if(document.frm_applicant.txt_lastname.value=='')
        {
        	alert("Please enter the last name");
            document.frm_applicant.txt_lastname.focus();
            return false;
        }

		//country
        if(document.frm_applicant.cbocountry.value=='')
        {
        	alert("Please select your country name");
            document.frm_applicant.cbocountry.focus();
            return false;
        }

        // email
        if(document.frm_applicant.txt_email.value=='')
        {
        	alert("Please enter your email id");
            document.frm_applicant.txt_email.focus();
            return false;
        }

        // username
        if(document.frm_applicant.txt_username.value=='')
        {
        	alert("Please enter the user name");
            document.frm_applicant.txt_username.focus();
            return false;
        }

        // password
        if(document.frm_applicant.txt_password.value=='')
        {
        	alert("Please enter your password");
            document.frm_applicant.txt_password.focus();
            return false;
        }

        // re password
        if(document.frm_applicant.txt_repassword.value=='')
        {
        	alert("Please confirm your password");
            document.frm_applicant.txt_repassword.focus();
            return false;
        }

        // confirm password
        if(document.frm_applicant.txt_repassword.value!=document.frm_applicant.txt_password.value)
        {
        	alert("Please confirm your password");
            document.frm_applicant.txt_repassword.focus();
            return false;
        }
	}

    /*----------------------------------------------------------------
    Description   :- function to move the list up
    Programmer    :- SDYA
    Last Modified :- 06/APR/2005
    -------------------------------------------------------------------*/

function moveUpList() {
	
var listField =eval("document.reorder_delete_item.list_section");

   if ( listField.length == -1) {  // If the list is empty
      alert("There are no values which can be moved!");
   } else {
      var selected = listField.selectedIndex;
      if (selected == -1) {
         alert("You must select a section to be moved!");
      } else {  // Something is selected
         if ( listField.length == 0 ) {  // If there's only one in the list
            alert("There is only one section!\nThe one section will remain in place.");
         } else {  // There's more than one in the list, rearrange the list order
            if ( selected == 0 ) {
               alert("The selected section is at the first of the list and cannot be moved up.");
            } else {
               // Get the text/value of the one directly above the hightlighted entry as
               // well as the highlighted entry; then flip them
               var moveText1 = listField[selected-1].text;
               var moveText2 = listField[selected].text;
               var moveValue1 = listField[selected-1].value;
               var moveValue2 = listField[selected].value;
               listField[selected].text = moveText1;
               listField[selected].value = moveValue1;
               listField[selected-1].text = moveText2;
               listField[selected-1].value = moveValue2;
               listField.selectedIndex = selected-1; // Select the one that was selected before
            }  // Ends the check for selecting one which can be moved
         }  // Ends the check for there only being one in the list to begin with
      }  // Ends the check for there being something selected
   }  // Ends the check for there being none in the list
}

    /*----------------------------------------------------------------
    Description   :- function to move the list down
    Programmer    :- SDYA
    Last Modified :- 06/APR/2005
    -------------------------------------------------------------------*/

function moveDownList() {
var listField =eval("document.reorder_delete_item.list_section");
   if ( listField.length == -1) {  // If the list is empty
      alert("There are no values which can be moved!");
   } else {
      var selected = listField.selectedIndex;
      if (selected == -1) {
         alert("You must select a section to be moved!");
      } else {  // Something is selected
         if ( listField.length == 0 ) {  // If there's only one in the list
            alert("There is only one section!\nThe one section will remain in place.");
         } else {  // There's more than one in the list, rearrange the list order
            if ( selected == listField.length-1 ) {
               alert("The selected section is at the bottom of the list and cannot be moved down.");
            } else {
               // Get the text/value of the one directly below the hightlighted entry as
               // well as the highlighted entry; then flip them
               var moveText1 = listField[selected+1].text;
               var moveText2 = listField[selected].text;
               var moveValue1 = listField[selected+1].value;
               var moveValue2 = listField[selected].value;
               listField[selected].text = moveText1;
               listField[selected].value = moveValue1;
               listField[selected+1].text = moveText2;
               listField[selected+1].value = moveValue2;
               listField.selectedIndex = selected+1; // Select the one that was selected before
            }  // Ends the check for selecting one which can be moved
         }  // Ends the check for there only being one in the list to begin with
      }  // Ends the check for there being something selected
   }  // Ends the check for there being none in the list
}


	/*----------------------------------------------------------------
	Description   :- function to edit order customised section details
	Programmer    :- SDYA
	Last Modified :- 06/APR/2005
	-------------------------------------------------------------------*/

function presubmit()
{

	 var listField =eval("document.reorder_delete_item.list_section");
     var n=listField.length;     // geting length of list
     var str="";
	 var i=0;

  for (i=0;n>i;i++)

    {
        	str +="~"+listField.options[i].value;
    }

		document.reorder_delete_item.ord.value=str;  // value setting on hidden field
        document.reorder_delete_item.submit();       // form submitting
}

	/*----------------------------------------------------------------
	Description   :- function to remove selected options
	Programmer    :- SDYA
	Last Modified :- 06/APR/2005
	-------------------------------------------------------------------*/

function removeSelectedOptions(one,two,three)
 	{

 	var from =eval("document.reorder_delete_item.list_section");
    var selected = from.selectedIndex;
    if (selected == -1) 
		{
        alert("You must select a section to be removed!");
      	}

	for (var i=(from.options.length-1); i>=0; i--) 
		{
		var o=from.options[i];
		if (o.selected) 
			{
			if(from.options[i].value == one || from.options[i].value == two || from.options[i].value == three)
				{
				alert("Sorry, You Cant Delete this Section")
				break;
				}
			else
				{
				var con = window.confirm("You will be Loosing this Section, Once you Click 'I'm Done Editing' After 'Submit Change'. Then You will not be Able to Undo this Change")
				if(con == false)  return false;
				}
			from.options[i] = null;
            break;

			}
		}
	from.selectedIndex = -1;
	}

    /*----------------------------------------------------------------
    Description   :- function to validate the forward resumes form
    Programmer    :- SDYA
    Last Modified :- 07/APR/2005
    -------------------------------------------------------------------*/
    function forward_resumes_validate()
    {
    	// company name
        if(document.frm_forward_resumes.cbocompany.value=='')
        {
        	alert("Please select the company name");
            document.frm_forward_resumes.cbocompany.focus();
            return false;
        }
		return true;
	}

//start put focus on the first form element and kill google auto fill
function firstFocus_killGoogleAutoFill()
{
   if (document.forms.length > 0)
   {
      var TForm = document.forms[0];
      for (i=0;i<TForm.length;i++)
      {
         if ((TForm.elements[i].type=="text")||
           (TForm.elements[i].type=="textarea")||
           (TForm.elements[i].type.toString().charAt(0)=="s"))
         {
            document.forms[0].elements[i].focus();
            break;
         }
      }
   }
  is = document.getElementsByTagName("INPUT");
  for(i=0;i<is.length;i++)
    is[i].style.backgroundColor = "";
  ss = document.getElementsByTagName("SELECT");
  for(i=0;i<ss.length;i++)
    ss[i].style.backgroundColor = "";
}
window.onload=firstFocus_killGoogleAutoFill;
//end of put focus...
//start switch class
function pviiClassNew(obj, new_style) { //v2.7 by PVII
  obj.className=new_style;
}
//en switch class

    /*----------------------------------------------------------------
    Description   :- function to confirm saved search deletion
    Programmer    :- SDYA
    Last Modified :- 07/APR/2005
    -------------------------------------------------------------------*/
	function deleteconfirm(url)
	{
		if(confirm("Are you sure you want to delete this?"))
			window.location = url;
	}

    /*----------------------------------------------------------------
    Description   :- function in search result page
    Programmer    :- SDYA
    Last Modified :- 18/APR/2005
    -------------------------------------------------------------------*/
	function select1_onchange()
   	{
        var val =document.search_result.txt_keyword.value ;
        if(val=="")
        {
        	alert("Select a keyword before you submit.");
        }
        else
        {
          	document.search_result.flag.value="search";
          	document.search_result.action="quick_search_validate.php";
	      	document.search_result.submit();
        }
  	}
	
    /*----------------------------------------------------------------
    Description   :- functions for  edit search resumes
    Programmer    :- SDYA
    Last Modified :- 20/APR/2005
    -------------------------------------------------------------------*/
	function SelCountEditValidate()
    {
      	var testlen1 = document.edit_saved_search.list_job_cate1.length;
        var testlen2 = document.edit_saved_search.list_lang1.length;
        var ct = 0;
                var ct1 = 0;
                	for (i = 0; i < testlen1; i++)
                if(document.edit_saved_search.list_job_cate1[i].selected)
                {
                ct++;
                }
                if(ct >= 6)
                {
                alert("Select up to 5 categories that apply to the resume you are looking for.");
                return false;
                }
                else
                {
                	for (j = 0; j < testlen2; j++)
                if(document.edit_saved_search.list_lang1[j].selected)
                {
                ct1++;
                }
                if(ct1 >= 6)
                {
                alert("Select up to 5 Languages that apply to the resume you are looking for.");
                return false;
        	}
    	}
   	}
	
    /*----------------------------------------------------------------
    Description   :- function to validate the schedule interview form
    Programmer    :- SDYA
    Last Modified :- 20/APR/2005
    -------------------------------------------------------------------*/
    function schedule_interview_validate()
    {
        // selection criteria
		if(document.frm_schedule_interview.txt_search.value=='')
        {
            alert("Please enter the search text");
            document.frm_schedule_interview.txt_search.focus();
            return false;
        }
        return true;
	}

	/*----------------------------------------------------------------
    Description   :- function to validate the search applicants form
    Programmer    :- SDYA
    Last Modified :- 21/APR/2005
    -------------------------------------------------------------------*/
    function search_applicants_validate()
    {
        // search text
		if(document.frm_search_applicants.txt_search.value=='')
        {
            alert("Please enter the search text");
            document.frm_search_applicants.txt_search.focus();
            return false;
        }
        // selection criteria
		if(document.frm_search_applicants.cbocriteria.value=='')
        {
            alert("Please select the criteria ");
            document.frm_search_applicants.cbocriteria.focus();
            return false;
        }
        return true;
	}
	
    /*----------------------------------------------------------------
    Description   :- function to validate the search job form(middle_home)
    Programmer    :- SDYA
    Last Modified :- 23/APR/2005
    -------------------------------------------------------------------*/
    function search_job_validate()
    {
    	// search text
        if(document.frm_index.textfield3.value=='')
        {
        	alert("Please enter the search text");
            document.frm_index.textfield3.focus();
            return false;
        }
        return true;
    }

    /*----------------------------------------------------------------
    Description   :- function to validate the search job/resume form(middle_home)
    Programmer    :- SDYA
    Last Modified :- 25/APR/2005
    -------------------------------------------------------------------*/
    function search_jobresume_validate()
    {
    	// job/resume title 
        if(document.frm_search_job_resume.textfield32.value=='')
        {
        	alert("Please enter the search text");
            document.frm_search_job_resume.textfield32.focus();
            return false;
        }
    	// skill level
        if(document.frm_search_job_resume.textfield322.value=='')
        {
        	alert("Please enter requirement/qualification");
            document.frm_search_job_resume.textfield322.focus();
            return false;
        }
        return true;
    }
	
    /*----------------------------------------------------------------
    Description   :- function to validate educationad add/edit
    Programmer    :- SDYA
    Last Modified :- 26/APR/2005
    -------------------------------------------------------------------*/
	function educationad_manage_validate()
	{
    	// institution name
        if(document.frm_education.txt_institution.value=='')
        {
        	alert("Please enter the name of the institution.");
            document.frm_education.txt_institution.focus();
            return false;
        }

        // address1
        if(document.frm_education.txta_address1.value=='')
        {
        	alert("Please enter the address");
            document.frm_education.txta_address1.focus();
            return false;
        }

        // course name
        if(document.frm_education.txt_course.value=='')
        {
        	alert("Please enter the course name");
            document.frm_education.txt_course.focus();
            return false;
        }

        // city
        if(document.frm_education.txt_location.value=='')
        {
        	alert("Please enter the city");
            document.frm_education.txt_location.focus();
            return false;
        }

        // course type
        if(document.frm_education.txt_edu_type.value=='')
        {
        	alert("Please enter the course type");
            document.frm_education.txt_edu_type.focus();
            return false;
        }

        // phone no.
        if(document.frm_education.txt_phone.value=='')
        {
        	alert("Please enter the phone number.");
            document.frm_education.txt_phone.focus();
            return false;
        }		
        
		// email
        if(document.frm_education.txt_email.value=='')
        {
        	alert("Please enter your email id");
            document.frm_education.txt_email.focus();
            return false;
        }
		
		//country
        if(document.frm_education.cbocountry.value=='')
        {
        	alert("Please select your country name");
            document.frm_education.cbocountry.focus();
            return false;
        }
		return true;
	}

    /*----------------------------------------------------------------
    Description   :- function to confirm the deletion of a record
    				 id1 and id2 are other extra ids which are to be passed
    Programmer    :- SDYA
    Last Modified :- 26/APR/2005
    -------------------------------------------------------------------*/
    function deleteconfirm1(page,name,id,id1,id2)
    {
	  if(id1==undefined) id1 = 0;
        if(id2==undefined) id2 = 0;
        if(confirm("Are you sure you want to delete this " + name + "?\nIf 'OK' all the information associated with this " + name + " will be removed from the system."))
        	window.location = page + "?id=" + id + "&name=" + name + "&id1=" + id1 + "&id2=" + id2;
    }

    /*----------------------------------------------------------------
    Description   :- function to validate the search education form
    Programmer    :- SDYA
    Last Modified :- 26/APR/2005
    -------------------------------------------------------------------*/
    function search_educations_validate()
    {
    	// course title 
        if(document.frm_search_educations.txt_search.value=='')
        {
        	alert("Please enter the search text");
            document.frm_search_educations.txt_search.focus();
            return false;
        }
        return true;
    }
	 
    /*----------------------------------------------------------------
    Description   :- function to validate the create applciation form
    Programmer    :- SDYA
    Last Modified :- 29/APR/2005
    -------------------------------------------------------------------*/
    function application_create_validate()
    {
    	// application title 
        if(document.frm_application.txt_name.value=='')
        {
        	alert("Please enter the application title.");
            document.frm_application.txt_name.focus();
            return false;
        }
        return true;
    }
	
	/*----------------------------------------------------------------
    Description   :- function to validate advertiser manage form
    Programmer    :- JEEN
    Last Modified :- 06/JUL/2005
    -------------------------------------------------------------------*/
    function advertiser_manage_validate()
    {
    	// advertiser name
        if(document.frm_banners.txt_name.value=='')
        {
        	alert("Please enter the Advertisement name");
            document.frm_banners.txt_name.focus();
            return false;
        }
		// image 
		 if(document.frm_banners.txt_image.value=='')
        {
        	alert("Please choose the image.");
            document.frm_banners.txt_image.focus();
            return false;
        }
        return true;
    }
	/*----------------------------------------------------------------
    Description   :- function to start pop up window
    Programmer    :- JEEN
    Last Modified :- 14/JUL/2005
    -------------------------------------------------------------------*/
	function banner_openWindow(image)
	{
        url = "bannerimage.php?image=" + image;
		nw = open(url,'Advertisement','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=1,copyhistory=no,width=600,height=350')
        nw.focus();
	}

