var langVis = 0;
function showLanguageOptions(){
	if(langVis == 0){
		document.getElementById('langdrop').style.display = "block";
		langVis = 1;
	} else {
		document.getElementById('langdrop').style.display = "none";
		langVis = 0;
	}
}

function setLanguage(lang){
	cookieMaker('duo_lang',lang);
	window.location.reload(true);
}

function setCurrency(currCode){
	cookieMaker('duo_currency',currCode);
	window.location.reload(true);
}

function cookieMaker(myName,fileid){
	document.cookie=myName+'='+fileid+'; path=/';
}

function sendClientForm(){
	var name=document.getElementById('clientname');	
	var address=document.getElementById('clientaddress');	
	var email1=document.getElementById('clientemail1');
	var email2=document.getElementById('clientemail2');
	var phone1=document.getElementById('clientphone1');	
	var error='';
	if(!name.value){
		error="You must provide your name for postage purposes<br />";	
	}
	if(!phone1.value){
		error="You must provide your telephone number so we can inform you of any problems with your order<br />";	
	}
	if(!address.value){
		error="You must provide your address for postage purposes<br />";	
	}
	if(!email1.value){
		error="You must provide your email so we can send you your invoice and contact you if there are any problems with your order<br />";	
	}else if(email1.value!=email2.value){
		error="Please make sure you have entered your email into both boxes provided and they are both typed the same<br />";	
	}
	if(error.length>1){
		document.getElementById('signupErrorOutput').innerHTML=error;	
		document.getElementById('signupErrorOutput').style.margin="10px 0px";
		document.getElementById('signupErrorOutput').style.border="1px solid red";	
	}else{
		document.getElementById('checkoutform').submit();
	}
}

function gotoEventForm(pageid) {
	var pid = pageid;
	cookieMaker('event_'+pid,1);
	window.location = "/events/eventbooking/";
}
