// JavaScript Document
// SWAP IMAGE BACK AND FRONT IN POP UP popup #######################################################

// load page from popup #######################################################
function openURL(sURL) {
	  opener.document.location = sURL;
	} 

// INTRO POPUP ADD #######################################################

function popUp_add() {
	win=window.open('popup_add.htm','window','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=368,height=500');
	win.focus();
}
function popUp_add_fr() {
	win=window.open('/fr/popup_add.htm','window','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=368,height=500');
	win.focus();
}

// PHOTO_GALLERY #######################################################
function PopupPic(sPicURL) { 
     win1=window.open("/fr/popup_gallery.php?"+sPicURL, 'win1', "resizable=1,HEIGHT=200,WIDTH=200"); 
	 win1.moveTo(0,0);
	 win1.focus();
}
// DRESSES #############################################################

function popup_photo(p) {
	win=window.open(p,'swindow','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=360,height=510');
	win.moveTo(0,0);
	win.focus();
}

function popup_search(p) {
	win=window.open(p,'swindow','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=300,height=400');
	win.moveTo(0,0);
	win.focus();
}

// BEAUTY - OUR EXAMPLES #############################################################

function popup_examples(p) {
	win=window.open(p,'swindow','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=550,height=430');
	win.moveTo(0,0);
	win.focus();
}

function popup_examples_big(p) {
	win=window.open(p,'swindowbig','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=600,height=505');
	win.moveTo(0,0);
	win.focus();
}

/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2001-5 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/
//PHOTOGRAPHY PAGES

// Comma separated list of images to rotate 
var imgs = new Array('../img/photography/small/0027.jpg','../img/photography/small/0037.jpg','../img/photography/small/0002.jpg','../img/photography/small/0042.jpg','../img/photography/small/0022.jpg','../img/photography/small/0036.jpg','../img/photography/small/0003.jpg','../img/photography/small/0038.jpg','../img/photography/small/0004.jpg','../img/photography/small/0044.jpg');
// delay in milliseconds between image swaps 1000 = 1 second 
var delay = 5000;
var counter = 0;

function preloadImgs(){
  for(var i=0;i<imgs.length;i++){
    MM_preloadImages(imgs[i]);
  }
}

function randomImages(){
  if(counter == (imgs.length)){
    counter = 0;
  }
  MM_swapImage('rotator', '', imgs[counter++]);
  setTimeout('randomImages()', delay);
}

//BEAUTY  PAGES

// Comma separated list of images to rotate 
var imgs_beauty = new Array('../img/beauty/0127.jpg','../img/beauty/IMG_0970.jpg','../img/beauty/IMG_0556.jpg','../img/beauty/IMG_6989.jpg','../img/beauty/makeup_hair/side/intro.jpg','../img/beauty/2.jpg','../img/beauty/makeup_hair/top/5.jpg','../img/beauty/IMG_8458.jpg','../img/beauty/IMG_8513.jpg','../img/beauty/IMG_7040.jpg','../img/beauty/IMG_0560.jpg','../img/beauty/IMG_7033.jpg','../img/beauty/IMG_6996.jpg','../img/beauty/IMG_0498.jpg');
// delay in milliseconds between image swaps 1000 = 1 second 
var delay = 5000;
var counter = 0;

function preloadImgs_beauty(){
  for(var i=0;i<imgs_beauty.length;i++){
    MM_preloadImages(imgs_beauty[i]);
  }
}

function randomImages_beauty(){
  if(counter == (imgs_beauty.length)){
    counter = 0;
  }
  MM_swapImage('rotator_beauty', '', imgs_beauty[counter++]);
  setTimeout('randomImages_beauty()', delay);
}

//MAKE-UP AND HAIR PAGE

// Comma separated list of images to rotate 
var imgs_makeup_hair = new Array('../img/beauty/beauty_slide_show/IMG_0556.jpg','../img/beauty/beauty_slide_show/IMG_0639.jpg','../img/beauty/beauty_slide_show/IMG_6413.jpg','../img/beauty/beauty_slide_show/IMG_6454.jpg','../img/beauty/beauty_slide_show/0127.jpg','../img/beauty/beauty_slide_show/beaute.jpg','../img/beauty/beauty_slide_show/beaute_maquillage.jpg','../img/beauty/beauty_slide_show/IMG_1868-2.jpg','../img/beauty/beauty_slide_show/IMG_3258.jpg','../img/beauty/beauty_slide_show/IMG_3378.JPG','../img/beauty/beauty_slide_show/IMG_3386.JPG','../img/beauty/beauty_slide_show/IMG_4209.jpg','../img/beauty/beauty_slide_show/IMG_5383.jpg','../img/beauty/beauty_slide_show/IMG_6173.jpg','../img/beauty/beauty_slide_show/IMG_7040.jpg','../img/beauty/beauty_slide_show/IMG_7176.jpg');
// delay in milliseconds between image swaps 1000 = 1 second 
var delay = 5000;
var counter = 0;

function preloadImgs_makeup_hair(){
  for(var i=0;i<imgs_makeup_hair.length;i++){
    MM_preloadImages(imgs_makeup_hair[i]);
  }
}

