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 


}
