// JavaScript Document//-->
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 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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('Veuillez remplir tous les champs obligatoires(*)');
  document.MM_returnValue = (errors == '');
}
*/



function visible (id)
{
	document.getElementById(id).style.display = "inline";
}


function cache (id)
{
	document.getElementById(id).style.display = "none";
}




function stopScroll() {
loop = false;
clearTimeout(scrolltimer);
}

// -->
var tab = new Array ("01","02","03","04","05","presentation_5","presentation_6","contact_0","contact_1","contact_2","contact_3","contact_4","contact_5","contact_6","tarifs_0","tarifs_1","tarifs_2","tarifs_3","tarifs_4","tarifs_5","tarifs_6","hebergement_0","hebergement_1","hebergement_2","hebergement_3","loisirs_0","loisirs_1","loisirs_2","loisirs_3","loisirs_4","loisirs_5","balneo_0","balneo_1","balneo_2","balneo_3","balneo_4","balneo_5","balneo_6","balneo_7","balneo_8","balneo_9","balneo_10","restauration_0","restauration_1","restauration_2","restauration_3","reservation_0","reservation_1","reservation_2","reservation_3","reservation_4");

function show_details (id)
{
var tab = new Array ("suite","suite1","suite2","suite3","suite4","suite5","suite6","suite7","suite8");
if (document.getElementById(id).style.display == 'none')
	{
	document.getElementById(id).style.display = "block";
     for(i=0;i<tab.length;i++)
		{
		if ((tab[i] != id) && document.getElementById(tab[i]) )
 		document.getElementById(tab[i]).style.display = "none";
		}
	}
else
document.getElementById(id).style.display = "none";
}
/************* validateur de formulaire **************/

function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' doit contenir une adresse mail.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' doit contenir un nombre.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' est obligatoire.\n'; }
    } if (errors) alert('erreur:\n'+errors);
    document.MM_returnValue = (errors == '');
} }

/************* fonction images**************/


var slideShowSpeed = 3000
var crossFadeDuration = 1

var Pic = new Array()
var Pic2 = new Array()
var Pic3 = new Array()
Pic2[0] = '../images/defilement/img_cisco.jpg'
Pic2[1] = '../images/defilement/img_hp.jpg'
Pic3[0] = '../images/defilement/texte_cisco.jpg'
Pic3[1] = '../images/defilement/texte_hp.jpg'


Pic[0] = '../images/defilement/telecom.jpg'
Pic[1] = '../images/defilement/madinet_el3ouloum.jpg'
Pic[2] = '../images/defilement/la_poste.jpg'
Pic[3] = '../images/defilement/planet.jpg'
Pic[4] = '../images/defilement/steg.jpg'
Pic[5] = '../images/defilement/cofidecom.jpg'
Pic[6] = '../images/defilement/nejma.jpg'
Pic[7] = '../images/defilement/divona.jpg'
Pic[8] = '../images/defilement/fuba.jpg'
Pic[9] = '../images/defilement/techniplast.jpg'
Pic[10] = '../images/defilement/tun.jpg'
Pic[11] = '../images/defilement/betronic-logo.jpg'
Pic[12] = '../images/defilement/inbmi.jpg'
Pic[13] = '../images/defilement/advancia.jpg'
Pic[14] = '../images/defilement/hr_access.jpg'
Pic[15] = '../images/defilement/ets.jpg'
Pic[16] = '../images/defilement/teleperf.jpg'
Pic[17] = '../images/defilement/exxon.jpg'
Pic[18] = '../images/defilement/hexabyte.jpg'
Pic[19] = '../images/defilement/gct.jpg'
Pic[20] = '../images/defilement/nestle.jpg'
Pic[21] = '../images/defilement/tunisiana.jpg'
Pic[22] = '../images/defilement/renault.jpg'
Pic[23] = '../images/defilement/jwt.jpg'
Pic[24] = '../images/defilement/abc.jpg'
Pic[25] = '../images/defilement/biat.jpg'
Pic[26] = '../images/defilement/oilibya.jpg'
Pic[27] = '../images/defilement/poulina.jpg'
Pic[28] = '../images/defilement/weatherford.jpg'
Pic[29] = '../images/defilement/vermeg.jpg'
Pic[30] = '../images/defilement/tav.jpg'
Pic[31] = '../images/defilement/adhe_els.jpg'
Pic[32] = '../images/defilement/bourse_tunis.jpg'
Pic[33] = '../images/defilement/air_liquide.jpg'
Pic[34] = '../images/defilement/attijari_bank.jpg'
Pic[35] = '../images/defilement/ctama.jpg'
Pic[36] = '../images/defilement/agence_tunisienne_internet.jpg'
Pic[37] = '../images/defilement/british.jpg'
Pic[38] = '../images/defilement/topnet.jpg'
var t

var j = 0

var t2

var j2 = 0

var t3

var j3 = 0
var p = Pic.length
var preLoad = new Array()


var p3 = Pic3.length
var preLoad3 = new Array()
var p2 = Pic2.length
var preLoad2 = new Array()

for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}
for (i = 0; i < p2; i++){
preLoad2[i] = new Image()
preLoad2[i].src = Pic2[i]
}

for (i = 0; i < p3; i++){
preLoad3[i] = new Image()
preLoad3[i].src = Pic3[i]
}



function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src

if (document.all){
document.images.SlideShow.filters.blendTrans.Play()
}
j = j + 1

if (j > (p-1)) j=0

t = setTimeout('runSlideShow()', slideShowSpeed)
}

function runSlideShow2(){
if (document.all){
document.images.SlideShow2.style.filter="blendTrans(duration=2)"
document.images.SlideShow2.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow2.filters.blendTrans.Apply()
}
document.images.SlideShow2.src = preLoad2[j2].src

if (document.all){
document.images.SlideShow2.filters.blendTrans.Play()
}
j2 = j2 + 1

if (j2 > (p2-1)) j2=0

t = setTimeout('runSlideShow2()', slideShowSpeed)
}

function runSlideShow3(){
if (document.all){
document.images.SlideShow3.style.filter="blendTrans(duration=2)"
document.images.SlideShow3.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow3.filters.blendTrans.Apply()
}
document.images.SlideShow3.src = preLoad3[j3].src

if (document.all){
document.images.SlideShow3.filters.blendTrans.Play()
}
j3 = j3 + 1

if (j3 > (p3-1)) j3=0

t = setTimeout('runSlideShow3()', slideShowSpeed)
}



function montre(id) {
var d = document.getElementById(id);
if (d) {
d.style.display='block';
}
}
function cache(id) {
var d = document.getElementById(id);
if (d) {
d.style.display='none';
}
}

<script type="text/javascript">
function MM_findObj_captcha(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_captcha(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm_captcha() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm_captcha.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj_captcha(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
