function validateMailForm()
{
	var frm = document.getElementById('frmsignup');
	if(isEmpty(frm.name))
	{ 
		alert("Please enter your full name");frm.name.focus();
		return false; 
	}
	

	/*if(isEmpty(frm.phone))
	{ 
		alert("Please enter your phone number");frm.phone.focus();
		return false; 
	}
	if(!isNumeric(frm.phone))
	{ 
		alert("Please enter your valid phone number");frm.phone.focus();
		return false; 
	}*/
	//var URL = getPath()+"/wip/ifmr/website/signup_thanku.php";		//For Offline
	var URL = getPath()+"/signup_thanku.php";						//For Online
	//var URL = getPath()+"/ifmr_trust/revamp/signup_thanku.php";
	var fields		=	new Array();
	var name =frm.name.value;
	var email=frm.email.value;
	var organisation =frm.organisation.value;
	var area =frm.area.value;
	var phone=frm.phone.value;

	fields.push("name="+name);
	fields.push("email="+email);
	fields.push("organisation="+organisation);
	fields.push("area="+area);
	fields.push("phone="+phone);
	qs =	fields.join('&');
	desturl = noCache(URL);
	http.open('POST', URL);
	http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	http.onreadystatechange = mailSuccess; 
	http.send(qs)
	return false;
}
function mailSuccess()
{	
	
	if(http.readyState == 4)
	{ 
		
			var resp = http.responseText;
			alert(resp);
			window.location.href = window.location.href;
	}
	else
	{
			//alert(resp);
			//redirectUrl();	
	}

}
/*------------------------------------------------------------------------------*/
function redirectUrl()
{
	
	var url =document.location.href;	
	var path = getPath();
	var pos = url.substring(path.length);
	window.location.href= getPath()+pos;
}
function getPath()
{
	url		=	document.location.href;
	x		=	url.indexOf(".");
	x		=	url.indexOf("/",x);
	return url.substring(0,x);
}
/*------------------------------------------------------------------------------*/

function isEmail(obj)
{	
		str = obj.value;
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		if (!filter.test(str))
		{
			return false;
		}
		return true;
}


var http   = createRequestObject(); 
/*------------------------------------------------------------------------------*/
function createRequestObject()
{
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer")
		{
			request_o = new ActiveXObject("Microsoft.XMLHTTP");
		}
	else
		{
			request_o = new XMLHttpRequest();
		}
	return request_o; //return the object
}





