// JavaScript Document
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_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_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 MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function montre(id)
{
		var element_style=null
		if (document.getElementById)
		{element_style=document.getElementById(id).style;}
		else if (document.all)
		{element_style=document.all[id].style;} 
		if(element_style)  {element_style.display="block";}
}
function cache(id)
{
		var element_style=null
		if (document.getElementById)
		{element_style=document.getElementById(id).style;}
		else if (document.all)
		{element_style=document.all[id].style;} 
		if(element_style)  {element_style.display="none";}
}


// ************** Page d'accueil : défilement texte
function namosw_init_scrolltext()
{
  list = new Array();
  for (var i = 0, top = 0; i < namosw_init_scrolltext.arguments.length; i += 2) {
    obj = eval('document.'+namosw_init_scrolltext.arguments[i]);
    if (obj == null) continue;
    list[top++] = obj;
    for (str = '', j = 0; j < namosw_init_scrolltext.arguments[i+1]; j++)
      str += ' ';
    str += obj.value;
    obj.value = str;
  }
  if (top > 0) {
    document.namosw_scrolltext_list = list;
    setTimeout('namosw_scrolltext()', 100);
  }
}
function namosw_scrolltext()
{
  for (i = 0; i < document.namosw_scrolltext_list.length; i++) {
    obj   = document.namosw_scrolltext_list[i];
    str   = obj.value.substring(1, obj.value.length);
    str  += obj.value.substring(0, 1);
    obj.value = str;
  }
  setTimeout('namosw_scrolltext()', 100);
}

// ******* formulaire numero de telephone
function Franco()
{ 
	document.forms[0].action.value="expedit_franco";
	document.forms[0].submit();
	return;
}

// ******** formulaire de recherche
function Reset()
{ 
					document.forms[0].sel_ref.value="";
					document.forms[0].sel_name.value="";
					document.forms[0].sel_location.value="";
					document.forms[0].sel_rooms.value="";
					document.forms[0].sel_city.value="";
					document.forms[0].sel_from.value="";
					document.forms[0].sel_to.value="";
					return;
}

