var conf = "width=600,height=400,scrollbars=yes,resizable=yes"
function SuryoCheck(form){
	var s = form.Suryo.value 
	if(!s){ return false }
	for(i=0;i<s.length;i++){
		c = s.charAt(i);
		if("0123456789".indexOf(c,0) < 0){
			form.Suryo.value=""
			return false
		}
	}
	carton = window.open("",'carton', conf)
	carton.focus()
	return true
}

function CatonSubmitCheck(form,mode){
	var conf = "width=600,height=400,scrollbars=yes,resizable=yes"
	var s = form.Suryo.value 
	if(!s){ return false }
	if( isNaN(s) || s < 1 ){
		form.Suryo.value="1"
		alert('数字を入力してください。')
		return false
	}
	if( mode == 1 ){
		carton = window.open("",'carton', conf)
		carton.focus()
	}
	return true
}
var timerId = new Array();
function deleyHideMenu(id, id2){
	timerId[id2] = setTimeout("HideMenu('"+id+"','"+id2+"')", 200);
}
function HideMenu(id,id2){
	e = document.getElementById(id);
	e.style.display = 'none';
	clearTimeout(timerId[id2]);
}
function OpenNoWin(url, x, y ){
	if( !url ) return false;
	if(url.match(/index\.php\?/))
		url += "&winmode=nowin";
	if( !x ) x = 600;
	if( !y ) y = 480;
	wx = screen.width;
	wy = screen.height - 50;
	dx  = ( wx - x ) / 2;
	dy   = ( wy - y ) / 2;
	winname = "EditWin";
	option  = "top=" + dy;
	option += ",left=" + dx;
	option += ",width=" + x;
	option += ",height=" + y;
	option += ",scrollbars=yes,status=yes,resizable=yes";
	w = window.open(url,winname,option);
	w.focus()
}
function OpenSubWin(url, x, y ){
	if( !url ) return false;
	url += "&winmode=nowin";
	if( !x ) x = 600;
	if( !y ) y = 480;
	wx = screen.width;
	wy = screen.height - 50;
	dx  = ( wx - x ) / 2;
	dy   = ( wy - y ) / 2;
	winname = "SubWin";
	option  = "top=" + dy;
	option += ",left=" + dx;
	option += ",width=" + x;
	option += ",height=" + y;
	option += ",scrollbars=yes,status=yes,resizable=yes";
	w = window.open(url,winname,option);
	w.focus()
}
// セッション保存クッキーがあればindex.phpへ遷移
if( !!root_url ){
	a = location.href.split("/");
	b = root_url.split("/");
	na = a[2];
	nb = b[2];
	if( na != nb ){ location.href=root_url; }
	
	if( location.href == root_url ){
		if( document.cookie ){
			thePid   = "";
			theName   = "pid=";
			theCookie = document.cookie+";";
			start = theCookie.indexOf(theName);
			if (start != -1)
			{
				end = theCookie.indexOf(";",start);
				thePid = unescape(theCookie.substring(start+theName.length,end));
			}
			theId   = "";
			theName   = "admin_id=";
			theCookie = document.cookie+";";
			start = theCookie.indexOf(theName);
			if (start != -1)
			{
				end = theCookie.indexOf(";",start);
				theId = unescape(theCookie.substring(start+theName.length,end));
			}
			if( theId ){
				location.replace("./index.php");
			}
		}
	}
}
//ajax
document.write('<scr'+'ipt type="text/javascript" src="'+root_url+'js/jslb_ajax050_c.js"></scr'+'ipt>');

document.write('<scr'+'ipt type="text/javascript" src="'+root_url+'js/backoffice_jump.php"></scr'+'ipt>');