function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

function cartPop(){
	cartWin = window.open("http://www.monoglobe.jp/cart_b/neocart.php","CartWindow","width=772,height=560,resizable=1,scrollbars=1");
	cartWin.focus();
	return false;
}
function popUpimgA(href){
	var o = location.hostname;
	var imgObj = new Image();
	imgObj.src = decodeURIComponent(href);
	var wo = '';
/*
	wo += 'width=200,'
	wo += 'height=300,'
	wo += 'directories=0,';
	wo += 'location=0,';
	wo += 'menubar=0,';
	wo += 'resizable=0,';
	wo += 'scrollbars=0,';
	wo += 'status=0,';
	wo += 'toolbar=0,';
*/
	//window.open('','newWin',wo);


	var openWin = function(a,b){
		w = Number(a)+60;
		h = Number(b)+128;

		var wo = '';
		wo += 'width='+a+','
		wo += 'height='+b+','
		wo += 'directories=0,';
		wo += 'location=0,';
		wo += 'menubar=0,';
		wo += 'resizable=0,';
		wo += 'scrollbars=0,';
		wo += 'status=0,';
		wo += 'toolbar=0,';

		var pUrl = 'http://www.monoglobe.jp/popup.php?img='+encodeURI(href)+'&w='+w+'&h='+h;

		window.open(pUrl,'newWin',wo);
	};

	var loadingComplete = function(){

		if(imgObj.complete){
			var a = imgObj.width;
			var b = imgObj.height;
			openWin(a,b);
		}else{
			setTimeout(loadingComplete,100);
		}
	};

	loadingComplete();

}