function randomImages_makeup_hair(){
  if(counter == (imgs_makeup_hair.length)){
    counter = 0;
  }
  MM_swapImage('rotator_makeup_hair', '', imgs_makeup_hair[counter++]);
  setTimeout('randomImages_makeup_hair()', delay);
}

//TESTIMONIES PAGES - A.SPINA

// Comma separated list of images to rotate 
var imgs_test_spina = new Array('../img/testimonies/spina/a_spina1.jpg','../img/testimonies/spina/a_spina2.jpg','../img/testimonies/spina/a_spina3.jpg','../img/testimonies/spina/a_spina4.jpg','../img/testimonies/spina/a_spina5.jpg','../img/testimonies/spina/a_spina6.jpg','../img/testimonies/spina/a_spina7.jpg','../img/testimonies/spina/a_spina8.jpg','../img/testimonies/spina/a_spina9.jpg');
// delay in milliseconds between image swaps 1000 = 1 second 
var delay = 5000;
var counter = 0;

function preloadImgs_test_spina(){
  for(var i=0;i<imgs_test_spina.length;i++){
    MM_preloadImages(imgs_test_spina[i]);
  }
}

function randomImages_test_spina(){
  if(counter == (imgs_test_spina.length)){
    counter = 0;
  }
  MM_swapImage('rotator_test_spina', '', imgs_test_spina[counter++]);
  setTimeout('randomImages_test_spina()', delay);
}

//TESTIMONIES PAGES - TIFFANY

// Comma separated list of images to rotate 
var imgs_tiffany = new Array('../img/testimonies/tiffany/01.jpg','../img/testimonies/tiffany/02.jpg','../img/testimonies/tiffany/03.jpg','../img/testimonies/tiffany/04.jpg','../img/testimonies/tiffany/05.jpg','../img/testimonies/tiffany/06.jpg','../img/testimonies/tiffany/07.jpg','../img/testimonies/tiffany/08.jpg','../img/testimonies/tiffany/09.jpg','../img/testimonies/tiffany/10.jpg');
// delay in milliseconds between image swaps 1000 = 1 second 
var delay = 5000;
var counter = 0;

function preload_imgs_testimonials(){
  for(var i=0;i<imgs_tiffany.length;i++){
    MM_preloadImages(imgs_tiffany[i]);
  }
}

function randomImages_imgs_tiffany(){
  if(counter == (imgs_tiffany.length)){
    counter = 0;
  }
  MM_swapImage('tiffany_rotator', '', imgs_tiffany[counter++]);
  setTimeout('randomImages_imgs_tiffany()', delay);
}

//TESTIMONIES PAGES - SARIAKA

// Comma separated list of images to rotate 
var imgs_sariaka = new Array('../img/testimonies/sariaka/1.jpg','../img/testimonies/sariaka/2.jpg');
// delay in milliseconds between image swaps 1000 = 1 second 
var delay = 5000;
var counter = 0;

function preload_imgs_sariaka(){
  for(var i=0;i<imgs_sariaka.length;i++){
    MM_preloadImages(imgs_sariaka[i]);
  }
}

function randomImages_imgs_sariaka(){
  if(counter == (imgs_sariaka.length)){
    counter = 0;
  }
  MM_swapImage('sariaka_rotator', '', imgs_sariaka[counter++]);
  setTimeout('randomImages_imgs_sariaka()', delay);
}

//TESTIMONIES MAIN PAGE

// Comma separated list of images to rotate 
var imgs_testimonials = new Array('../img/testimonies/carina/01.jpg','../img/testimonies/sariaka/1.jpg','../img/testimonies/thelin/thelin01.jpg','../img/testimonies/spina/a_spina3.jpg','../img/testimonies/javier et christel/javier-et-christel.jpg','../img/testimonies/isabelle burfin/DSC06694.jpg','../img/testimonies/christelle marchon/christelle marchon.jpg','../img/testimonies/bourquin/bourquin_1.jpg','../img/testimonies/audrey prieto/audrey-prieto.jpg');
// delay in milliseconds between image swaps 1000 = 1 second 
var delay = 5000;
var counter = 0;

function preload_imgs_testimonials(){
  for(var i=0;i<imgs_testimonials.length;i++){
    MM_preloadImages(imgs_testimonials[i]);
  }
}

function randomImages_imgs_testimonials(){
  if(counter == (imgs_testimonials.length)){
    counter = 0;
  }
  MM_swapImage('rotator_testimonials', '', imgs_testimonials[counter++]);
  setTimeout('randomImages_imgs_testimonials()', delay);
}

//SERVICES PAGE

// Comma separated list of images to rotate 
var imgs_services = new Array('../img/shop/imp1.jpg','../img/shop/small/miss_suisse_r_1.jpg','../img/shop/small/miss_suisse_r_2.jpg','../img/shop/small/miss_suisse_r_8');
// delay in milliseconds between image swaps 1000 = 1 second 
var delay = 5000;
var counter = 0;

function preloadImgs_services(){
  for(var i=0;i<imgs_services.length;i++){
    MM_preloadImages(imgs_services[i]);
  }
}

