function toggleDivDisplay(divId) {
	if (document.getElementById(divId).style.display == "none")
		document.getElementById(divId).style.display = "block";
	else
		document.getElementById(divId).style.display = "none";
}

function showDiv(divId) {
	document.getElementById(divId).style.display = "block";
}

function hideDiv(divId) {
	document.getElementById(divId).style.display = "none";
}

var popupWindow = false; 
function openPopup(url,w,h) {
	x = screen.width/2-w/2;
	y = screen.height/2-h/2;
	if (popupWindow) popupWindow.close();
    popupWindow=window.open(url,'ny','toolbar=no,copyhistory=no,location=no,' + 'directories=no,status=no,menubar=no,scrollbars=no,' +'resizable=no,width=' + w + ',height=' + h + ',top=' + y +',left=' + x);
}

function openPopupPay(url,w,h) {
	x = screen.width/2-w/2;
	y = screen.height/2-h/2;
	if (popupWindow) popupWindow.close();
    popupWindow=window.open(url,'ny','toolbar=no,copyhistory=no,location=yes,' + 'directories=no,status=yes,menubar=no,scrollbars=yes,' +'resizable=no,width=' + w + ',height=' + h + ',top=' + y +',left=' + x);
}

function toggleImage(element) {
	curImg = document.getElementById(element).src
	if (curImg.match("_on.") == "_on.") {
		document.getElementById(element).src = curImg.replace(/_on./i,"_off.")
	}
	else {
		document.getElementById(element).src = curImg.replace(/_off./i,"_on.")
	}
}
function toggleClass(element) {
	curClass = document.getElementById(element).className
	if (curClass == "Off") {
		//document.getElementById(element).src = curImg.replace(/_on./i,"_off.")
		newClass = 'On'
	}
	else {
		//document.getElementById(element).src = curImg.replace(/_off./i,"_on.")
		newClass = 'Off'
	}
	document.getElementById(element).className = newClass 


}

function product_preview(img) {
	document.getElementById('SlideShow').src=img;
	document.getElementById('popupImageLink').href=img.replace(/\/b\//,"/c/");
	Lightbox.prototype.updateImageList();
}
function getUpdate(type,parameter1,parameter2) { //flashrotator status function
  if (type == 'item') {
	document.getElementById("imgNr").innerHTML = parameter1+1;
	document.getElementById("popupTextLink").onclick = function() { doImageClick(parameter1+1) };

  }
}

