function affich_sousmenu(num,tmp_dir){

	if (document.getElementsByName('menu_choose'+num)[0].style.display=='none'){
			for (i=0;i<document.getElementsByName('menu_choose'+num).length;i++) {
				document.getElementsByName('menu_choose'+num)[i].style.display='';
			}
			document.getElementsByName('menu_chooseplus'+num)[0].src=tmp_dir + 'images/moins.jpg';
	} else {
			for (i=0;i<document.getElementsByName('menu_choose'+num).length;i++) {
				document.getElementsByName('menu_choose'+num)[i].style.display='none';
			}
			document.getElementsByName('menu_chooseplus'+num)[0].src=tmp_dir + 'images/plus.jpg';
	}

} 

function pageScroll() {
    	document.getElementById('iframe1').window.scrollBy(0,4); // horizontal and vertical scroll increments
    	//scrolldelay = setTimeout('pageScroll()',100); // scrolls every 100 milliseconds
}

var vary=4;
var ontheway="ok";
var speed;

function scrolldown(hauteur) {
	var orig = document.getElementById('essai').style.top;
	if (parseInt(orig.replace("px",""))+vary>hauteur-parseInt(document.getElementById('essai').style.height.replace("px",""))) {
			document.getElementById('essai').style.top=parseInt(orig.replace("px",""))-vary;
		
			//document.affichage.res1.value=orig;
		
			if (ontheway=="ok") {
				setTimeout("scrolldown("+hauteur+")",speed)
			}
	}

}

function scrollup() {
	var orig = document.getElementById('essai').style.top;
	if (parseInt(orig.replace("px",""))+vary<0) {
			document.getElementById('essai').style.top=parseInt(orig.replace("px",""))+vary;
		
			//document.affichage.res1.value=orig;
		
			if (ontheway=="ok") {
				setTimeout("scrollup()",speed)
			}
	}
}

function scrollstop() {
	ontheway="";
	speed   = 0;
}

function scrollinit() {
	ontheway="ok";
	speed   = 0;
}

 
function affich_yourboat(){
	if (document.getElementById('your_boat').style.display=='none'){
			document.getElementById('your_boat').style.display='';
	} else {
			document.getElementById('your_boat').style.display='none';
	}
}
 
function affich_service(){
	if (document.getElementById('service').style.display=='none'){
			document.getElementById('service').style.display='';
	} else {
			document.getElementById('service').style.display='none';
	}
}

function verif(langue)
{
	control=0;
	if (document.info_prospect.nom.value!=""){
		control=2;
	}
	if (control==0){
		if (langue == "fr") {
			alert("Merci d indiquer votre nom");		
		} else {
			alert("Thanks to fill your last name");
		}
		
		return false;
	}else{
		control=0;
		if (document.info_prospect.email.value!=""){
			var s = document.info_prospect.email.value;
			s ="" + s;
			var ok = 1;
			if ((s.length < 7)){
				ok = 0;
			}
			var at = s.indexOf('@');
			if (at < 1){
				ok = 0;
			}
			if (at != s.lastIndexOf('@')){
				ok = 0;
			}
			if ((s.lastIndexOf('.') < (at+2)) || (s.lastIndexOf('.') > (s.length-3)) || (s.lastIndexOf('.') < (s.length-6))){
				ok = 0;
			}
			if ((s.indexOf(',') != -1) ||
				(s.indexOf(' ') != -1) ||
				(s.indexOf(';') != -1) ||
				(s.indexOf('\\') != -1) ||
				(s.indexOf(':') != -1) ||
				(s.indexOf('?') != -1) ||
				(s.indexOf('/') != -1) ||
				(s.indexOf('"') != -1) ||
				(s.indexOf("'") != -1) ||
				(s.indexOf('[') != -1) ||
				(s.indexOf(']') != -1) ||
				(s.indexOf('`') != -1) ||
				(s.indexOf('!') != -1) ||
				(s.indexOf('#') != -1) ||
				(s.indexOf('$') != -1) ||
				(s.indexOf('%') != -1) ||
				(s.indexOf('^') != -1) ||
				(s.indexOf('&') != -1) ||
				(s.indexOf('*') != -1) ||
				(s.indexOf('(') != -1) ||
				(s.indexOf(')') != -1) ||
				(s.indexOf('=') != -1) ||
				(s.indexOf('+') != -1) ||
				(s.indexOf('}') != -1) ||
				(s.indexOf('{') != -1) ||
				(s.indexOf('|') != -1) ||
				(s.indexOf('<') != -1) ||
				(s.indexOf('>') != -1)  )
				{
					ok = 0;
				}

			if (ok == 1){
				control=2;
			}
		}
		if (control==0){
		if (langue == "fr") {
			alert("Le format de votre email n est pas correct");
		} else {
			alert("Email format is not correct");
		}
		
			return false;
		}else{
			control=0;
			if (document.info_prospect.prenom.value!=""){
				control=2;
			}
			if (control==0){
				if (langue == "fr") {
						alert("Merci d indiquer votre prenom");				
				} else {
						alert("Thanks to fill your first name");
				}
				return false;
			}else{
				document.info_prospect.action.value = "envoi_email";
				return true;
			}
		}
	}
}

