// JavaScript Document
var width = 800;
var height = 600; 
var resize=0; 
var maxWidth=750; // defaults
function checklayersIndex(){
maxWidth=780;
checklayers()
}
function checklayers(){

	if (document.layers) {
		width = window.innerWidth;
		height = window.innerHeight;
	}
	else if (document.all) {
		width = document.body.clientWidth;
		height = document.body.clientHeight;
	}
	divs=document.getElementsByTagName("DIV")
	for (i = 0; i < divs.length; i++){
		element=divs[i].id;
		if (width>maxWidth) {
			resize=(width-maxWidth)/2
			if (element!="length")
					if (document.getElementById(element))
						document.getElementById(element).style.posLeft=document.getElementById(element).style.posLeft+resize
		}
	}
}

// JavaScript Document for Speakeasybcn.com
// Made by WebIdentity.dk !! 

function AccStudent(mode)
  {
	  if(mode=="dis"){
		  document.getElementById("student1").disabled=true;
		  document.getElementById("student2").disabled=true;
		  document.getElementById("student3").disabled=true;
	  } else if (mode=="ena"){
		  document.getElementById("student1").disabled=false;
		  document.getElementById("student2").disabled=false;
		  document.getElementById("student3").disabled=false;
	  }
  }
  
function shw(id,theRadio) {
try{
	var radio20 = document.getElementById('radio_20');
	var radio10 = document.getElementById('radio_10');
	var radio6 = document.getElementById('radio_6');
	var input20 = document.getElementById('hour20');
	var input10 = document.getElementById('hour10');
	var input6 = document.getElementById('hour6');
	
hideAllDropdowns();
	
	document.getElementById(id).className = 'vis';
	
	if(theRadio.getAttribute("wasChecked")=="true"){
		radio20.setAttribute("wasChecked","false");
		radio10.setAttribute("wasChecked","false");
		radio6.setAttribute("wasChecked","false");
		document.getElementById(id).className = 'invis';
   		theRadio.checked = false;
 	} else {
		radio20.setAttribute("wasChecked","false");
		radio10.setAttribute("wasChecked","false");
		radio6.setAttribute("wasChecked","false");
		theRadio.setAttribute("wasChecked","true");
 	}
} catch(err){alert(err);}
}

function shwCombined(id,theRadio) {
try{
	
	var radio12 = document.getElementById('radio_12C');
	var radio24 = document.getElementById('radio_24C');
	var combined12 = document.getElementById('combined12');
	var combined24 = document.getElementById('combined24');
		
	hideAllDropdowns();
	
	document.getElementById(id).className = 'vis';
	
	if(theRadio.getAttribute("wasChecked")=="true"){
		radio12.setAttribute("wasChecked","false");
		radio24.setAttribute("wasChecked","false");
		document.getElementById(id).className = 'invis';
   		theRadio.checked = false;
 	} else {
		radio12.setAttribute("wasChecked","false");
		radio24.setAttribute("wasChecked","false");		
		theRadio.setAttribute("wasChecked","true");
 	}
} catch(err){alert(err);}
}

function shwExpress(id,theRadio) {
try{	
	var radio20E = document.getElementById('radio_20E');
	var radio30E = document.getElementById('radio_30E');
	var express20 = document.getElementById('express20');
	var express30 = document.getElementById('express30');
		
	hideAllDropdowns();
	
	document.getElementById(id).className = 'vis';
	
	if(theRadio.getAttribute("wasChecked")=="true"){
		radio20E.setAttribute("wasChecked","false");
		radio30E.setAttribute("wasChecked","false");
		document.getElementById(id).className = 'invis';
   		theRadio.checked = false;
 	} else {
		radio20E.setAttribute("wasChecked","false");
		radio30E.setAttribute("wasChecked","false");		
		theRadio.setAttribute("wasChecked","true");
 	}
} catch(err){alert(err);}
}

