var whichDomain = window.location + "";
whichDomain = whichDomain.replace(/http:\/\//gi, ''); 
whichDomain = whichDomain.replace(/\/.+/gi, ''); 
whichDomain = whichDomain.toUpperCase();
if(whichDomain!="WWW.COOLIBAR.COM")
{
   document.write("<ME"+"TA NAME='ROBOTS' CONTENT='NO"+"INDEX, FOLLOW'>");
}

function placeBackOrder()
{
 document.getElementById('frmOrder').submit(); 
}
function cancelBackOrder()
{
 document.getElementById('backOrdered').style.display = 'none'; 
}

function order()
{
  var go = true;
  var optionString = ''; 
  var x = optionNames.length - 1;
  var q = 0;
  while (q < x)
  {
    eval("var theSel = document.getElementById('"+optionNames[q]+"');");
    if(theSel.selectedIndex==0)
    { alert("Please select a "+optionNames[q]+" from the dropdown menu.");
      go = false;  }
    else
    {
      optionString = optionString + theSel[theSel.selectedIndex].value;
    }
    q++;
  }
  if(document.getElementById('vwquantity').selectedIndex==0)
  { alert ("Please select a quantity from the dropdown menu.");
    go = false; }
 var w = 1;
 while(unCombos[w])
 {
  if(unCombos[w]==optionString)
  { go = false;
    alert("Sorry, the size/color combination you selected is unavailable.\nPlease make a different choice.");  }
  w++;
 }

 if(go)
 {
  var w = 1;
  while(backCombos[w])
  {
   if(backCombos[w]==optionString)
   { go = false;
     document.getElementById('backOrdered').style.display = '';  }
   w++;
  }
  if(go)
  { document.getElementById('frmOrder').submit(); }
 }
}
function switchPhoto(newPhoto,bigPhoto)
{
    document.getElementById('spnImage').innerHTML = "<a href=javascript:CaricaFoto('"+bigPhoto+"');><img border=0 src="+newPhoto+"></a>";
}

function CaricaFoto(img){
  if(navigator.userAgent.indexOf("Win") != -1)
  {   foto1= new Image();
      foto1.src=(img);
      Controlla(img);   }
  else
  {   window.open(img,"Popup","toolbar=0, location=0,status=0,menubar=0,scrollbars=0,resizable=1,width=530,height=440");   }
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}

