function setHeight()
{
 piccol = document.getElementById('pic1');
 logocol = document.getElementById('logo1');
 textcol = document.getElementById('text');
 menucol = document.getElementById('mainnav');
 centralcol = document.getElementById('central');

 p = piccol.clientHeight;
 l = logocol.clientHeight;
 t = textcol.clientHeight;
 m = menucol.clientHeight;

 x = p + l + t + 2;

 if (x > m)
 {
  menucol.style.height = x;
  centralcol.style.height = x + 103 + 3;
 }
 else
 {
  textcol.style.height = m - l - p - 2;
  centralcol.style.height = m + 103 + 3;
 }
}

function setSubHeight()
{
 subtextcol = document.getElementById('subtext');
 menucol = document.getElementById('mainnav');
 centralcol = document.getElementById('central');
 footercol = document.getElementById('footer');

 s = subtextcol.clientHeight;
 m = menucol.clientHeight;

 maxheight = Math.max(m,s);

 menucol.style.height = maxheight + 53 + 1;
 subtextcol.style.height = maxheight;
 footercol.style.top = maxheight + 103 + 3;
 footercol.style.visibility = 'visible';
 centralcol.style.height = maxheight + 103 + 53 + 4;
}

function checkSearch()
{
 f=document.search;
 if (f.words.value=='')
 {
  alert("Please enter something in the search box");
  return(false);
 }
}

function changeListing(cell)
{
 document.getElementById('t'+cell).className='listThumb2';
 document.getElementById('n'+cell).className='listName2';
 document.getElementById('p'+cell).className='listPrice2';
}

function revertListing(cell)
{
 document.getElementById('t'+cell).className='listThumb';
 document.getElementById('n'+cell).className='listName';
 document.getElementById('p'+cell).className='listPrice';
}

function openImage(img)
{
 check=0;
 while (check==0)
 {
  pos=img.indexOf(" ");
  if (pos!=-1)
   img = img.replace(" ","%20");
  else
   check=1;
 }

  var params="menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,dependent,top=0,left=0,width=1,height=1";
  var random = Math.floor(Math.random()*9999999);
  popupWin = window.open('', random,params);
  popupWin.document.write('<HTML><HEAD><TITLE></TITLE></HEAD><BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0><TABLE WIDTH=500 BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><A HREF=javascript:window.close()><IMG SRC='+img+' BORDER=0 ALT="Click to close window" NAME=image></A></TD></TR></TABLE></BODY></HTML>');
setTimeout('reSize()',500);
}

function reSize()
{
 var width = popupWin.document.image.width;
 var height = popupWin.document.image.height;

 if (document.layers)
 {
  popupWin.window.outerWidth = width;
  popupWin.window.outerHeight = height;		
 }
 else
  popupWin.window.resizeTo(width+10,height+29);
}

function showDefaultThumb(img)
{
 img.src='http://www.aeroleatherclothing.com/images/noimage_thumb.gif';
}

function showDefaultMain(img)
{
 img.src='http://www.aeroleatherclothing.com/images/noimage_default.gif';
}

function numbersOnly(field)
{
 var valid = "0123456789"
 ok = 1;
 var temp;
 for (var i=0; i<field.value.length; i++)
 {
  temp = "" + field.value.substring(i, i+1);
  if (valid.indexOf(temp) == "-1")
   ok = 0;
 }
 if (ok==0)
 {
  alert("Please only enter numbers in this field!");
  field.focus();
  field.select();
 }
}

function showBasket(url)
{
 if (document.cookie!='')
 {
  document.getElementById('basketLink').innerHTML='<A HREF="'+url+'?purpose=checkbasket">VIEW BASKET</A>';
 }
}

