/********************************************
* Javascript de Jean-Philippe Sarrosquy     *
* visiter : http://www.antilleslocation.com *
* Pour des locations de vacances            *
********************************************/
<!--

// Sortir d'un frame si la condition est vraie
//if (window != top ) {top.location=window.location;}

//var domaincheck = escape(document.URL)

//function checkurl() {
//	if (domaincheck.indexOf("martinique")!=-1){
//		window.location = "http://www.antilleslocation.com/location-martinique/";
//	} else if (domaincheck.indexOf("guadeloupe")!=-1){
//		window.location = "http://www.antilleslocation.com/location-guadeloupe/";
//	} else {
//		popWin();
//	}
//}

// fonction de controle de la longueur*/
function CheckLen(Texte) {
	StrLen = document.form.Description.value.length;
	if (StrLen > 1000 ) {
		document.form.Description.value = document.form.Description.value.substring(0,1000);
		CharsLeft = 1000;
	} else {
		CharsLeft = StrLen;
	}
	document.form.caractere.value = CharsLeft;
}

function pop(url,strWidth,strHeight,strScroll){
 	w = strWidth;
	h = strHeight;
	pw = parseInt((screen.width-w)/2);
	ph = parseInt((screen.height-h)/2);
  	storywin = window.open(''+ url +'','','width='+ strWidth +',height='+ strHeight +',scrollbars='+ strScroll +',resizable=no,screenX='+ pw +',screenY='+ ph +',left='+ pw +',top='+ ph +''); 

 	if (eval('storywin.focus()')) {
	win.moveTo(pw, ph);
	} 
}

function create(path,strWidth,strHeight,titre) { 

 	w = strWidth;
	h = strHeight;
	pw = parseInt((screen.width-w)/2);
	ph = parseInt((screen.height-h)/2);
  	storywin = window.open('','','width='+ strWidth +',height='+ strHeight +',scrollbars=no,resizable=no,screenX='+ pw +',screenY='+ ph +',left='+ pw +',top='+ ph +''); 
  	with (storywin.document)
  { 
      writeln('<html><head>')
      writeln('<title>'+ titre +'</title>')
      writeln('<SCRIPT>')
      writeln('    load_img = new Image();')
      writeln('    load_img.src = \''+ path +'\';')
      writeln('    function replace_img(){')
      writeln('        if (load_img.complete) {')
      writeln('            document[\'target_img\'].src=load_img.src;')
      writeln('            clearInterval(timerid);')
      writeln('        }')
      writeln('    }')
      writeln('    timerid = setInterval("replace_img()", 10);')
      writeln('</SCRIPT>')
      writeln('<link rel="stylesheet" href="css/style.css" type="text/css">')	  
      writeln('</head>')
      writeln('<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">')
      writeln('<IMG name=target_img SRC=images/patience.gif> ')
      writeln('<br><center><a href="javascript:;" onClick="javascript:window.close();">Fermer la fênetre</a></center>')
      writeln('</body></html>')	  
  }
 	if (eval('storywin.focus()')) {
	win.moveTo(pw, ph);
	} 
 
} 

// Creation de la page d'erreur ---------------------------------------------------------
function ErrorMessage(strError,strCountError) { 

 	w = 320;
	h = 160;
	pw = parseInt((screen.width-w)/2);
	ph = parseInt((screen.height-h)/2);
	strPluriel = "";
	
if (strCountError > 1){
	strPluriel = "s";
}	
	
  	storywin = window.open('','','width=320,height=200,scrollbars=no,resizable=no,screenX='+ pw +',screenY='+ ph +',left='+ pw +',top='+ ph +''); 
  	with (storywin.document)
  { 
      writeln('<html><head>')
      writeln('<title>ERREUR</title>')
	  writeln('<link rel="stylesheet" href="css/style.css" type="text/css">')
	  writeln('<style type="text/css">BODY {background:background-color:#FFFFFF;}</style>')
      writeln('</head>')
      writeln('<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">')  
      writeln('<table width="300" border="0" cellspacing="0" cellpadding="0">')
	  writeln('<br>')
      writeln('  <tr>')
      writeln('    <td width="10"><img src="images/spacer.gif" width="10" height="1"></td>')
      writeln('    <td width="290" height="20"><font color="#FF0000">'+ strCountError +' erreur'+ strPluriel +'.</font></td>')
      writeln('  </tr>')
      writeln('  <tr>')
      writeln('    <td>&nbsp;</td>')
      writeln('    <td><br>'+ strError +'<br>')
      writeln('      <br>')

      writeln('    </td>')
      writeln('  </tr>')
      writeln('  <tr>')
      writeln('    <td>&nbsp;</td>')
      writeln('    <td><a href="javascript:window.close();">Fermer la fen&ecirc;tre</a></td>')
      writeln('  </tr>')
      writeln('</table>') 	  
      writeln('</body></html>')
  }
 	if (eval('storywin.focus()')) {
	win.moveTo(pw, ph);
	} 
 
} 

