var state = 'none'; 

function showhide(layer_ref, imgname) { //for showing and hiding DIVs

	if (state == 'block') { 
	state = 'none'; 
	imgstate = 'i_expand.gif';
	} 
	else { 
	state = 'block'; 
	imgstate = 'i_collapse.gif';
	} 
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
	eval( "document.all." + layer_ref + ".style.display = state"); 
	} 
	if (document.layers) { //IS NETSCAPE 4 or below 
	document.layers[layer_ref].display = state; 
	} 
	if (document.getElementById &&!document.all) { 
	hza = document.getElementById(layer_ref); 
	hza.style.display = state; 
	} 

	//change image name
	if (shObtainVisa != ""){
		document.getElementById(imgname).src = "images/decor/" + imgstate;
	}
} 

function validateEmail(){ //validation check for common email subscription page
	if (document.form.fname.value=="") {
		alert("Oops! Please enter your FIRST NAME.")
		document.form.fname.focus()
		return false
	}

	if (document.form.email.value=="") {
		alert("Oops! Please enter your EMAIL ADDRESS.")
		document.form.email.focus()
		return false
	}
	
	if (isValidEmail(document.form.email.value)==false){
		alert("Oops! Please enter a VALID EMAIL ADDRESS.")
		document.form.email.focus()
		return false
	}

	return true
}

function validateSearch(){ //validation check for common search page
	if (document.frmSearch.MainSearch.value=="") {
		alert("Oops! Please enter your SEARCH TERM.")
		document.frmSearch.MainSearch.focus()
		return false
	}

	return true
}

function isValidEmail(VarString) {
if (VarString.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
	return true;
else
	return false;
}


function addBookmark(title,url) { 
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,""); 
	}
	else if( document.all ) { 
		window.external.AddFavorite( url, title); 
	}
	else if(window.opera && window.print ){ 
		return true; 
	} 
} 

function Openme(newin, height, width) {
	NewWindow=window.open(newin,"NewWindow","resizable=yes,status=no,scrollbars=yes,width=" + width + ",height=" + height + ",top=15,left=15")
	window.NewWindow.focus();
}

function OpenFullScreen(newin) {
	FullScreen=window.open(newin,"FullScreen","resizable=yes,status=no,scrollbars=yes,top=15,left=15,fullscreen=yes")
	window.FullScreen.focus();
}