function shwAcademic(id,theRadio) {
try{	
	var radio36A = document.getElementById('radio_36A');
	var radio40A = document.getElementById('radio_40A');
	var academic36 = document.getElementById('academic36');
	var academic40 = document.getElementById('academic40');
		
	hideAllDropdowns();
	
	document.getElementById(id).className = 'vis';
	
	if(theRadio.getAttribute("wasChecked")=="true"){
		radio36A.setAttribute("wasChecked","false");
		radio40A.setAttribute("wasChecked","false");
		document.getElementById(id).className = 'invis';
   		theRadio.checked = false;
 	} else {
		radio36A.setAttribute("wasChecked","false");
		radio40A.setAttribute("wasChecked","false");		
		theRadio.setAttribute("wasChecked","true");
 	}
} catch(err){alert(err);}
}

function shwPrivate(id,theRadio) {
try{	
	var privatebox = document.getElementById('privatebox');
	var privatebox2 = document.getElementById('privatebox2');
	var privatebox3 = document.getElementById('privatebox3');
	var privatehour = document.getElementById('privatehour');
	var privatehour2 = document.getElementById('privatehour2');
	var privatehour3 = document.getElementById('privatehour3');
		
	hideAllDropdowns();
	
	document.getElementById(id).className = 'vis';
	
	if(theRadio.getAttribute("wasChecked")=="true"){
		privatebox.setAttribute("wasChecked","false");
		privatebox2.setAttribute("wasChecked","false");
		privatebox3.setAttribute("wasChecked","false");
		document.getElementById(id).className = 'invis';
   		theRadio.checked = false;
 	} else {
		privatebox.setAttribute("wasChecked","false");
		privatebox2.setAttribute("wasChecked","false");	
		privatebox3.setAttribute("wasChecked","false");		
		theRadio.setAttribute("wasChecked","true");
 	}
} catch(err){alert(err);}
}

function hideAllDropdowns(){
	var input20 = document.getElementById('hour20');
	var input10 = document.getElementById('hour10');
	var input6 = document.getElementById('hour6');
	var academic36 = document.getElementById('academic36');
	var academic40 = document.getElementById('academic40');
	var express20 = document.getElementById('express20');
	var express30 = document.getElementById('express30');
	var combined12 = document.getElementById('combined12');
	var combined24 = document.getElementById('combined24');

	var privatehour = document.getElementById('privatehour');
	var privatehour2 = document.getElementById('privatehour2');
	var privatehour3 = document.getElementById('privatehour3');
	
	academic36.className = 'invis';
	academic40.className = 'invis';
	express20.className = 'invis';
	express30.className = 'invis';
	combined12.className = 'invis';
	combined24.className = 'invis';
	input20.className = 'invis';
	input10.className = 'invis';
	input6.className = 'invis';	
	
	privatehour.className = 'invis';
	privatehour2.className = 'invis';
	privatehour3.className = 'invis';
	}

function UnCheckCourse() {
	document.getElementById('radio_20').checked=false;
	document.getElementById('radio_10').checked=false;
	document.getElementById('radio_6').checked=false;
	document.getElementById('hour20').className = 'invis';
	document.getElementById('hour10').className = 'invis';
	document.getElementById('hour6').className = 'invis';
}
function SpanishB4(index){
	var element = document.getElementById('SpanishBeforeDiv');
	var radioyes = document.getElementById('SpanishB4Radio');
	if(index == "Yes"){element.className='vis';}
	else if(index == "No"){element.className='invis';}
	else if(index == "Check"){
		if(radioyes.checked == true){element.className='vis';}
		else {element.className='invis';}
	}
}

