function chk_upload(mode)
{
	//alert("hi")
	if(document.candidate.FILE.value==""){
		alert("Please attach resume first.")
		document.candidate.FILE.focus()
		return false
	}
	//document.frm_upload.action="kmc_upsave.asp?mode="+mode
	document.candidate.action="kmc_upsave.asp?mode="+mode
	document.candidate.encoding = "multipart/form-data"
	return true
}

function agree1() 
	  {
		if(document.candidate.agree.checked) 
		  {
		    document.candidate.sub.disabled=false
	         return true
	      }
	    else
	      {
			document.candidate.sub.disabled=true
		  }
      }

function chk(mode) 
{
//alert(document.candidate.m_mode.value)

        if (document.candidate.m_mode.value!="e"&document.candidate.m_mode.value!="redirect")
		  {    	   
			if (document.candidate.txtlogin.value=="")
				{
					alert("Please Enter a valid Login Name!")
					document.candidate.txtlogin.focus()
					return false
				}
			var len=document.candidate.txtlogin.value.length
			if(len<5)
				{
					alert("Login name should be atleast 5 characters")
					document.candidate.txtlogin.focus()
					return false
				}

			if (document.candidate.txtpassword.value=="")
				{
					alert("Please Enter a valid Password!")
					document.candidate.txtpassword.focus()
					return false
				}

			var len1=document.candidate.txtpassword.value.length
			if(len1<5)
				{
					alert("Password should be atleast 5 characters")
					document.candidate.txtpasssword.focus()
					return false
				}


			if (document.candidate.txtrepassword.value=="")
				{
					alert("Please Retype the password!")
					document.candidate.txtrepassword.focus()
					return false
				}

			if (document.candidate.txtpassword.value!=document.candidate.txtrepassword.value)
				{
					alert("Password not matched with retyped password")
					document.candidate.txtrepassword.focus()
					return false
				}

			if (document.candidate.txtquestion.value=="")
				{
					alert("Please Enter a valid Secret Question")
					document.candidate.txtquestion.focus()
					return false
				}
			if (document.candidate.txtanswer.value=="")
				{
					alert("Please Enter a answer for secret question")
					document.candidate.txtanswer.focus()
					return false
				}
			}
             
			if (document.candidate.txtname.value=="")
				{
					alert("Please Enter your name!")
					document.candidate.txtname.focus()
					return false
				}
			if (document.candidate.txtgender.options[document.candidate.txtgender.selectedIndex].value=="")
				{
					alert("Please Enter the Gender !")
					document.candidate.txtgender.focus()
					return false
				}
			if (document.candidate.txtday.options[document.candidate.txtday.selectedIndex].value=="")
				{
					alert("Please Enter the Date !")
					document.candidate.txtday.focus()
					return false
				}
			if (document.candidate.txtmonth.options[document.candidate.txtmonth.selectedIndex].value=="")
				{
					alert("Please Enter the Month !")
					document.candidate.txtmonth.focus()
					return false
				}
			if (document.candidate.txtyear.options[document.candidate.txtyear.selectedIndex].value=="")
				{
					alert("Please Enter the year !")
					document.candidate.txtyear.focus()
					return false
				}
			if (document.candidate.txtdegree.options[document.candidate.txtdegree.selectedIndex].value=="")
				{
				 if (document.candidate.txtotherdegree.value=="")
					   {	alert("Please Enter the Degree !")
							document.candidate.txtdegree.focus()
							return false
					   }

				}

			   
			if (document.candidate.txtaddress.value=="")
				{
					alert("Please Enter the address!")
					document.candidate.txtaddress.focus()
					return false
				}
			if (document.candidate.sel_state.options[document.candidate.sel_state.selectedIndex].value=="")
								{
											alert("Please Enter the State !")
											document.candidate.sel_state.focus()
											return false
								}


			if (document.candidate.sel_city.options[document.candidate.sel_city.selectedIndex].value=="")
								{
											alert("Please Enter the City !")
											document.candidate.sel_city.focus()
											return false
								}


			if (document.candidate.txtcountry.value=="")
				{
					alert("Please Enter the Country !")
					document.candidate.txtcountry.focus()
					return false
				}


			if (document.candidate.txtphone.value=="")
				{
					alert("Please Enter a Phone number")
					document.candidate.txtphone.focus()
					return false
				}

			if (document.candidate.txtemail.value=="")
				{
					alert("Please Enter a Email Id")
					document.candidate.txtemail.focus()
					return false
				}
			if (document.candidate.txtpin.value=="")
				{
					alert("Please Enter a Pin Code")
					document.candidate.txtpin.focus()
					return false
				}
			//if (document.candidate.FILE.value="")
			//{
			//		alert("Please Upload your resume")
			//'		document.candidate.FILE.focus()
			//'		return false
			//'}
			//alert(mode)

			
			//document.candidate.action="kmc_candisave.asp?m="+document.candidate.m_mode.value
}

//------------------------------added vandana 22/0307----------------------------------------
function new_verify(mode)
{

if (document.candidate.txtday.options[document.candidate.txtday.selectedIndex].value=="")
				{
					alert("Please Enter the Date !")
					document.candidate.txtday.focus()
					return false
				}
			if (document.candidate.txtmonth.options[document.candidate.txtmonth.selectedIndex].value=="")
				{
					alert("Please Enter the Month !")
					document.candidate.txtmonth.focus()
					return false
				}
			if (document.candidate.txtyear.options[document.candidate.txtyear.selectedIndex].value=="")
				{
					alert("Please Enter the year !")
					document.candidate.txtyear.focus()
					return false
				}
		document.candidate.action="kmc_candisave.asp?m="+document.candidate.m_mode.value
}

//-------------------------------added vandana --------------------------------------------
function verify() 
  {
	if (document.candidate.txtlogin.value=="")
		{
			alert("Please Enter a valid Login Name!")
			document.candidate.txtlogin.focus()
			return false
		}
    var len=document.candidate.txtlogin.value.length
	if(len<5)
		{
			alert("Login name should be atleast 5 characters")
			document.candidate.txtlogin.focus()
			return false
		}
	win=window.open("","logincheck","height=200 width=300 resize=no scrolling=no")
	win.document.location="logincheck.asp?n=" + document.candidate.txtlogin.value +"&fr=candidate"
  }

function selfile()
{
win=open("kmc_selfilesave.asp","win","height=250,width=500,left=200,top=200")
win.focus()
}

//added 08/07/2006 -kbk this function was called but not defined
function change(){
	//Do the processing required
}
function showAttachBox(){
	document.getElementById("attachBox").style.display="";
}
