var pWin;
function popup(url, width, height) 
{
	if (!pWin)
		pWin = window.open(url,"NewWin","height=" + height + ",width=" + width + ",location=no,toolbar=no,scrollbars=yes,resizable=yes,menubar=no");
	else if (pWin.closed)
		pWin = window.open(url,"NewWin","height=" + height + ",width=" + width + ",location=no,toolbar=no,scrollbars=yes,resizable=yes,menubar=no");	
	pWin.focus();
}
function newwindow(url, width, height) 
{
	var Secondwin;
	Secondwin = window.open(url,"NewWin2","height=" + height + ",width=" + width + ",location=no,toolbar=no,scrollbars=yes,resizable=yes,menubar=no");
}
function limitLength( control, length )
{
	if( control.value.length > length )
	{
		control.value = control.value.substr( 0, length );
	}
}
function validateemail(email, url) {
	document.body.style.cursor='wait';

	// Create an instance of the XML HTTP Request object
	var oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
	
	// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
	var sURL = url + "validatecontactemail.aspx?email=" + email;
	oXMLHTTP.open( "POST", sURL, false );

	// Execute the request
	oXMLHTTP.send();

	if (oXMLHTTP.responseText == "exist")
	{
		alert("Sorry - the email " + email + " already exists.");
		document.form['content_email'].value = '';
		document.form['content_email'].focus();
	}

	document.body.style.cursor='auto';
}