var ary_img = new Array();
var path = ''

function set_path(str){
	
	path = str;
	
}


function preload(){

	for (i = 0; i < preload.arguments.length; i++) {

		ary_img[preload.arguments[i]] = new Image();
		ary_img[preload.arguments[i]].src = path+'/images/'+preload.arguments[i]+'.gif';	
		
		ary_img[preload.arguments[i]+'_over'] = new Image();
		ary_img[preload.arguments[i]+'_over'].src = path+'/images/'+preload.arguments[i]+'-over.gif';
		
		ary_img[preload.arguments[i]+'_down'] = new Image();
		ary_img[preload.arguments[i]+'_down'].src = path+'/images/'+preload.arguments[i]+'-down.gif';
		
	}
}


function mOut(id, name){
	
	document.getElementById(id).src = ary_img[name].src;

}


function mOver(id, name){
	
	document.getElementById(id).src = ary_img[name+'_over'].src;

}


function mUp(id, name){
	
	document.getElementById(id).src = ary_img[name+'_over'].src;

}


function mDown(id, name){
	
	document.getElementById(id).src = ary_img[name+'_down'].src;

}


function open_img(url, wk){
	
	if ((screen.width - 80) < 1380){
		bw = screen.width - 80;
	}
	else{
		bw = 1300;
	}
	if ((screen.height - 80) < 1380){
		bh = screen.height - 80;
	}
	else{
		bh = 1300;
	}

	window1 = window.open(url+'/img.asp?wk='+wk,'img','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + bw + ',height=' + bh);
	
	window1.focus();

	window1.moveTo(20, 20);
}

/*Windowのサイズ取得*/
function winWidth() {
    if(window.innerWidth)
        return window.innerWidth;
    if(document.compatMode == "CSS1Compat")
        return document.body.parentNode.clientWidth;
    if(document.body.clientWidth)
        return document.body.clientWidth;
    return 600;
}
function winHeight() {
    if(window.innerHeight)
        return window.innerHeight;
    if(document.compatMode == "CSS1Compat")
        return document.body.parentNode.clientHeight;
    if(document.body.clientHeight)
        return document.body.clientHeight;
    return 400;
}

function scroll_x() {
    if(window.pageXOffset)
        return window.pageXOffset;
    if(document.compatMode == "CSS1Compat")
        return document.body.parentNode.scrollLeft;
    if(document.body.scrollLeft)
        return document.body.scrollLeft;
    return 0;
}

function scroll_y() {
    if(window.pageYOffset)
        return window.pageYOffset;
    if(document.compatMode == "CSS1Compat")
        return document.body.parentNode.scrollTop;
    if(document.body.scrollTop)
        return document.body.scrollTop;
    return 0;
}

//scroll
function scrollkeep(x,y){
	if(x!=0 || y!=0)
		window.scrollTo(x,y);

}

function scrollset(){

	document.f.scrollx.value=scroll_x();
	document.f.scrolly.value=scroll_y();
}



/* 初期設定値と新しい設定値を比較して、異なれば色をつける。 */
function obj_color(obj){
	
	if(obj.defaultValue == obj.value){
		
		obj.style.backgroundColor = '#fff';
		obj.style.color = '#666';
		
	}
	else{
		
		obj.style.backgroundColor = '#d70';
		obj.style.color = '#fff';
	
	}
}


/*チェックボックスがチェックされていれば色をつける*/
function obj_color_change(obj_checkbox, obj){
	
	if(obj_checkbox.checked){
		
		obj.style.backgroundColor = '#d70';
		obj.style.color='#fff';
	
	}
	else{
		
		obj.style.backgroundColor = '#fff';
		obj.style.color='#666';
		
	}
}

/* チェックボックスのチェック状態を既定のチェック状態と比較して、異なれば色をつける。 */
function obj_color_checkbox(obj_checkbox, obj){
	
	if(obj_checkbox.defaultChecked == obj_checkbox.checked){
		
		obj.style.backgroundColor = '#fff';
		obj.style.color = '#666';
		
	}
	else{
		
		obj.style.backgroundColor = '#d70';
		obj.style.color = '#fff';
	
	}
}


function popup_msg(id){
	url='msg.asp?id='+id;
	window_msg=window.open(url,'window_msg','width=350,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	window_msg.focus();
	window_msg.moveTo(0,20);
}



function c_all_au(){
	
	f=false;
	
	if(document.f.ch.selectedIndex!=0){
		document.f.ch.selectedIndex=0;
		f=true;
	}

	if(document.f.wc.selectedIndex!=0){
		document.f.wc.selectedIndex=0;
		f=true;
	}
	
	
	if(document.f.wtp.selectedIndex!=0){
		document.f.wtp.selectedIndex=0;
		f=true;
	}
	
	if(f==true){
		document.f.submit();
	}

	//return false;

}
	