function printPage(div){
	var PrintDiv = document.getElementById(div);
	var WinPrint = window.open('','','left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
	WinPrint.document.write("<head><link href='../stylebcn.css' rel='stylesheet' /></head>");
	WinPrint.document.write("<H1>Speakeasybcn.com Your price</H1>");
	WinPrint.document.write(PrintDiv.innerHTML);
	WinPrint.document.close();
	WinPrint.focus();
	WinPrint.print();
	WinPrint.close();
}

function OtherLang(OtherL){
	var element = document.getElementById('OtherLangDiv');
	var radioyes = document.getElementById('OtherLangRadio');
	if(OtherL == "Yes"){element.className='vis';}
	else if(OtherL == "No"){element.className='invis';}
	else if(OtherL == "Check"){
		if(radioyes.checked == true){element.className='vis';}
		else {element.className='invis';}
	}
		
}

function ShowOtherAnwser(value){
	var AnwserRoot = document.getElementById('AnwserSelect');
	var anwser = AnwserRoot.options[AnwserRoot.selectedIndex].value;
	var other = document.getElementById('AnwserOtherID');
	var othertext = document.getElementById('AnwserOtherIDText');

	if(value == 'Other'){
		other.className='vis';
		othertext.className='vis';
	} else {
		other.className = 'invis';
		othertext.className ='invis';
	}
	if(value == 'Check'){
		if(anwser.value == 'Other'){
			other.className = 'vis';
			othertext.className ='vis';
		} else {
			other.className = 'invis';
			othertext.className ='invis';
		}
	}
}

function ShowOtherAnswer_2(value){
	var AnwserRoot = document.getElementById('Wizard1_AnswerSelect');
	var anwser = AnwserRoot.options[AnwserRoot.selectedIndex].value;
	var other = document.getElementById('Wizard1_AnswerOtherID');
	var othertext = document.getElementById('AnswerOtherIDText');

	if(value == 'Other'){
		other.className='vis';
		othertext.className='vis';
	} else {
		other.className = 'invis';
		othertext.className ='invis';
	}
	if(value == 'Check'){
		if(anwser.value == 'Other'){
			other.className = 'vis';
			othertext.className ='vis';
		} else {
			other.className = 'invis';
			othertext.className ='invis';
		}
	}
}

function goBack(){
  window.history.back();
}
 

function CheckInput(status){
	try{
	var YesIcon = '../Graphics/yes-icon.png';
	var NoIcon = '../Graphics/delete-icon.png';
	
	var Fill = new Array();
	
	var count = 0;
		
	if(document.getElementById('FirstName').value.length > 0){
	} else { count++; Fill[count]="First Name";}
	
	if(document.getElementById('LastName').value.length > 0){
	} else {count++; Fill[count]="Last Name";}
	
	if(document.getElementById('Address').value.length >= 0){
	} else {count++; Fill[count]="Address";}
	
	if(document.getElementById('PostalCode').value.length >= 0){
	} else { count++; Fill[count]="Postal Code";}
	
	if(document.getElementById('City').value.length >= 0){
	} else { count++; Fill[count]="City";}
	
	if(document.getElementById('Country').value.length >= 0){
	} else { count++; Fill[count]="Country";}
	
	if(document.getElementById('Telephone').value.length >= 0){
	} else { count++; Fill[count]="Telephone number";}
	
	if(document.getElementById('Mobile').value.length >= 0){
	} else { count++; Fill[count]="Mobile phone";}
	
	if(document.getElementById('Email').value.length > 0){
	} else { count++; Fill[count]="Email";}
	
	if(document.getElementById('Gender1').checked == true){
		}
	else if (document.getElementById('Gender2').checked == true){
	} else { count++; Fill[count]="Gender";}
	
	if(document.getElementById('Nationality').value.length >= 0){
	} else { count++; Fill[count]="Nationality";}

	var BDD = document.getElementById('BirthDD');
	var BirthDD = BDD.options[BDD.selectedIndex].value;
	var BMM = document.getElementById('BirthMM');
	var BirthMM = BMM.options[BMM.selectedIndex].value;
	var BYYYY = document.getElementById('BirthYYYY');
	var BirthYYYY = BYYYY.options[BYYYY.selectedIndex].value;
	
	if(BirthDD != 'DD' && BirthMM != 'MM' && BirthYYYY != 'YYYY'){
	} else { count++;  Fill[count]="Date of birth";}

	if(document.getElementById('Occupation').value.length >= 0){
	} else { count++; Fill[count]="Occupation";}

if(status == 'submit'){
	if(count == 0){
		return true;
	} else {
		var msg = "Please fill out the following fields\n";
		for (i=1;i<Fill.length;i++){
			msg = msg+" - "+Fill[i]+"\n";
		}
		alert(msg);
		return false;
	}
}
	}catch(err){alert(err);}
}
	
	function SendBooking(){
		var Terms = document.getElementById('Terms');
		
		if(Terms.checked == true){
			return true;
		} else {
			alert("Please accept our terms and conditions");
			return false;
		}
	}
	