function randomImages_services(){
  if(counter == (imgs_services.length)){
    counter = 0;
  }
  MM_swapImage('rotator_services', '', imgs_services[counter++]);
  setTimeout('randomImages_services()', delay);
}
// #########################################################################

// This script was supplied free by Hypergurl
// http://www.hypergurl.com
<!--
    // JavaScript to interpolate random images into a page.
    var ic = 3;     // Number of alternative images
    var xoxo = new Array(ic);  // Array to hold filenames
        
xoxo[0] = "img/photography/small/IMG_3651.jpg";
xoxo[1] = "img/photography/small/IMG_2855_2.jpg";
xoxo[2] = "img/photography/small/IMG_3609.jpg";

function pickRandom(range) {
if (Math.random)
return Math.round(Math.random() * (range-1));
else {
var now = new Date();
return (now.getTime() / 1000) % range;
}
}
// Write out an IMG tag, using a randomly-chosen image name.
var choice = pickRandom(ic);

// -->

<!--
function openpopup_res_orga(){
var popurl="/pages/form_reservation/form_reservation.htm"
winpops=window.open(popurl,"res_orga","width=440,height=550,scrollbars=yes,")
}


function popup_photo2(p) {
	win=window.open(p,'window','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=615,height=610');
	win.focus();
}

function popUp(url) {
	win=window.open(url,'window','toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=450,height=300');
	win.focus();
}

function popupScroll(url, w, h) {
	var windowprops = "width=" + w + ",height=" + h + ", toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no";
	window.open(url,'',windowprops);
}

function popupImage2(file,w,h) { 
if (this.focus == null) return;
var win= open('','Image', 'width='+(w+60)+',height='+(h+60)+',status=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes'); 
var d=win.document;
d.open(); 
if (win.moveTo != null) win.moveTo(0,0);
win.focus();
d.write('<html><head><title>Votre Majesté - Geneva</title><link rel="stylesheet" href="votremajeste.css" type="text/css"></head><body bgcolor="#344979" marginwidth="30" marginheight="30" leftmargin="30" topmargin="30">');
d.write('<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td><div align="center"><img src="'+file+'" width="'+w+'" height="'+h+'" id="photo"><br></div></td></tr></table>');
d.write('</body></html>');
d.close();
}


//-->

// DW FUNCTIONS ##########################################################

<!--
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_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//-->


// CUSTOMS FUNCTIONS #######################################################

function popupCenter(url,w,h) { 
if (this.focus == null) return;
var win= open('','', 'width='+(w+0)+',height='+(h+0)+',status=no,toolbar=no,menubar=no,resizable=no'); 
var d=win.document;
d.open(); 

var heightWin = (screen.height-h)/2;
var widthWin = (screen.width-w)/2;

if (win.moveTo != null) win.moveTo(widthWin,heightWin);
win.focus();
d.write('<html><head><title>La Réserve - Genève</title>');
d.write('<script language="Javascript">window.location.href = \''+url+'\'</script>');
d.write('</head><body></body></html>');
d.close(); 
}

function ppopup(url, w, h) {
var windowprops = "width=" + w + ",height=" + h + ", toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
window.open(url,'popwin',windowprops);
}

function popupScroll(url, w, h) {
var windowprops = "width=" + w + ",height=" + h + ", toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no";
window.open(url,'',windowprops);
}

function popupChambres(url) {
var windowprops = "width=540,height=540, toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
window.open(url,'popwin',windowprops);
}


function popupImage(file,w,h) { 
if (this.focus == null) return;
var win= open('','Image', 'width='+(w+60)+',height='+(h+60)+',status=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes'); 
var d=win.document;
d.open(); 
if (win.moveTo != null) win.moveTo(0,0);
win.focus();
d.write('<html><head><title>Votre Majesté - Geneva</title><link rel="stylesheet" href="../css/votremajeste.css" type="text/css"></head><body bgcolor="#344979" marginwidth="30" marginheight="30" leftmargin="30" topmargin="30">');
d.write('<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td><div align="center"><img src="../%27+file+%27" width="'+w+'" height="'+h+'" id="photo"><br> <a href="javascript:popupImage(\'<?=$articles["article_photo_back"];?\>\',300,450);">Voir l\'arrière de la robe</a></div></td></tr></table>');
d.write('</body></html>');
d.close();
}


function popupChambres(selObj,restore,lang) {
if (selObj.options[selObj.selectedIndex].value == null) return;
var windowprops = "width=820,height=560, toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
window.open("/pages/popup_chambres.php?room="+selObj.options[selObj.selectedIndex].value+"&langue="+lang,'popwin',windowprops);
if (restore) selObj.selectedIndex=0;
}

function popupHotel(selObj,restore,lang) {
if (selObj.options[selObj.selectedIndex].value == null) return;
var windowprops = "width=820,height=560, toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
window.open("/pages/popup_hotel.php?place="+selObj.options[selObj.selectedIndex].value+"&langue="+lang,'popwin',windowprops);
if (restore) selObj.selectedIndex=0;
}


