var _submitted = false;
//*******************************************
//===========================================
// Action ??
//===========================================
//????
function execSearchMap(path) {
	setInputValueById("event", "mapSearch");
	execAction( path );	
}

//????
function execSearchArea(path) {
	setInputValueById("event", "areaSearch");
	execAction( path );	
}

//????
function execSearchLine(path) {
	setInputValueById("event", "lineSearch");
	execAction(path);	
}

function execDetailRoomAction(bId, roomNum) {
	var url='buildId='+bId+"&roomNum="+roomNum;
	openNewWindow('roomDetail.do', url);
}

function execDetailBukkenAction(path, index) {
//	setInputValueById("buildId", document.all["build"+index].value);
	var url='buildId='+document.all["build"+index].value;
	//var url = 'buildId=GINGA_EAST1';
	openNewWindow(path, url);	
}

//function execDetailBukkenAction2(id, path) {
//	var url=path+'?buildId='+id;
//	var win = window.open(url, "", 
//	     "left=0,top=0,width=580,height=706,scrollbars=yes,menubar=no,status=no,resizable=yes");
//	win.focus();

//	openNewWindow(path, url);	
//}

function execViewAction(_id, _path) {
	var url='?buildId='+_id;
	document.forms[0].action = _path+url;
	document.forms[0].target = 'datalist';
	document.forms[0].submit();
	document.all.foilistData.style.display="none";
	document.all.sessionData.style.display="block";
}
//============================================
//********************************************

function openNewWindow(path) {

	var reff = document.URL;
	
	reff = reff.replace(/http:\/\//,"");
	reff = reff.replace(/\?.*$/,"");
	reStr=/\?/;
	//??????????????(?????)??
	if(reStr.test(path)){
		path+="&REFF="+reff;
	}
	var win = window.open(path, "", 
	     "left=0,top=0,width=590,height=706,scrollbars=yes,menubar=no,status=no,resizable=yes");
	win.focus();
}


function setInputValueById( id, value ) {
	// alert( "\"" + id + "\" will be set : " + value );
	var el = document.getElementById(id);
	el.value = value;
}

function execAction(path, formName){	
	
	
	if (typeof(formName) == "undefined" || formName == null || formName == "") {
		formName = 0;
	} 

	//eval( "validate" + frm.name + "();");

	var frm = document.forms[formName];
	
	if ( typeof(frm) == "undefined" || frm == null ) { alert("Null");}
	
	if (typeof(path) != "undefined" && path != null && path != "") {
		frm.action = path;
	}
	frm.target='foilist';
	frm.submit();
	document.all.foilistData.style.display="block";
	document.all.sessionData.style.display="none";
}