function CheckKey(){
	var count = document.form.code.value.length;
	if (count!=4){
		alert("De toegangscode moet uit minimaal 4 cijfers bestaan");
	}else {
		document.form.submit();
	}
}
function SelectCountry(){
	var SelectedCountry = document.form.country.value;
			
	if (SelectedCountry == "be"){
		var country = "België";
		var number = "0907 07 615";
		var tarif = "&euro; 2.00 p/m";
	}else {
		var country = "Nederland";
		var number = "0906 8132";
		var tarif = "&euro; 0.80 p/m";
	}
	
	document.getElementById("number").innerHTML = number;
	document.getElementById("tarif").innerHTML = tarif;
	document.getElementById("countryph").innerHTML = country;
}

function SetFocus() { 
	document.form.code.focus(); 
}; 

//////////////////////////////////////////////////////
//Setting the global vars for the vas payment popup	//
//////////////////////////////////////////////////////

var content_id;
var siteid;
var promoid;
var infocode;
var vas_userid;
var referer;

function setGlobalVars(content_id_,siteid_,promoid_,infocode_,referer_){
	content_id 	= content_id_ ? content_id_ : '';
	siteid 		= siteid_ ? siteid_ : '';
	promoid 	= promoid_ ? promoid_ : '';
	infocode 	= infocode_ ? infocode_ : '';
	referer 	= referer_ ? referer_ : '';
}
/////////////////////////////////////////////////////
/////////////////////END/////////////////////////////
/////////////////////////////////////////////////////



//////////////////////////////////////////////////////
//Function for the popup of the payment window		//
//////////////////////////////////////////////////////

function paymentPopUp(userid, promo){
	var amountSel 	= document.getElementById('amount');
	var amount    	= amountSel.options[amountSel.selectedIndex].value;
	var btSel 	 	= document.getElementById('bm');
	var bt    	 	= btSel.options[btSel.selectedIndex].value;

	var url = "http://www.kimhollandpartners.nl/access/dialxs/vas/otregister.php";
	url=url+"?amount="+amount;
	url=url+"&s="+siteid;
	url=url+"&pr="+promo;
	url=url+"&uf1="+promo;
	url=url+"&uf2="+userid;
	url=url+"&uf3=nl";
	url=url+"&bt="+bt;
	url=url+"&l=nl";
	url=url+"&referer="+referer
	
	popup(url);
}
function popup(url) {
	params  = 'width='+screen.width;
	params += ', height='+screen.height;
	params += ', top=0, left=0'
	params += ', scrolling=yes'
	params += ', fullscreen=yes';
	
	newwin=window.open(url,'windowname4', params);
	if (window.focus) {newwin.focus()}
	return false;
}
/////////////////////////////////////////////////////
/////////////////////END/////////////////////////////
/////////////////////////////////////////////////////

function logOut(myalert){
		
	if (myalert=="yes"){
		if (confirm('Let op: Je hebt nog minuten over.\nAls je uitlogt loopt de tijd door.')) location.href= '?page=login';
	}else {
		location.href= '?page=login';
	}
	
}