function verif1(langue)
{
	control=0;
	if (document.form1.nom.value!=""){
		control=2;
	}
	
	if (control==0){
		if (langue == "fr") {
			alert("Merci d indiquer votre nom");		
		} else {
			alert("Thanks to fill your last name");
		}
		
		return false;
	}else{
		control=0;
		if (document.form1.email.value!=""){
			var s = document.form1.email.value;
			s ="" + s;
			var ok = 1;
			if ((s.length < 7)){
				ok = 0;
			}
			var at = s.indexOf('@');
			if (at < 1){
				ok = 0;
			}
			if (at != s.lastIndexOf('@')){
				ok = 0;
			}
			if ((s.lastIndexOf('.') < (at+2)) || (s.lastIndexOf('.') > (s.length-3)) || (s.lastIndexOf('.') < (s.length-6))){
				ok = 0;
			}
			if ((s.indexOf(',') != -1) ||
				(s.indexOf(' ') != -1) ||
				(s.indexOf(';') != -1) ||
				(s.indexOf('\\') != -1) ||
				(s.indexOf(':') != -1) ||
				(s.indexOf('?') != -1) ||
				(s.indexOf('/') != -1) ||
				(s.indexOf('"') != -1) ||
				(s.indexOf("'") != -1) ||
				(s.indexOf('[') != -1) ||
				(s.indexOf(']') != -1) ||
				(s.indexOf('`') != -1) ||
				(s.indexOf('!') != -1) ||
				(s.indexOf('#') != -1) ||
				(s.indexOf('$') != -1) ||
				(s.indexOf('%') != -1) ||
				(s.indexOf('^') != -1) ||
				(s.indexOf('&') != -1) ||
				(s.indexOf('*') != -1) ||
				(s.indexOf('(') != -1) ||
				(s.indexOf(')') != -1) ||
				(s.indexOf('=') != -1) ||
				(s.indexOf('+') != -1) ||
				(s.indexOf('}') != -1) ||
				(s.indexOf('{') != -1) ||
				(s.indexOf('|') != -1) ||
				(s.indexOf('<') != -1) ||
				(s.indexOf('>') != -1)  )
				{
					ok = 0;
				}

			if (ok == 1){
				control=2;
			}
		}
		if (control==0){
		if (langue == "fr") {
			alert("Le format de votre email n est pas correct");
		} else {
			alert("Email format is not correct");
		}

			return false;

		}else{
			return true;

		}

	}
}

function VerificationEmail(elm)
{
	if (elm.value.indexOf("@") != "-1" &&
	    elm.value.indexOf(".") != "-1" &&
	    elm.value != "")
	   { return true;}
	else {return false;}
}

function verif_newsletter(langue)
{
 
  var trouve=true;
	if (VerificationEmail(document.form_newsletter.news_email) == false) {trouve=false;}
    
	if(trouve==false){
				if (langue == "fr") {
					alert("Email non Valide.");
				} else {
					alert("Email format is not correct.");
				}		
		document.form_newsletter.news_email.focus();
		return false;
  }
	return true;
}

function changeMoteur() {
	
	if (document.getElementById('SRH_Crew').value=='Cabin') {
		document.getElementById('table_cab').style.display='';
		document.getElementById('table_').style.display='none';
	} else {
		document.getElementById('table_cab').style.display='none';
		document.getElementById('table_').style.display='';
		}
}


function checkCab1 () {  

		if (document.sbp_search.CabPax1.value+document.sbp_search.CabPax2.value==0) {
								document.sbp_search.CabPax2.value=1;
							}
}

function checkCab2 () {  

	 if (document.sbp_search.CabPax1.value+document.sbp_search.CabPax2.value==0) {
											document.sbp_search.CabPax1.value=1;
											}
}

function EdLink(l1,l2) {
	l4='top=0,left=0,height=800,width=1000,toolbar=no,menubar=no,scrollbars=YES,resizable=no,directories=no,location=no,status=no,titlebar=no'
	window.open(l1,l2,l4)
}

function fermer() {
	if (parent.frames.length < 1) {window.close();}  else {parent.window.close();}
}

function ViewMap(l1,l2,w,h) {
	l4='top=0,left=0,height='+h+',width='+w+',toolbar=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,status=no,titlebar=no'
	window.open(l1,l2,l4)
}

function validMProgram(l1){
	
	if ((document.getElementById('nom').value=='') || (document.getElementById('tel').value=='') || (document.getElementById('email').value=='')) {
		alert('Merci de remplir les champs en gras');
	}
	else {
		document.getElementById('form1').submit();
	}
}
