function set()
{

	if (document.dataform.firstName.value.length == 0)
	{
	alert ("Kindly enter Your First Name.");
	document.dataform.firstName.focus();
	return false;
	}


	if (document.dataform.lName.value.length == 0)
	{
	alert ("Kindly enter Your Last Name.");
	document.dataform.lName.focus();
	return false;
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.dataform.email_id.value))) {
			alert("Invalid Email ID. Kindly enter the correct ID.");
			document.dataform.email_id.focus();
			return (false);
	}
	if (document.dataform.gender.selectedIndex == "")  {
		alert ("Kindly select your Gender.");
		document.dataform.gender.focus();
		return false;
	}
	if (document.dataform.dobDay.selectedIndex == "")
	{
	alert ("Kindly enter your Day of Birth.");
	document.dataform.dobDay.focus();
	return false;
	}
	if (document.dataform.dobMonth.selectedIndex == "")
	{
	alert ("Kindly enter your Month of Birth.");
	document.dataform.dobMonth.focus();
	return false;
	}
	if (document.dataform.dobYear.selectedIndex == "")
	{
	alert ("Kindly enter your Year of Birth.");
	document.dataform.dobYear.focus();
	return false;
	}

	if (document.dataform.Nationality.selectedIndex == "")  {
		alert ("Kindly select your Nationality.");
		document.dataform.Nationality.focus();
		return false;
	}

	if (document.dataform.ugDegree.selectedIndex == "")  {
		alert ("Kindly select your Graduation Degree.");
		document.dataform.ugDegree.focus();
		return false;
	}

	if (document.dataform.ugYear.selectedIndex == "")  {
		alert ("Kindly select your Year of Graduation.");
		document.dataform.ugYear.focus();
		return false;
	}

	if (document.dataform.ugMarks.selectedIndex == "")  {
		alert ("Kindly select your Aggregate Percentage in Graduation.");
		document.dataform.ugMarks.focus();
		return false;
	}

	if (document.dataform.workYear.selectedIndex == "")  {
		alert ("Kindly select Total Work Experience.");
		document.dataform.workYear.focus();
		return false;
	}

	if (document.dataform.workMonth.selectedIndex == "")  {
		alert ("Kindly select Total Work Experience.");
		document.dataform.workMonth.focus();
		return false;
	}

	if (document.dataform.current_posting_location.value.length == 0)
	{
		alert ("Kindly enter your Current Posting Location.");
		document.dataform.current_posting_location.focus();
		return false;
	}
if (document.dataform.captcha_text.value.length == 0)  {
		alert ("Kindly enter security code as shown in image.");
		document.dataform.captcha_text.focus();
		return false;
	}

	newCookie = document.dataform.firstName.value;
	newCookie +="|"+document.dataform.lName.value;
	newCookie +="|"+document.dataform.email_id.value;
	newCookie +="|"+document.dataform.gender.selectedIndex;
	newCookie +="|"+document.dataform.Nationality.selectedIndex;
	newCookie +="|"+document.dataform.current_posting_location.value;
	setCookie("newImeshID2",newCookie);
	return true;
}

function setCookie(name, value)
{
	expires = new Date();
	expires.setTime (expires.getTime() + 24 * 60 * 60 * 150 * 1000);

	if (value.length > 0)
 	document.cookie = name + "=" + escape(value)+ ";"+"path=/;"+"expires=" + expires.toGMTString()+";"
}

function getCookie(Name)
{
	var search = Name + "="
	if (document.cookie.length > 0)
	{ // if there are any cookies
		offset = document.cookie.indexOf(search)
		if (offset != -1)
		{ // if cookie exists
			offset += search.length
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset)
			// set index of end of cookie value
			if (end == -1) end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
	}

	return "";
}
var d = new Date();
	var epoch_time =(d.getTime()-d.getMilliseconds())/1000;
	var randomnumber=Math.floor(Math.random()*9999);
	var randomnumber1=Math.floor(Math.random()*9999);
	var ran_num=randomnumber+"."+epoch_time+"."+randomnumber1;
	var url="/cgi/get_captcha.cgi?cref="+ran_num+"&style=2";

function  get()
{
	if( (cookie = getCookie("newImeshID2")) > "")
	{
		Values = cookie.split("|");
		if (Values.length >= 5)
		{
			if (Values[0]) document.dataform.firstName.value  = Values[0];
			if (Values[1]) document.dataform.lName.value = Values[1];
			if (Values[2]) document.dataform.email_id.value = Values[2];
			if (Values[3]) document.dataform.gender.options[Values[3]].selected=true;
			if (Values[4]) document.dataform.Nationality.options[Values[4]].selected=true;
			if (Values[5]) document.dataform.current_posting_location.value = Values[5];
		}
	}
}

//Getting parameter name from url starts
var is_input = document.URL.indexOf('?');
var code = '';
if (is_input != -1)
{
	addr_str = document.URL.substring(is_input+1, document.URL.length);
	strarr = addr_str.split("&");
	var param_nam = unescape((strarr[0].split("="))[0]);
	if(param_nam == "code")
	{
		code = unescape((strarr[0].split("="))[1]);
		code = code.replace(/\+/g," ");
	}
}
//Getting parameter name from url ends