
var url;

function preload(){
	var pos = location.href.indexOf("news");
	url = location.href.substring(0, pos+5);

	var _aOn = new Array();
	var _aOff = new Array();
	_aOn[0] = new Image();
	_aOn[0].src =url + "images/btn_serach.gif";
	_aOff[0] = new Image();
	_aOff[0].src =url + "images/btn_serach_ov.gif";
}



//___________________________________________________________________[Roll Over]

function changeBtn( sSt1 , sSt2, tar){
	if( sSt2 == "on" ){
		tar.src = url + "images/" + sSt1 + "_ov.gif";
	}else {
		tar.src = url + "images/" + sSt1 + ".gif";
	}
}


function openCoordinateWin(wUrl){
	bCheck = CheckParWin();
	if(bCheck){
		window.opener.location.href = wUrl;
		window.opener.focus();
	}else{
		var wObj;
		wObj = window.open(wUrl,'coordinate');
		wObj.focus();
	}
}

function CheckParWin(){
	if ((navigator.userAgent.indexOf("Mac") > -1)){
		if (window.opener){
			bOpen = true;
		}else{
			bOpen = false;
		}
	}else{
		if (window.opener&&!window.opener.closed){
			bOpen = true;
		}else{
			bOpen = false;
		}
	}
	return bOpen;
}


//popup
//
var bFox = navigator.userAgent.indexOf("Firefox") != -1;
var bSafari = navigator.userAgent.indexOf("Safari") != -1;
var bOpera = navigator.userAgent.indexOf(" Opera") != -1;
var bIE = navigator.userAgent.indexOf("MSIE") != -1;
//var bNetscape = navigator.userAgent.indexOf("Netscape") != -1;

//スクロールなし。
function openNoScWin(wUrl, wWidth, wHeight){
	var wObj;
	var wName;
	scWidthCenter = screen.availWidth / 2;
	scHeightCenter = screen.availHeight / 2;
	wOption = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + wWidth + ",height=" + wHeight + ",left=" + (scWidthCenter - (wWidth / 2)) + ",top=" + (scHeightCenter - (wHeight / 2));
	wName = "sub" + wWidth + "_" + wHeight;
	wObj = window.open(wUrl,wName,wOption);
	wObj.focus();
}

//スクロールあり。
function openScWin(wUrl, wWidth, wHeight){
	var wObj;
	var wName;
	if(navigator.appVersion.indexOf("Mac") > -1){
		if(bIE && !bOpera){
			wWidth -= 1;
		} else if(bSafari){
			wWidth += 15;
			wHeight += 1;
		}else if(bFox){
			wWidth += 15;
		}else{
			wWidth += 15;
		}
	} else{
		if(bIE && !bOpera){
			wWidth += 16;
		} else if(bFox){
			wWidth += 16;
		}else{
			wWidth += 16;
		}
	}
	scWidthCenter = screen.availWidth / 2;
	scHeightCenter = screen.availHeight / 2;
	wOption = "width=" + wWidth + ",height=" + wHeight + ",left=" + (scWidthCenter - (wWidth / 2)) + ",top=" + (scHeightCenter - (wHeight / 2)) + ",scrollbars=yes";
	wName = "sub" + wWidth + "_" + wHeight;
	wObj = window.open(wUrl, wName, wOption);
	wObj.focus();
}


