var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',status=no'
win = window.open(mypage,myname,settings)
}

function hideshow(obj) { 
	if (parseInt(navigator.appVersion) >= 5 || navigator.appVersion.indexOf["MSIE 5"] != -1) {
		if (obj.style.display=="none") 
			obj.style.display="";
		else
			obj.style.display="none";
	}
} 	

function validdel(url, txt, page, emp) {
	resultat = confirm("Are you sure you want the following element?\n"+txt);
	if (resultat==true) {
		showcontent(url, page, emp);
	}
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("page_content").getElementsByTagName("span");
		if(el.style.display != "block"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}
	}
}

function fillcard(show, rx) {
	showcontent('spn=bill&bill_country='+document.frm_reg.country.value+'&bill_stateprov='+document.frm_reg.stateprov.value+'&li=1&rx='+rx, '/'+show+'/stateprov.asp', 'bill_validprov');	
	document.frm_reg.bill_country.value=document.frm_reg.country.value;
	document.frm_reg.bill_name.value=document.frm_reg.firstname.value+' '+document.frm_reg.lastname.value;
	document.frm_reg.bill_address.value=document.frm_reg.address.value;
	document.frm_reg.bill_city.value=document.frm_reg.city.value;
	document.frm_reg.bill_stateprov.value=document.frm_reg.stateprov.value;
	document.frm_reg.bill_zip.value=document.frm_reg.zip.value;
}

function getpromo(val) {
	document.getElementById("bill_info").style.display="none";
	if (val == "credit") {
		document.getElementById("bill_info").style.display="";
	}
} 	

function showtours(val) {
	if (val) {
		callax('li=1&typereg='+document.frm_reg.typereg.value+'&cin_tour='+document.frm_reg.cin_tour.value, 'envision_tours.asp', 'envtours', '200');
	}
	else {
		document.frm_reg.cin_tour.value='';
		callax('l=1&', 'blank.asp', 'envtours', '200');
	}
	return false;
} 	

function calcultotal(show, taux) {
	showcontent('rl=1&price_conf='+document.frm_reg.price_conf.value+'&country='+document.frm_reg.country.value+'&stateprov='+document.frm_reg.stateprov.value+'&method_payment='+document.frm_reg.method_payment.value+'&taux='+taux+'&promo_code='+document.frm_reg.promo_code.value+'&envision='+document.frm_reg.envision.checked, '/'+show+'/total_reg.asp', 'total'); return false;
}

function checkEmail(show) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.frm_subscribe.email.value)) {
		showcontent('li=1&email='+document.frm_subscribe.email.value, '/'+show+'/subscribe.asp', 'subscribe'); return false;
	}
	alert("Please enter a vaild e-mail address.")
	return (false)
}

function clearmail() {
	if (document.frm_subscribe.email.value=='Enter e-mail') {
		document.frm_subscribe.email.value='';
	}
}

function countwords(vv, div) {
	formcontent=vv.split(" ")
	if (div) {
		document.getElementById(div).innerHTML=formcontent.length;
	}
}
