// JavaScript Document

//for gallery pictures
function enlarge(large, thumb){
	document.getElementById(large).src = thumb;
}

//for printing only content instead of whole page
function imprSelec_es(nombre)
{
  var ficha = document.getElementById(nombre);
  var ventimp = window.open(' ', 'popimpr');
  ventimp.document.write("<link href='../css/main.css' rel='stylesheet' type='text/css'>");
  ventimp.document.write("<p><img src='../img/main-logo.jpg' align='top' border='0'></p><hr style='height:1px;'>");
  ventimp.document.write( ficha.innerHTML );
  ventimp.document.close();
  ventimp.print( );
  ventimp.close();
} 

function imprSelec(nombre)
{
  var ficha = document.getElementById(nombre);
  var ventimp = window.open(' ', 'popimpr');
  ventimp.document.write("<link href='../css/main.css' rel='stylesheet' type='text/css'>");
  ventimp.document.write("<p><img src='../img/main-logo.jpg' align='top' border='0'></p><hr style='height:1px;'>");
  ventimp.document.write( ficha.innerHTML );
  ventimp.document.close();
  ventimp.print( );
  ventimp.close();
} 

//for layer popup once client joins mail list
var timeout;

function moveDiv(){
	document.getElementById("popup").style.top = document.body.scrollTop;
}

function openPopup(PopupNum){
	if(PopupNum==1){
		alert("Thank you but your e-mail has already been included in our mailing list for this market.");
	}else if(PopupNum==2||PopupNum==5){
		document.getElementById("popup").style.visibility ="visible";
		timeout = setInterval(exit, 12000);
	}else if(PopupNum==3){
		alert("Error: There was a problem adding the address to the mailing list. Please contact the administrator.");
	}else if(PopupNum==4){
		alert("Gracias pero su email ya ha sido registrado en nuestra lista de correos para este destino.");
	}else{
		alert("Error: Ocurriķ un error al intentar aņadir su email a la lista de correos. Por favor contacte con el administrador.");
	}
}

function exit(){
	document.getElementById("popup").style.visibility ="hidden";
	clearInterval(timeout);
	
}

function sendForm(form){
	var aRequired = new Array ('telephone', 'email', 'first_name', 'surname');
	for (var x=0; x<aRequired.length; x++){
		if (document.getElementById(aRequired[x]).value == ''){
			alert ('Vul aub de verplichte velden in.');
			return false;
		}
	}
	document.getElementById(form).submit();
	
}


