var win0 = null;
var win1 = null;
var win2 = null;
var numWin = 3;

//フォームからのリンク
function openLocation(url) {
	location.href=url;
}

//新規ウィンドウオープン
function openBrWindow(url,winName,features) {
			clearWin();
	win1=window.open(url,winName,features);
}
//新規ウィンドウオープンした後、親ページリンク
function openerWin (url){
window.opener.location.href=url;
window.close();
}
//ダイアログ-ノーマルタイプ
function popupMsg(msg,url) {
	alert(msg);
	location.href=url;
}

//ダイアログ-判別タイプ
function popupMsgYN(msg,url) {
        if (confirm(msg))location.href=url;
}

//ダイアログ-判別タイプ*2
function popupMsgYNYN(msg,msg2,url) {
        if (confirm(msg)){
		if (confirm(msg2))location.href=url;
		}
}
//ダイアログ-判別タイプ+CHK
function popupMsgYN_CHK(msg,msg2,url) {
	num =  document.forms[0].length;
	var jpn="off";
	flag = (confirm(msg));
	if (flag == true){
		for (i=0 ;i<num ;i++){
			vi = i;
			iV = document.forms[0].elements[i].name;
			if (iV.indexOf("CHK",0) != -1){
				if (document.forms[0].elements[i].checked){
					jpn="on";
				}
			}
		}
		if (jpn=="on"){
			if (confirm(msg2)){location.href=url}
		}else{location.href=url;}
	}
}
//ダイアログ-判別タイプ+CHK+エレメント指定
function popupMsgYN_CHK_TGT(msg,msg2,url,frm,elm) {
	var jpn="off";
	flag = (confirm(msg));
	if (flag == true){
		if (document.forms[frm].elements[elm].checked){
			jpn="on";
		}
		if (jpn=="on"){
			if (confirm(msg2)){location.href=url}
		}else{location.href=url;}
	}
}

function listChange(url){
	window.location=url.options[url.selectedIndex].value;
	url.options[url.selectedIndex].selected=false;
	return;
}

function windowopen2(url,name){
			clearWin();
		win2=window.open(url,name,"height=600,width=600,menubar=no,location=no,directories=no,toolbar=no,scrollbars=yes,status=no,resizable=yes");
	}

function clearWin(){
	for(i=0;i<numWin;i++){
		if((eval('win'+i) != null)){
			if(eval('win'+i+'.closed') == false){
				eval('win'+i+'.close()')
				eval('win'+i+' = null');
			}
		}
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function changeImage(imageName,imageSrc){
	if(document.all){document.all[imageName].src=imageSrc;}
	if(document.layers){document.images[imageName].src=imageSrc;}
	if(document.getElementById){document.images[imageName].src=imageSrc;}
}

if ((navigator.appVersion.indexOf("Mac") != -1)) {
		document.write('<link rel=stylesheet href="../lib/style_mac.css" type="text/css">'); }
	else {
		document.write('<link rel=stylesheet href="../lib/style.css" type="text/css">'); }

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		btn_01_over = newImage("images/indexm_closeup_2901_on.gif");
		btn_02_over = newImage("images/indexm_closeup_2801_on.gif");
		preloadFlag = true;
		preloadFlag = true;
	}
}

