// JavaScript Document
function buildImgArray(num){
	this.length = num;
	for (var i = 0; i < num; i++)	{
		this[i] = new Image();
	}
	return this;
}

function luxView(u,w,h) {
	winw = (screen.width < w) ? screen.width : w;
	winh = (screen.height < h) ? screen.height : h;
	xoff = (screen.width/2)-(winw/2);
	yoff = (screen.height/2)-(winh/2)-150;
	newWin="scrollbars=yes,menubar=no,resizable=yes,width="+winw+",height="+winh+",screenX="+xoff+",screenY="+yoff+",top="+yoff+",left="+xoff;
	myWin=window.open(u,"Luxology",newWin);
	myWin.resizeTo(winw,winh);
	myWin.focus();
	return false;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function view_window(url){
window.open(url, "window_name", "width=1280,height=738,scrollbars=yes,resizable=yes");
}

/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
	変数名など変更した箇所有り
	ロールオーバー画像のファイル名をfilename_over.[jpg,gif]拡張子とする
*/

//画像置き換え
function initRollovers() {
	if (!document.getElementById) return;
	var chimgLoad = new Array();
	var defSrc;
	var chImages = document.getElementsByTagName('img');

	for (var i = 0; i < chImages.length; i++) {
		if (chImages[i].className == 'imgover') {
			var src = chImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'),src.length);
			var hsrc = src.replace(ftype, '_over'+ftype);
			
			chImages[i].setAttribute('hsrc', hsrc);
			
			chimgLoad[i] = new Image();
			chimgLoad[i].src = hsrc;
			
			chImages[i].onmouseover = function() {
				defSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}
			
			chImages[i].onmouseout = function() {
				if (!defSrc) defSrc = this.getAttribute('src').replace('_over'+ftype,ftype);
				this.setAttribute('src',defSrc);
			}
		}
	}
}

window.onload = function () {
initRollovers();
}
