function disableCheckout(obj,obj2,msg) {
		obj.disabled=true;
		obj.href=""; 
		obj2.disabled=true;
		obj2.className='txtHidden';
		obj2.value=msg; 
	}

	function bookmark(url,title){
		if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
			window.external.AddFavorite(url,title);
		} else if (navigator.appName == "Netscape") {
			window.sidebar.addPanel(title,url,"");
		} else {
			alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
		}
	}

	function img2_toggle(butid, imgid, img0, img1) {
		if (document.getElementById(butid).value == 1) {
			document.getElementById(butid).value=0;
			document.getElementById(imgid).src=img0;
			return;
			}
		if (document.getElementById(butid).value == 0) {
			document.getElementById(butid).value=1;
			document.getElementById(imgid).src=img1;
			return;
			}
		}

	function img_toggle(butid, imgid) {
		if (document.getElementById(butid).value == 1) {
			document.getElementById(butid).value=0;
			document.getElementById(imgid).src= "images/general/cross.gif";
			return;
			}
		if (document.getElementById(butid).value == 0) {
			document.getElementById(butid).value=1;
			document.getElementById(imgid).src="images/general/tick.gif";
			return;
			}
		}

	function img_toggleSM(butid, imgid) {
		if (document.getElementById(butid).value == 1) {
			document.getElementById(butid).value=0;
			document.getElementById(imgid).src= "images/general/sm_cross.gif";
			return;
			}
		if (document.getElementById(butid).value == 0) {
			document.getElementById(butid).value=1;
			document.getElementById(imgid).src="images/general/sm_tick.gif";
			return;
			}
		}

// Standard is 0-X 1-Tick 
// 3way is 0-X 1-Tick 2-Warn  order is 0>2>1>0

	function img3_rotate(butid, imgid, img0, img1, img2) {
		if (document.getElementById(butid).value == 0) {
			document.getElementById(butid).value=2;
			document.getElementById(imgid).src=img0;
			return;
			}
		if (document.getElementById(butid).value == 1) {
			document.getElementById(butid).value=0;
			document.getElementById(imgid).src=img1;
			return;
			}
		if (document.getElementById(butid).value == 2) {
			document.getElementById(butid).value=1;
			document.getElementById(imgid).src=img2;
			return;
			}
		}

	function img_rotate3(butid, imgid) {
		if (document.getElementById(butid).value == 0) {
			document.getElementById(butid).value=2;
			document.getElementById(imgid).src= "images/general/warn.gif";
			return;
			}
		if (document.getElementById(butid).value == 1) {
			document.getElementById(butid).value=0;
			document.getElementById(imgid).src= "images/general/cross.gif";
			return;
			}
		if (document.getElementById(butid).value == 2) {
			document.getElementById(butid).value=1;
			document.getElementById(imgid).src="images/general/tick.gif";
			return;
			}
		}

	function img_rotate3SM(butid, imgid) {
		if (document.getElementById(butid).value == 0) {
			document.getElementById(butid).value=2;
			document.getElementById(imgid).src= "images/general/sm_warn.gif";
			return;
			}
		if (document.getElementById(butid).value == 1) {
			document.getElementById(butid).value=0;
			document.getElementById(imgid).src= "images/general/sm_cross.gif";
			return;
			}
		if (document.getElementById(butid).value == 2) {
			document.getElementById(butid).value=1;
			document.getElementById(imgid).src="images/general/sm_tick.gif";
			return;
			}
		}

	// Image rotate by KGB eCommerce (c)2008 (order is 0, 1, 2)
	function img_rotate(butid, imgid, img0, img1, img2) {
		if (document.getElementById(butid).value == 0) {
			document.getElementById(butid).value=1;
			document.getElementById(imgid).src=img1;
			return;
			}
		if (document.getElementById(butid).value == 1) {
			document.getElementById(butid).value=2;
			document.getElementById(imgid).src=img2;
			return;
			}
		if (document.getElementById(butid).value == 2) {
			document.getElementById(butid).value=0;
			document.getElementById(imgid).src=img0;
			return;
			}
		}
		
	function KGBwinResize () {
	  var rqWinX = document.getElementById('popW').value;
	  var rqWinXu = document.getElementById('popWu').value;
	  var rqWinY = document.getElementById('popH').value;
	  var rqWinYu = document.getElementById('popHu').value;
	
	  var width = window.innerWidth;
	  var height = window.innerHeight;
	
		if ((rqWinXu = "px") && (rqWinX > 400)) width = rqWinX;
		if ((rqWinYu = "px") && (rqWinY > 300)) height = rqWinY;
		resizeTo(width,height);
		}


function limitTextChars(textEntryId, counterId, maxChars) {
	if (textEntryId.value.length > maxChars) {
		textEntryId.value = textEntryId.value.substring(0, maxChars);
		} else {
		counterId.value = maxChars - textEntryId.value.length;
		}
	}