// 
//

// POPUP WINDOW
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=705');");
}

//FORM VALIDATION
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+' 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 == '');
} }
//-->


// IMAGE SWAPPING FUNCTION
//right-side aligned-->

var ranimgright = new Array(); 

ranimgright[0] = 'src="images/ming_clump.jpg" alt="Ming (IB)" title="Ming (IB)"';
ranimgright[1] = 'src="images/world_premier.jpg" alt=World Premier (TB)" title="World Premier (TB)"';
ranimgright[2] = 'src="images/shy_violet.jpg" alt="Shy Violet (SDB)" title="Shy Violet (SDB)"';
ranimgright[3] = 'src="images/suspect.jpg" alt="Suspect (AB)" title="Suspect (AB)"';
ranimgright[4] = 'src="images/face_of_an_angel.jpg" alt="Face of an Angel (TB)" title="Face of an Angel (TB)"';
ranimgright[5] = 'src="images/wild_frontier.jpg" alt="Wild Frontier (TB)" title="Wild Frontier (TB)"';
ranimgright[6] = 'src="images/japanese_ida_garten.jpg" alt="Ina Garten (JI)" title="Ina Garten (JI)"';
ranimgright[7] = 'src="images/hot_news.jpg" alt ="Hot News (MTB)" title="Hot News (MTB)"';
ranimgright[8] = 'src="images/mermaids_dream.jpg" alt ="Mermaids Dream (BB)" title="Mermaids Dream (BB)"';
ranimgright[9] = 'src="images/ikenobo_ikebana.jpg" alt ="Ikenobo Ikebana arrangement" title="Ikenobo Ikebana arrangement"';

var j = 0
var p = ranimgright.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = ranimgright[i]
}
var whichImageright = Math.round(Math.random()*(p-1));
function showImageRight(){
document.write('<img '+ranimgright[whichImageright]+'>');
}

//Alternate random image swapping
//left-side aligned-->

var ranimgleft = new Array(); 

ranimgleft[0] = 'src="images/charming_billy.jpg" alt="Charming Billy (SIB)" title="Charming Billy (SIB)"';
ranimgleft[1] = 'src="images/larrys_girl.jpg" alt="Larrys Girl (MTB)" title="Larrys Girl (MTB)"';
ranimgleft[2] = 'src="images/soft_air.jpg" alt="Soft Air (SDB)" title="Soft Air (SDB)"';
ranimgleft[3] = 'src="images/ginger_twist.jpg" alt="Ginger Twist (SIB)" title="Ginger Twist"';
ranimgleft[4] = 'src="images/cape_cod_boys.jpg" alt="Cape Cod Boys (SIB)" title="Cape Cod Boys (SIB)"';
ranimgleft[5] = 'src="images/seakist.jpg" alt ="Seakist (TB)" title="Seakist (TB)"';
ranimgleft[6] = 'src="images/raspberry_candy.jpg" alt ="Raspberry Candy (JI)" title="Raspberry Candy (JI)"';
ranimgleft[7] = 'src="images/pixie_pirate.jpg" alt ="Pixie Pirate (MDB)" title="Pixie PIrate (MDB)"';
ranimgleft[8] = 'src="images/riverdance.jpg" alt ="Riverdance (SIB)" title="Riverdance (SIB)"';
ranimgleft[9] = 'src="images/over_the_river.jpg" alt ="Over The River (SIB)" title="Over The River (SIB)"';

var j = 0
var p = ranimgleft.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = ranimgleft[i]
}
var whichImageleft = Math.round(Math.random()*(p-1));
function showImageLeft(){
document.write('<img '+ranimgleft[whichImageleft]+'>');
}