function Test_to(dat)
{ 
					if (dat=="")
					{
						document.forms[0]["sel_to"].value="";
						return;
					}
					if (document.forms[0]["sel_to"].value<=dat)
					{
						var i=1;
						while (i<=eval(document.forms[0].total_semaines.value))
						{
							if (document.forms[0]["tab_from["+i+"]"].value==dat)
							{
								document.forms[0]["sel_to"].value=document.forms[0]["tab_to["+i+"]"].value;
								break;
							}
							i=i+1;
						}
						return;
					}
					return;
}
function Test_from(dat)
{ 
					if (dat=="")
					{
						document.forms[0]["sel_from"].value="";
						return;
					}
					if (document.forms[0]["sel_from"].value>=dat || document.forms[0]["sel_from"].value=="")
					{
						var i=1;
						while (i<=eval(document.forms[0].total_semaines.value))
						{
							if (document.forms[0]["tab_to["+i+"]"].value==dat)
							{
								document.forms[0]["sel_from"].value=document.forms[0]["tab_from["+i+"]"].value;
								break;
							}
							i=i+1;
						}
						return;
					}
					return;

}
// ************* Fiche : gestion devise
function Currency(c)
{ 
	// changement devise
	// tarifs tableau 1
	var i=1;
	while (i<=(document.forms[0].nbre_max_tab1.value))
	{
		if ((document.forms[0]["dispo["+i+"]"].value=='1') || (document.forms[0]["dispo["+i+"]"].value=='2'))
		{
			if (c=='pounds' && document.forms[0]["pounds["+i+"]"].value!='£ '){document.forms[0]["iprice["+i+"]"].value=document.forms[0]["pounds["+i+"]"].value;}
			if (c=='dollars' && document.forms[0]["dollars["+i+"]"].value!='$ '){document.forms[0]["iprice["+i+"]"].value=document.forms[0]["dollars["+i+"]"].value;}
			if (c=='euros' && document.forms[0]["euros["+i+"]"].value!='€ '){document.forms[0]["iprice["+i+"]"].value=document.forms[0]["euros["+i+"]"].value;}
		}
		i=i+1;
	}
	// tarifs tableau 2
	i=1;
	while (i<=(document.forms[0].nbre_max_tab2.value))
	{
		if ((document.forms[0]["dispo2["+i+"]"].value=='1') || (document.forms[0]["dispo2["+i+"]"].value=='2'))
		{
			if (c=='pounds' && document.forms[0]["pounds2["+i+"]"].value!='£ '){document.forms[0]["iprice2["+i+"]"].value=document.forms[0]["pounds2["+i+"]"].value;}
			if (c=='dollars' && document.forms[0]["dollars2["+i+"]"].value!='$ '){document.forms[0]["iprice2["+i+"]"].value=document.forms[0]["dollars2["+i+"]"].value;}
			if (c=='euros' && document.forms[0]["euros2["+i+"]"].value!='€ '){document.forms[0]["iprice2["+i+"]"].value=document.forms[0]["euros2["+i+"]"].value;}
		}
		i=i+1;
	}
	// tarifs tableau 3
	i=1;
	while (i<=(document.forms[0].nbre_max_tab3.value))
	{
		if ((document.forms[0]["dispo3["+i+"]"].value=='1') || (document.forms[0]["dispo3["+i+"]"].value=='2'))
		{
			if (c=='pounds' && document.forms[0]["pounds3["+i+"]"].value!='£ '){document.forms[0]["iprice3["+i+"]"].value=document.forms[0]["pounds3["+i+"]"].value;}
			if (c=='dollars' && document.forms[0]["dollars3["+i+"]"].value!='$ '){document.forms[0]["iprice3["+i+"]"].value=document.forms[0]["dollars3["+i+"]"].value;}
			if (c=='euros' && document.forms[0]["euros3["+i+"]"].value!='€ '){document.forms[0]["iprice3["+i+"]"].value=document.forms[0]["euros3["+i+"]"].value;}
		}
		i=i+1;
	}
	// tarifs tableau 4
	i=1;
	while (i<=(document.forms[0].nbre_max_tab4.value))
	{
		if ((document.forms[0]["dispo4["+i+"]"].value=='1') || (document.forms[0]["dispo4["+i+"]"].value=='2'))
		{
			if (c=='pounds' && document.forms[0]["pounds4["+i+"]"].value!='£ '){document.forms[0]["iprice4["+i+"]"].value=document.forms[0]["pounds4["+i+"]"].value;}
			if (c=='dollars' && document.forms[0]["dollars4["+i+"]"].value!='$ '){document.forms[0]["iprice4["+i+"]"].value=document.forms[0]["dollars4["+i+"]"].value;}
			if (c=='euros' && document.forms[0]["euros4["+i+"]"].value!='€ '){document.forms[0]["iprice4["+i+"]"].value=document.forms[0]["euros4["+i+"]"].value;}
		}
		i=i+1;
	}
	// tarifs tableau 5
	i=1;
	while (i<=(document.forms[0].nbre_max_tab5.value))
	{
		if ((document.forms[0]["dispo5["+i+"]"].value=='1') || (document.forms[0]["dispo5["+i+"]"].value=='2'))
		{
			if (c=='pounds' && document.forms[0]["pounds5["+i+"]"].value!='£ '){document.forms[0]["iprice5["+i+"]"].value=document.forms[0]["pounds5["+i+"]"].value;}
			if (c=='dollars' && document.forms[0]["dollars5["+i+"]"].value!='$ '){document.forms[0]["iprice5["+i+"]"].value=document.forms[0]["dollars5["+i+"]"].value;}
			if (c=='euros' && document.forms[0]["euros5["+i+"]"].value!='€ '){document.forms[0]["iprice5["+i+"]"].value=document.forms[0]["euros5["+i+"]"].value;}
		}
		i=i+1;
	}
	return;
}

