var oPrevSelectedMenu;

menuHover = function() {
	var oMenu = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0;i<oMenu.length;i++) {
		oMenu[i].onmouseover=function() {
			this.className+=" menuHover";
		}
		oMenu[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" menuHover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", menuHover);

function showPicture(cURL, nWidth, nHeight) {
  return window.open(cURL,'','toolbar=no, location=no,scrollbars=no, status=no, width='+ (nWidth + 20) +', height='+ (nHeight + 20))
}

function addToBasket(oHref, cInputAmountID) {
	window.location = oHref + '&amount=' + window.document.getElementById(cInputAmountID).value;
	return false;
}

function showSubMenu(oThis) {
	if (oPrevSelectedMenu) {
		oPrevSelectedMenu.className = oPrevSelectedMenu.className.replace(' displaySubMenu', '');
	};
	if (oThis) {
		oThis.className = oThis.className + ' displaySubMenu';
		oPrevSelectedMenu = oThis;
	};
}

function setCss(lChecked, theClass, theStyle, theValue) {
   var CSSRules;

   if (!lChecked) {
	 theValue = '';
   }

   if (document.all) {
     CSSRules = 'rules'
   } else if (document.getElementById) {
     CSSRules = 'cssRules'
   }

   for (var i = 0; i < document.styleSheets[2][CSSRules].length; i++) {
     if (document.styleSheets[2][CSSRules][i].selectorText == theClass) {
       document.styleSheets[2][CSSRules][i].style[theStyle] = theValue;
     }
   }
}