// ランダムに画像を表示する
//function randomImage(){
//ranimg = new Array();
//ranimg[0] = "/common/images/left_image01.jpg";
//ranimg[1] = "/common/images/left_image02.jpg";
//chip = Math.floor(ranimg.length * Math.random());
//ranimg = ranimg[Math.floor(chip)];
//document.write('<img src="'+ ranimg +'" alt="ピュアミネラル パウダー ファンデーション" width="179" height="820" title="ピュアミネラル パウダー ファンデーション" />');
//}


// ロールオーバー
function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'rollover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_on'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = function(){
	initRollovers();
}


// ポップアップウィンドウ
function openLinkPopup(wUrl){
	var wObj;
	wWidth = 650;
	wHeight = 600;
	scWidthCenter = screen.availWidth / 2;
	scHeightCenter = screen.availHeight / 2;
	wOption =
	"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="
	+ wWidth + ",height=" + wHeight + ",left=" + (scWidthCenter - (wWidth /
	2)) + ",top=" + (scHeightCenter - (wHeight / 2));
	wObj = window.open(wUrl,'link',wOption);
	wObj.focus();
}

function imgwin(src,t,w,h){
	var w=window.open("",t,"width="+w+",height="+h)
		with(w.document){
		open()
		writeln("<html>")
		writeln("<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>")
		writeln("<a href='' onclick=window.close()><img src='"+src+"' border=0></a>")
		writeln("</body></html>")
		close()
	}
}
 
