S111 = function() { 
 this.category = document.getElementById('category');
 this.categoryImg = document.getElementById('categoryimage');
 this.mainImage = document.getElementById('mainimage');
 this.mainImageLink = document.getElementById('mainimage_href')
}

S111.prototype.swapImage = function (img,id)  {
 this.mainImage.src=img;
 var href = document.getElementById(id);
 if(!href||!href.href) return;
 this.mainImageLink = href.href;
}

S111.prototype.hideCategory = function() {
  this.category.style.visibility='hidden';  
}

S111.prototype.showCategory = function (img) {
  this.categoryImg.src = img
  this.category.style.visibility='visible';  
}

function preloadImages(urls)
{
  for(var i = 0; i < urls.length; i++) {
	var img = new Image();
	img.src = urls[i];
  }
}


function openWindow(url,w,h)
{
  var opts = 'width='+w+',height='+h+',top=75,left=175';
  window.open(url,null,opts);
  return false;
}

