
function set()
{
	
	if (document.dataform.S_name.value.length == 0)  {
		alert ("Kindly enter your name.");
		document.dataform.S_name.focus();
		return false;
	}
	
	
	if (NaN(document.dataform.S_name.value))
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.dataform.S_email.value))) {
			alert("Invalid Email ID. Kindly enter the correct ID.");
			document.dataform.S_email.focus();
			return (false);
	}
	
	if (document.dataform.S_phone.value.length == 0)  {
		alert ("Kindly enter your phone number.");
		document.dataform.S_phone.focus();
		return false;
	}
	if(document.dataform.Description.value == "") {
		alert ("Kindly describe your requirement.");
		document.dataform.Description.focus();
		return false;
	}
	if (document.dataform.Description.value.length>4000) {
		alert("Kindly describe your requirement within the limit of 4000 characters.");
		document.dataform.Description.focus();
		return false;
	}

	newCookie = document.dataform.S_name.value;
	newCookie +="|"+document.dataform.S_email.value;
	newCookie +="|"+document.dataform.S_phone.value;
	setCookie("newImeshID",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 "";
}

function get_ccode()
{
	document.dataform.S_ccode_fax.value = document.dataform.S_ccode.value;
}

function get_acode()
{
	document.dataform.S_acode_fax.value = document.dataform.S_acode.value;
}


function  get()
{
	if( (cookie = getCookie("newImeshID")) > "")
	{
		Values = cookie.split("|");
		if (Values.length >= 3)
		{
			if (Values[0]) document.dataform.S_name.value  = Values[0];
			if (Values[1]) document.dataform.S_email.value = Values[1];
			if (Values[2]) document.dataform.S_phone.value = Values[2];
		}
	}
}


var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;
function dodacheck(val) {
var strPass = val.value;
var strLength = strPass.length;
var lchar = val.value.charAt((strLength) - 1);
if(lchar.search(mikExp) != -1) {
var tst = val.value.substring(0, (strLength) - 1);
val.value = tst;
   }
}
function doanothercheck(form) {
if(form.value.length < 1) {
alert("Please enter something.");
return false;
}
if(form.value.search(mikExp) == -1) {
alert("Correct Input");
return false;
}
else {
alert("Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ { + } ` ~ =  | \n\r\n\rare not allowed!\n");
form.select();
form.focus();
return false;
}
alert("Correct Input");
return false;
}


