accessoriesImages = [
"/i/accessories/Black-and-White.jpg",
    "/i/accessories/Burgundy-and-Line.jpg",
    "/i/accessories/Dusky-Pastels.jpg",
	"/i/accessories/Fascinator.jpg",
	"/i/accessories/Green.jpg",
	"/i/accessories/Selection-of-Bracelets.jpg",
	"/i/accessories/Turquoise.jpg"
   
];


eveningImages = [
	"/i/formal-wear/Noli-Brown-Chiffon.jpg",
    "/i/formal-wear/Noli-Cranberry-Chiffon.jpg",
    "/i/formal-wear/Noli-Navy-Chiffon.jpg",
	 "/i/formal-wear/Noli-Navy-Chiffon2.jpg"
];

shoppingImages = [
    "/i/private-shopping/Chandalier-at-The-Find.jpg",
    "/i/private-shopping/Changing-Rooms.jpg",
    "/i/private-shopping/Sequin-Dress.jpg",
	   "/i/private-shopping/wrap.jpg",
    "/i/private-shopping/clothes.jpg"
];


///////// FUNCTIONS /////////////////

function openWin() {
    popWin=window.open('popup.html','popup','scrollbars=1,top=100,left=400,width=312,height=362');
    popWin.focus();
    return false;
}

function replaceImages(){
    first = Math.floor(Math.random() * images.length);
    second = 0;
    while(true){
        second = parseInt(Math.floor(Math.random() * images.length));
        if (first != second){
            break;
        }
    }
    document.image1.src = images[first].src;
   document.image2.src = images[second].src;
}

function replaceHomeImages(){
    if (mImages.length == 1){
	first = 1;
    }else{
	first = Math.floor(Math.random() * mImages.length);
    }
    
   if (dImages.length == 1){
        second = 1;
   }else{
	second = Math.floor(Math.random() * dImages.length);
   }
    
    if ((Math.floor(Math.random() * 100)) % 2 == 0){
        document.image1.src = mImages[first].src;
        document.image2.src = dImages[second].src;
    }else{
        document.image1.src = dImages[second].src;
        document.image2.src = mImages[first].src;
    }

}

function startStaticImageAnimation(){
    window.setInterval(
        function changeImages(){
            new Effect.Fade('imageBar', {queue:'front', duration:2, to:0.01, afterFinish:replaceImages});
            new Effect.Appear('imageBar', {queue:'end', from:0.01, to:1.0, duration:3.0});
        },
        6000
    );
}

function startHomeImageAnimation(){
    window.setInterval(
        function changeImages(){
            new Effect.Fade('imageBar', {queue:'front', duration:2, to:0.01, afterFinish:replaceHomeImages});
            new Effect.Appear('imageBar', {queue:'end', from:0.01, to:1.0, duration:3.0});
        },
        6000
    );
}


