function goLink(lnk){
	window.open (lnk,"mywindow","menubar=1,resizable=1,width=700,height=500,scrollbars=1"); 
 

}
/////////////  TRIMMING WHITE SPACE ///////////////////////
function LTrim( value ) {
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) {
	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
	
}

// Removes leading and ending whitespaces
function trim( value ) {
	return LTrim(RTrim(value));	
}
///////////////////////////////////////////////////////////////////
function toggleEmail(id){
	if(document.getElementById(id).style.visibility=='hidden'){
		document.getElementById(id).style.visibility='visible';
	}
	else{
	  document.getElementById(id).style.visibility='hidden';
	
	}
}

function validate_request(el, id){
if(trim(el.FirstName.value)==""){
	alert('You must provide a First Name');
	return false;
}
if(trim(el.LastName.value)==""){
	alert('You must provide a Last Name');
	return false;
}
if(trim(el.Email.value)==""|| echeck(el.Email.value) == false){
	alert('You must provide a valid Email Address');
	return false;
}
document.getElementById(id).style.visibility='hidden';
return true;
}



/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
//		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
//		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
//		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
//		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
//		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
//		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
//		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}


