/*largeur=screen.width;
hauteur=screen.height;
if(largeur<=800){
	alert ("le site est optimisé pour un écran 1024X760");
	self.moveTo(0,0)
	self.resizeTo(screen.availWidth,screen.availHeight)
}
else{
window.resizeTo(1024,750)}*/
function NoError()
{
	return true;
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function twPopupImage(img, titre, auteur) { 
  // Compatible IE5+ / NN6+ / Mozilla
  oFenetre = window.open('','Image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');
  oFenetre.document.write("<html><head><title>"+titre+"</title></head>"); 
  oFenetre.document.write("<script type=\"text/javascript\">function twAjustePopUp() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+10,document.images[0].height+40); window.focus();} else { setTimeout('twAjustePopUp()',1000) } }</"+"script>");
  oFenetre.document.write("<body onload='twAjustePopUp()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>"); 
  oFenetre.document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><tr><td valign='middle' align='center'>"); 
  oFenetre.document.write("<img src='"+img+"' border='0' alt='"+auteur+"' title='"+auteur+"'>");
  oFenetre.document.write("</td></tr></table></body></html>"); 
  oFenetre.document.close(); 
} 

function add_favoris()
{
nom_site = "'Jardines de Cos&oacute;n - République Dominicaine";
url_site = "'http://www.jardinesdecoson.com'";
if (navigator.appName == "Netscape")
alert ('Utilisateur de Netscape, il vous suffit d\'appuyer sur CTRL+d  pour ajouter cette page à vos signets');
else {

addbookmark();
}
}

/*ajouter au favoirs*/
var bookmarkurl="http://www.jardinesdecoson.com"
var bookmarktitle="Jardines de Cos&oacute;n - République Dominicaine"
function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}



function ChangeMessage(message,champ)
  {
  if(document.getElementById)
    document.getElementById(champ).innerHTML = message;
  }
  

function SwitchImg()
{ 
  var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
    	store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
        (store.indexOf('document.all[')==0 && document.all==null))
         store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
         obj = eval(store);
    if (obj != null) {
   	   switcher[keep++] = obj;
      switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
      obj.src = SwitchImg.arguments[rem+2];
  } }
  document.Data = switcher;
}

function RestoreImg()
{
  if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
      document.Data[rem].src=document.Data[rem+1];
}


function open_window(votre_page,haut,bas)
{

var hauteur_popup=haut;
var H = (screen.height - hauteur_popup) / 2;
var largeur_popup=bas;
var L = (screen.width - largeur_popup) / 2;
pop_up = window.open(votre_page,"Popup","status=yes,scrollbars=yes,resizable=yes,height="+hauteur_popup+",width="+largeur_popup+",top="+H+",left="+L);
}
function open_window2(votre_page,haut,bas)
{
var hauteur_popup=haut;
var H = (screen.height - hauteur_popup) / 2;
var largeur_popup=bas;
var L = (screen.width - largeur_popup) / 2;
pop_up = window.open(votre_page,"Popup","status=yes,scrollbars=no,resizable=no,height="+hauteur_popup+",width="+largeur_popup+",top="+H+",left="+L);
}

/*------------------------*/ 
/*fermeture windows*/ 
/*------------------------*/
 function errorSafe() {return true;}
window.onerror = errorSafe; 
function newWin(url,name,rs,sc,mn,tl,lo,wd,hi) {
closeWindow = window.close();}
name.window="menu"
function close_window(url) {
email = window.close(url,"");
}

/* imprimer*/
function imprimer(){window.print();} 

/*------- afiche vignette plus grande---------------*/
function afficheVignette(cheminVignette,cheminMaxi)
	{
	document.write('<A HREF="javascript:afficheMaxi(\''+cheminMaxi+'\')"><IMG SRC="'+cheminVignette+'" HSPACE=0 VSPACE=0 BORDER=0 ALT="cliquez ici pour voir en grand"></A>');
	}
function afficheMaxi(chemin)
{
	if(pop_allowed==0)
	{
		alert(msgpopup);
	}
	else
	{
		i1 = new Image;
		i1.src = chemin;
		html = '<HTML><HEAD><TITLE>Image</TITLE><link href="css/page.css" rel="stylesheet" type="text/css"></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER></BODY></HTML>';
		popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1');
		popupImage.document.open();
		popupImage.document.write(html);
		popupImage.document.close();
	}
};
function afficheMaxiplan(chemin,limage)
{
	if(pop_allowed==0)
	{
		alert(msgpopup);
	}
	else
	{
		i1 = new Image;
		i1.src = chemin;
		html = '<HTML><HEAD><TITLE>Image</TITLE><link href="css/page.css" rel="stylesheet" type="text/css"></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><br><img src="images/appartement/titre'+limage+'.gif" border="0"><br><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(700,450)"></CENTER></BODY></HTML>';
		popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1');
		popupImage.document.open();
		popupImage.document.write(html);
		popupImage.document.close()
	}
};
function afficheMaxiplan2(chemin,limage)
{
	if(pop_allowed==0)
	{
		alert(msgpopup);
	}
	else
	{
		i1 = new Image;
		i1.src = chemin;
		html = '<HTML><HEAD><TITLE>Plan</TITLE><link href="css/page.css" rel="stylesheet" type="text/css"></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><br><span class="textevert"><b>'+limage+'</b></span><br><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(700,450)"></CENTER></BODY></HTML>';
		popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1');
		popupImage.document.open();
		popupImage.document.write(html);
		popupImage.document.close()
	}
};
function ChangeUrl(formulaire)
	{
	if (formulaire.ListeUrl.selectedIndex != 0)
		{
		location.href = formulaire.ListeUrl.options[formulaire.ListeUrl.selectedIndex].value;
	 	}
	else 
		{
		alert('Veuillez choisir une destination.');
		}
	}
	
function ChangeUrlvilla(formulairevilla)
	{
	if (formulairevilla.ListeUrlvilla.selectedIndex != 0)
		{
		location.href = formulairevilla.ListeUrlvilla.options[formulairevilla.ListeUrlvilla.selectedIndex].value;
	 	}
	else 
		{
		alert('Veuillez choisir une Villa.');
		}
	}
		
function ChangeUrl3d(formulaire3d)
	{
	if (formulaire3d.ListeUrl3d.selectedIndex != 0)
		{
		location.href = formulaire3d.ListeUrl3d.options[formulaire3d.ListeUrl3d.selectedIndex].value;
	 	}
	else 
		{
		alert('Veuillez choisir une image 3D.');
		}
	}