// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 4000;
// Duration of crossfade (seconds)
var crossFadeDuration = 2;

// do not edit anything below this line
var Pic = "";
var Url_Link_Pic = new Array();
var Timer = new Array();
var t;
var Nb_Pic_Tot = 18;
var Index_Pic_Cur = Nb_Pic_Tot;
var preLoad = new Array();


for (i = 0; i < Nb_Pic_Tot; i++)
{
  preLoad[i] = new Image();
  Pic =  "http://www.voidievoile.fr/images/schausey-" + i + ".jpg";
  Url_Link_Pic[i] = Pic;
  Timer[i] = 2;
  preLoad[i].src = Pic;
}


function runSlideShow()
{
  Index_Pic_Cur = Index_Pic_Cur + 1;
  if (Index_Pic_Cur >= Nb_Pic_Tot) Index_Pic_Cur = 1;
  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[Index_Pic_Cur].src;

  //t = setTimeout('runSlideShow()', slideShowSpeed);
  t = setTimeout('runSlideShow()', Timer[Index_Pic_Cur]*1200);
}
 // Diaporama
var Pic2 = "";
var Url_Link_Pic2 = new Array();
var Timer2 = new Array();
var t2;
var Nb_Pic_Tot2 = 18;
var Index_Pic_Cur2 = Nb_Pic_Tot2;
var preLoad2 = new Array();


for (j = 0; j < Nb_Pic_Tot2; j++)
{
  preLoad2[j] = new Image();
  Pic2 =  "http://www.voidievoile.fr/images/chausey-" + j + ".jpg";
  Url_Link_Pic2[j] = Pic2;
  Timer2[j] = 2;
  preLoad2[j].src = Pic2;
}


function runSlideShow2()
{
  Index_Pic_Cur2 = Index_Pic_Cur2 + 1;
  if (Index_Pic_Cur2 >= Nb_Pic_Tot2) Index_Pic_Cur2 = 1;
  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[Index_Pic_Cur2].src;

  //t = setTimeout('runSlideShow()', slideShowSpeed);
  t2 = setTimeout('runSlideShow2()', Timer2[Index_Pic_Cur2]*1200);
}
function show_cur_image()
{
	if(Url_Link_Pic[Index_Pic_Cur]!='')
	{
		if(Url_Link_Pic[Index_Pic_Cur].substring(0,6)=='http://')
		{
			window.open(Url_Link_Pic[Index_Pic_Cur],"Mangrove"+Index_Pic_Cur,'width=800,height=600,location,menubar,personalbar,resizable,scrollbars,titlebar');

		}
	  else
		{
		  document.location.href=Url_Link_Pic[Index_Pic_Cur];
		}
	}
}

function show_zoom_image(id, h) { //v2.0
  theURL = id ;
  hnd = window.open(theURL, "zoom", "width=760,height=" + (h+200) + ",top=0,left=0,scrollbars=yes");
  hnd.focus();
}
// Navigation dans le bloc vidéo
function afficheCalque(elementID) {
    masqueCalque();
    if ((getIdProperty( elementID, "display" )) == "block"){
            setIdProperty( elementID, "display", "none" );

    } else {
            setIdProperty( elementID, "display", "block" );
    }
}
function masqueCalque(){

   var maxItems = 2;
    for (i=1; i<=maxItems; i++) {
            mElementID = "calque" + i;
            setIdProperty( mElementID, "display", "none" );
    }

}


function ValidateForm(frm)
{
	if (frm.theme.selectedIndex == 0 && frm.skipper.selectedIndex == 0 && frm.classe.selectedIndex == 0)
	{
	  frm.
		alert("Merci de choisir un thème");
		return false;
	}
}
  var win = null;
function newWindow(page, nom, L, H, defilement)
      {
      	posX = (screen.width) ? (screen.width - L)/ 2 : 0;
        posY = (screen.height) ? (screen.height - H)/ 2 : 0;
        contenu = 'height=' + H + ', width = ' + L 
                 + ', top ='+ posY +', left =' + posX 
                 + ',  scrollbars = ' + scroll + ', resizable';
        win = window.open(page, nom, contenu);
      }

