// JavaScript Document
var rand1 = 0;
var useRand = 0;
var rand2 = 0;
var useRand2 = 0;

images = new Array;
iderma = new Array;
images[1] = new Image();
images[1].src = "imgs_product/image1.jpg";
iderma[1] = 'http://www.iderma.com/product/skinmedica_tns_recovery_complex/';
images[2] = new Image();
images[2].src = "imgs_product/image2.jpg";
iderma[2] = 'http://www.iderma.com/product/pumice_cleanser/';
images[3] = new Image();
images[3].src = "imgs_product/image3.jpg";
iderma[3] = 'http://www.iderma.com/department/susan_posnick/';
images[4] = new Image();
images[4].src = "imgs_product/image4.jpg";
iderma[4] = 'http://www.iderma.com/product/neocutis_lumiere_bio-restorative_eye_cream/';

function swapPic() {
var imgnum = images.length - 1;
do {
var randnum = Math.random();
rand1 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand1 == useRand);
useRand = rand1;
document.randimg.src = images[useRand].src;
currurl = document.getElementById("skinproducturl");
currurl.href = iderma[useRand];
return true;
}

imgs = new Array;
imgs[1] = new Image();
imgs[1].src = "imgs_wd/img01.jpg";
imgs[2] = new Image();
imgs[2].src = "imgs_wd/img02.jpg";
imgs[3] = new Image();
imgs[3].src = "imgs_wd/img03.jpg";

function swapImg() {
var imgnum = imgs.length - 1;
do {
var randnum = Math.random();
rand2 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand2 == useRand2);
useRand2 = rand2;
document.wdhomeimg.src = imgs[useRand2].src;
return true;
}