	/*  TRAVELATRO SITE-SNIFFER MODIFIED BY FRANK SORBELLO */
	
	function getSiteName(){
	
	var url = ""
	
	url = "" + window.location
	
	if(url.indexOf("http://stg.visitorsconnection.svoreview.com/")>0){
	
	   s_server = "VC_STAGE";
	
	} else {
	
	   s_server = "VC";
	
	} //end if
	
	return s_server;
	
	} 
	//end function

	// centered pop-up script

		function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0

		  if(window.screen)if(isCenter)if(isCenter=="true"){

		    var myLeft = (screen.width-myWidth)/2;

		    var myTop = (screen.height-myHeight)/2;

		    features+=(features!='')?',':'';

		    features+=',left='+myLeft+',top='+myTop;

		  }

		  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);

		}	

	// centered pop-up script fine'

	

	// mouseover script

		

		if (parseInt(navigator.appVersion.substring(0,1))>=3) { // 3.0 or greater.

		

		home_on = new Image();

		home_off = new Image();

		values_on = new Image();

		values_off = new Image();

		offers_on = new Image();

		offers_off = new Image();

		locations_on = new Image();

		locations_off = new Image();

		links_on = new Image();

		links_off = new Image();	

		contact_on = new Image();

		contact_off = new Image();

				

		home_on.src = "./images/nav/home2.gif";		

		values_on.src = "./images/nav/values2.gif";

		offers_on.src = "./images/nav/offers2.gif";

		locations_on.src = "./images/nav/locations2.gif";

		links_on.src = "./images/nav/links2.gif";

		contact_on.src = "./images/nav/contact2.gif";

		

		home_off.src = "./images/nav/home1.gif";		

		values_off.src = "./images/nav/values1.gif";

		offers_off.src = "./images/nav/offers1.gif";

		locations_off.src = "./images/nav/locations1.gif";

		links_off.src = "./images/nav/links1.gif";

		contact_off.src = "./images/nav/contact1.gif";

			

		}

		

		statustext = new Array(4);          

		

		statustext['home'] = ":: Visitor's Connection Home";

		statustext['values'] = ":: Everday Values";

		statustext['offers'] = ":: Special Offers";

		statustext['locations'] = ":: Locations";

		statustext['links'] = ":: Affiliated Sites";

		statustext['contact'] = ":: Contact Us";

		

		function on(image) {

		  if (parseInt(navigator.appVersion.substring(0,1))>=3) { // 3.0 or greater.

		      imagesrc = eval(image + '_on.src');

		      document[image].src = imagesrc;

		  }

		}

		

		function off(image, index) {

		  if (parseInt(navigator.appVersion.substring(0,1))>=3) { // 3.0 or greater.

		      imagesrc = eval(image + '_off.src');

		      document[image].src = imagesrc;

		 }

		}

		

	 // mouseover script fine'

	

	// form button goto script

		function MM_goToURL() { //v3.0

		  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;

		  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");

		}

	// form button goto script fine'

//notEmpty
function notEmpty()

{

	var ok = true;

	var arg = notEmpty.arguments;

	

	// special processing to handle custom form (not forms[0])

	var formName = "forms[0]";

	var startIndex = 0;

	if (arg.length > 0 && arg[0] == "custom") {

		formName = arg[1];

		startIndex = 2;

	}

	

	for(i=startIndex; i<arg.length; i+=2)

	{

		var val= eval("document."+formName+"."+arg[i]+".value");

		if (trim(val)=="")

		{

			ok=false;

			alert(arg[i+1]);

			eval("document."+formName+"."+arg[i]+".focus();");

			break;

		}

	}



	

	return ok;

} //notEmpty

//checkEmail
function checkEmail (emailStr)

{



	/* Check to see the address ends in a two-letter country or well-known

	TLD.  1 means check it, 0 means don't. */

	var checkTLD=1;



	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;



	/* The following pattern is used to check if the entered e-mail address

	fits the user@domain format.*/



	var emailPat=/^(.+)@(.+)$/;



	//Special chars:

	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";



	var validChars="\[^\\s" + specialChars + "\]";



	/* The following pattern applies if the user is a quoted string ->NO RULES!

	For instance, "alexthebest"@travelatro.com is a legal e-mail address. */



	var quotedUser="(\"[^\"]*\")";



	/* The following applies for domains that are IP addresses,

	rather than symbolic names. Ex: alex@[123.124.233.4] is ok.*/



	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;



	var atom=validChars + '+';



	/* The following string represents one word in the typical username.

	For example, in alex.it@travelatro.com, alex and it are words.*/





	var word="(" + atom + "|" + quotedUser + ")";





	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");



		

	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");



	//Validation:



	var matchArray=emailStr.match(emailPat);



	if (matchArray==null)

	{



	//Address does not match the basic pattern.



		alert("Please enter in a valid email address");

		return false;

	}

	

	var user=matchArray[1];

	var domain=matchArray[2];





	for (i=0; i<user.length; i++) 

	{

	 	if (user.charCodeAt(i)>127)

		{

			alert("The username for the email entered contains invalid characters.");

			return false;

		}

    }

	for (i=0; i<domain.length; i++)

	{

		if (domain.charCodeAt(i)>127)

		{

			alert("Ths domain name for the email entered contains invalid characters.");

			return false;

		}

	}



	//Is user ok?

	if (user.match(userPat)==null)

	{



	// NO!

		alert("The username for the email entered doesn't seem to be valid.");

		return false;

	}



	//Is the ip address valid? (If used one)?



	var IPArray=domain.match(ipDomainPat);

	if (IPArray!=null)

	{

		//yes.



		for (var i=1;i<=4;i++)

		{

		

			if (IPArray[i]>255) 

			{

				alert("Destination IP address for the email entered is invalid!");

				return false;

			}

		}

		return true;

	}



	// Domain NAME -is it ok?

	 

	var atomPat=new RegExp("^" + atom + "$");

	var domArr=domain.split(".");

	var len=domArr.length;

	for (i=0;i<len;i++)

	{

		if (domArr[i].search(atomPat)==-1)

		{

			alert("The domain name for the email entered does not seem to be valid.");

			return false;

	   }

	}





	if (checkTLD && domArr[domArr.length-1].length!=2 && 

	domArr[domArr.length-1].toLowerCase().search(knownDomsPat)==-1) 

	{

		alert("The email address must end in a well-known domain or two letter " + "country.");

		return false;

	}



// Make sure there's a host name preceding the domain.



	if (len<2)

	{

		alert("This email address is missing a hostname!");

		return false;

	}



	// If nothing happened so far, we are cool.

	return true;

} //checkEmail





//ltrim

function ltrim ( s )

{

	return s.replace( /^\s*/, "" )

} //ltrim


//rtrim

function rtrim ( s )

{

	return s.replace( /\s*$/, "" );

} //rtrim


//trim

function trim ( s )

{

	return rtrim(ltrim(s));

} //trim

//isEqual
function isEqual(str1,str2,errMsg)

{

	if (str1=="" || str2=="" || str1!=str2)

	{

		alert(errMsg);

		return false;

	}

	else

		return true;

} //isEqual