// Fonction pour valider un formulaire
function Verif(){     

	var pass = true;
	var missinginfo = "";
	var box = "";
	
	if (document.form.Login.value == ""){            
		missinginfo += "\n- Nom d'utilisateur";
		if (box==""){box="Login";}
  		pass = false;
	} 
	
	if (document.form.Password.value == ""){            
		missinginfo += "\n- Mot de passe";
		if (box==""){box="Password";}
  		pass = false;
	} 
	
	if (missinginfo != ""){
		missinginfo = "absent ou invalide : \n" + missinginfo;
		alert(missinginfo);
		document.form[box].focus();
		return false;
	} else 
		document.form.Submit.disabled = true;
		//document.form.btnModifier.value = "PATIENCE...";
		return true;


}

// Fonction pour valider un formulaire
function VerifCust(){     

	var pass = true;
	var missinginfo = "";
	var box = "";
	
	if (document.formcust.Login.value == ""){            
		missinginfo += "\n- Votre courriel";
		if (box==""){box="Login";}
  		pass = false;
	} 
	
	if (document.formcust.Password.value == ""){            
		missinginfo += "\n- Code client";
		if (box==""){box="Password";}
  		pass = false;
	} 
	
	if (missinginfo != ""){
		missinginfo = "absent ou invalide : \n" + missinginfo;
		alert(missinginfo);
		document.formcust[box].focus();
		return false;
	} else 
		document.formcust.Submit.disabled = true;
		//document.form.btnModifier.value = "PATIENCE...";
		return true;


}

function favoris() {
	if ( navigator.appName != 'Microsoft Internet Explorer' ){ 
		window.sidebar.addPanel("AntillesLocation.com","http://www.antilleslocation.com/",""); 
	} else { 
		window.external.AddFavorite("http://www.antilleslocation.com/","AntillesLocation.com"); 
	} 
}


function displaytab(nr){
	thestyle = document.getElementById(nr).style;
	document.getElementById('bloc0').style.display = 'none';
	document.getElementById('bloc1').style.display = 'none';
	if(thestyle.display=='none'){
		thestyle.display = 'block';
	} else {
		thestyle.display = 'none';
	}
}

{
        m1On = new Image()
        m1On.src ="/images/Guadeloupeoff.jpg"
        m1Off = new Image()
        m1Off.src ="/images/Guadeloupe.jpg" 
		
		m2On = new Image()
        m2On.src ="images/ST-Martinoff.jpg"
        m2Off = new Image()
        m2Off.src ="images/ST-Martin.jpg" 
		
		m3On = new Image()
        m3On.src ="/images/Guyaneoff.jpg"
        m3Off = new Image()
        m3Off.src ="/images/Guyane.jpg" 
		
		m4On = new Image()
        m4On.src ="/images/Martiniqueoff.jpg"
        m4Off = new Image()
        m4Off.src ="/images/Martinique.jpg" 
		
		m5On = new Image()
        m5On.src ="/images/Dominiqueoff.jpg"
        m5Off = new Image()
        m5Off.src ="/images/Dominique.jpg" 
		
}

function switchOn(imageName) {
  if (document.images)
     document.images[imageName].src = eval(imageName + 'On.src');
}
                 
function switchOff(imageName) {
  if (document.images)
     document.images[imageName].src = eval(imageName + 'Off.src');
}


//-->
