var Win=(navigator.userAgent.indexOf("Win",0) >= 0);
var Mac=(navigator.userAgent.indexOf("Mac",0) >= 0);
var ver = navigator.appVersion.charAt(0);
var nam = navigator.appName.charAt(0);
var MacIE = (Mac && navigator.appName.indexOf("Explorer",0) >= 0);
var WinIE = (Win && navigator.appName.indexOf("Explorer",0) >= 0);
var WinIEx = (Win && navigator.appName.indexOf("Explorer",0) >= 0 && document.compatMode == "CSS1Compat");
var Gecko = (navigator.userAgent.indexOf("Gecko") != -1) ? 1 :0;
var Moz = ((navigator.userAgent.indexOf("Gecko") != -1) && (navigator.userAgent.indexOf("Safari",0) == -1)) ? 1 :0;
var WinNN4 = (Win && ver == 4 && navigator.appName.indexOf("Netscape",0) >= 0);
var WinNN6 = (Win && navigator.userAgent.indexOf("Netscape6/") != -1);
var WinNN7 = (Win && navigator.userAgent.indexOf("Netscape/7") != -1);
var MacNN4 = (Mac && ver == 4 && navigator.appName.indexOf("Netscape",0) >= 0);
var MacNN6 = (Mac && navigator.userAgent.indexOf("Netscape6/") != -1);
var MacNN7 = (Mac && navigator.userAgent.indexOf("Netscape/7") != -1);
var Opera = (navigator.userAgent.indexOf ("Opera") != -1);
var Safari = (navigator.userAgent.indexOf ("Safari") != -1);


/* -----------------------------------------------------
// Window Resize
----------------------------------------------------- */
if(!window.setWidth) {
	if(WinNN4 || MacNN4){
		window.onresize = resized;
		window.setWidth = window.innerWidth;
		window.setHeight = window.innerHeight;
	}
}
function resized() {
		if (setWidth < window.innerWidth || setWidth > window.innerWidth || setHeight > window.innerHeight || setHeight < window.innerHeight ) {
		window.location.reload();
	}
}



/* -----------------------------------------------------
// SearchQuery
----------------------------------------------------- */
function SearchQuery() {
	var Input = document.getElementById('search_ipt');
	if ( Input.value == '') { alert("検索内容を入力してください"); }
	else{	
		document.f1.submit();
	}
}



var newWin;
/* -----------------------------------------------------
// pWin
----------------------------------------------------- */
function pWin (wUrl,wName,wProp) {
	newWin = window.open (wUrl,wName,wProp);
	newWin.focus();
}


/* -----------------------------------------------------
// pWinTv
----------------------------------------------------- */
function pWinTv (wUrl,wName,wScl,wRsz,wWdt,wHgt) {
	newWin = window.open (wUrl,wName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + wScl + ',resizable=' + wRsz + ',width=' + wWdt + ',height=' + wHgt);
	newWin.focus();
}


/* -----------------------------------------------------
// pWinGen
----------------------------------------------------- */
function pWinGen (wUrl,wName,wScl,wRsz,wWdt,wHgt) {
	newWin = window.open (wUrl,wName,'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=' + wScl + ',resizable=' + wRsz + ',width=' + wWdt + ',height=' + wHgt);
	newWin.focus();
}


/* -----------------------------------------------------
// pWinLg90
----------------------------------------------------- */

function pWinLg90(wUrl) {
	var options="";
	options="toolbar=0,location=0,status=0,menubar=0,scrollbars=0, width="+screen.width+", height="+screen.height;
	lsg90=window.open(wUrl,"lossguard90",options);
	lsg90.moveTo(0, 0);
}


/* -----------------------------------------------------
// icube_open
----------------------------------------------------- */
function icube_open(wUrl) {
	var options="";
	options="toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1, width="+screen.width+", height="+screen.height;
	icube=window.open(wUrl,"icube",options);
	icube.moveTo(0, 0);
}


/* -----------------------------------------------------
// OpenWindowYume
----------------------------------------------------- */
function OpenWindowYume(file) {
	var w_size = 960;
	var h_size = 720;
	var l_position=Number((window.screen.width-w_size)/2);
	var t_position=Number((window.screen.height-h_size)/2);
	var options="";
	options = "toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=no,width="+w_size+",height="+h_size+",left="+l_position+",top="+t_position;

	window.open(file,"yume",options);
}


/* -----------------------------------------------------
// lossguard90_open
----------------------------------------------------- */
function lossguard90_open(url) {
	var options="";
	options="toolbar=0,location=0,status=0,menubar=0,scrollbars=0, width="+screen.width+", height="+screen.height;
	lsg90=window.open(url,"lossguard90",options);
	lsg90.moveTo(0, 0);
}


// naming parent window
/* -----------------------------------------------------
// nWin01
----------------------------------------------------- */
function nWin01(){
	window.name = "win_master01";
}


/* -----------------------------------------------------
// nWin02
----------------------------------------------------- */
function nWin02(){
	window.name = "win_topic02";
}


/* -----------------------------------------------------
// yumehatsuden_open
----------------------------------------------------- */
function yumehatsuden_open(url) {
	var options="";
  options="toolbar=0,location=0,status=0,menubar=0,scrollbars=0, width=760, height=510";
  yhd=window.open(url,"yumehatsuden_top",options);
  yhd.moveTo(0, 0);
}
