			function SetCookie(name, value, expires, path, domain, secure) {
				document.cookie = name + "=" + escape(value) +
					((expires) ? "; expires=" + expires.toGMTString() : "") +
					((path) ? "; path=" + path : "") +
					((domain) ? "; domain=" + domain : "") +
					((secure) ? "; secure" : "");
			}
			function DeleteCookie(name, path, domain) {
				if (GetCookie(name)) {
					document.cookie = name + "=" + ((path) ? "; path=" + path : "") +
						((domain) ? "; domain=" + domain : "") +
						"; expires=Thu, 01-Jan-70 00:00:01 GMT";
				}
			}
			function GetCookie(name) {
				var arg = name + "=";
				var alen = arg.length;
				var clen = document.cookie.length;
				var i = 0;

				while (i < clen) {
					var j = i + alen;
					if (document.cookie.substring(i, j) == arg)
						return GetCookieVal(j);
					i = document.cookie.indexOf(" ", i) + 1;
					if (i == 0) break;
				}
				return null;
			}
			function GetCookieVal(offset) {
				var endstr = document.cookie.indexOf(";", offset);
				if (endstr == -1) 
					endstr = document.cookie.length;
				return unescape(document.cookie.substring(offset, endstr));
			}
			if (parseInt(navigator.appVersion) >= 4) {
				browserName = (navigator.appName == "Netscape") ? "ns40" : ((navigator.appName == "Microsoft Internet Explorer") ? "ms40" : "null");
			} else {
				browserName = "null";
			}

			function showLayer(which) {
				if (document.getElementById) eval("document.getElementById('" + which + "').style.visibility = 'visible'");
				if (browserName != "null") (browserName == "ms40") ? (document.all[which].style.visibility = 'visible') : (document.layeyrs[which].visibility = 'show');
			}

			function hideLayer(which) {
				if (document.getElementById) eval("document.getElementById('" + which + "').style.visibility = 'hidden'");
				if (browserName != "null") (browserName == "ms40") ? (document.all[which].style.visibility = 'hidden') : (document.layers[which].visibility = 'hide');
			}
			
			var win = null;			
			// center (boolean) url, windowName, resizable, scrollbars, toolbars
			function NewWindow(center,url,name,w,h,r,sb,tb) 
			{
				
		        if(center == true) 
				{
                	var LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	                var TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    		    }
				//alert(center +", "+ url+", "+name+", "+w+", "+h+", "+r+", "+sb+", "+tb)
		        var win = window.open(url, name, "top=" + TopPosition + ",left=" + LeftPosition + ", height=" + h + ",width=" + w + ", resizable=" + r +", scrollbars=" + sb + ",toolbar=" + tb + ",status=no");
			}
			
			function CloseNewWin()
			{
				if(win!=null && win.open)win.close()
			}
			window.onfocus=CloseNewWin;

			function OpenLoginWindow() {
				NewWindow(true, "/jp/club/login.php", "join", 623, 401, false, 1, false);
			}
		
			function OpenJoinWindow() {
				NewWindow(true, "/jp/club/join.php", "join", 623, 401, false, 1, false);
			}
			
			function OpenForgotClubPassword() {
				NewWindow(true, "/jp/club/login.php?action=vip_forgot", "join", 623, 401, false, 1, false);
			}
			
			function OpenOutOfStock(id) {
				NewWindow(true, "/Shop/out_of_stock.php?productid="+id, "OutOfStock", 520, 280, false, 1, false);
			}
						
			function swapImage(imgName,swapSrc) {
				eval("document." + imgName + ".src = \"" + swapSrc + "\"");
			}
			function swapImage2(imgName,swapSrc) {
				
				imgName.src = swapSrc;
				//eval("document." + imgName + ".src = \"" + swapSrc + "\"");
			}
			function jumpItem(menuItem) {
				var newItem = menuItem.options[menuItem.selectedIndex].value;
				if (newItem != "") {
					window.location.href=newItem
				}
			}
			var mouseOutImage = new Array();

			function switchImage(img) {
				var outState = img.src;
				var splitter;
				var tmpArray;
	
				if (outState.indexOf(".gif") > -1) splitter = ".gif";
				else if (outState.indexOf(".jpg") > -1) splitter = ".jpg";
				else return;
				tmpArray = outState.split(splitter);
				var overState = tmpArray[0] + "_over" + splitter;
				mouseOutImage[overState] = outState;
				img.src = overState;
			}
			function restoreImage(img) {
				if (mouseOutImage[img.src]) img.src = mouseOutImage[img.src];
			} 
//Items for transparency and mouseovers in product pages
function alphaImage(strPath, intWidth, intHeight) {	
	if (isIE) {
document.write('<div style="height:'+intHeight+'px;width:'+intWidth+'px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'.png\', sizingMethod=\'scale\')" /></div>');
	} else {
		document.write('<img src="'+strPath+'.png" border="0"/>');
	}
}
function changeStyle(element,elementIMG){
document.getElementById(element).style.backgroundColor = '#ffffff';
document.getElementById(element).style.border = '1px #0033cc solid';
if(elementIMG != "1")
{
document.getElementById(elementIMG - 1).width = '.5';
document.getElementById(elementIMG - 1).height = '1';
}
document.getElementById(elementIMG).width = '.5';
document.getElementById(elementIMG).height = '1';
}
function clearStyle(element,elementIMG){
document.getElementById(element).style.backgroundColor = 'transparent';
if (isIE) {
document.getElementById(element).style.borderColor = 'tomato'; }
else {
document.getElementById(element).style.borderColor = 'transparent'; }
if(elementIMG != "1")
{
document.getElementById(elementIMG - 1).width = '483';
document.getElementById(elementIMG - 1).height = '1';
}
document.getElementById(elementIMG).width = '483';
document.getElementById(elementIMG).height = '1';
}
