function changeReserveForm(flag){
    var returnMonth=document.getElementById("returnMonth");
    var returnDay=document.getElementById("returnDay");
    var returnTitle=document.getElementById("returnTitle");
    var returnCalendar=document.getElementById("returnCalendar");
    var search_btn2=document.getElementById("search_btn2");
    //var searchBtn=document.getElementById("search_btn");
    var onewayTab=document.getElementById("onewayTab");
    var roundTab=document.getElementById("roundTab");
   
    if(flag){
       returnMonth.style.visibility="visible";
       returnDay.style.visibility="visible";
       returnTitle.style.visibility="visible";
       returnCalendar.style.visibility="visible";
//       search_btn2.style.visibility="visible";
//       searchBtn.style.visibility="hidden";
       onewayTab.onmouseout = function()
       {
           onewayTab.setAttribute("src", onewayTab.getAttribute("src").replace("_on.", "_off."));
       }
       onewayTab.onmouseover = function()
       {
           onewayTab.setAttribute("src", onewayTab.getAttribute("src").replace("_off.", "_on."));
       }
       onewayTab.setAttribute("src", onewayTab.getAttribute("src").replace("_on.", "_off."));
       roundTab.onmouseout="";

       document.getElementById("toAndFromCondition").value = "2";

    }else{
       returnMonth.style.visibility="hidden";
       returnDay.style.visibility="hidden";
       returnTitle.style.visibility="hidden";
       returnCalendar.style.visibility="hidden";
//       search_btn2.style.visibility="hidden";
//       searchBtn.style.visibility="visible";
       
       onewayTab.onmouseout="";
       roundTab.onmouseout = function()
       {
           roundTab.setAttribute("src", roundTab.getAttribute("src").replace("_on.", "_off."));
       }
       roundTab.setAttribute("src", roundTab.getAttribute("src").replace("_on.", "_off."));

       document.getElementById("toAndFromCondition").value = "1";
    }
}


function changeReserveFormAg(flag){
    var returnMonth=document.getElementById("returnMonth");
    var returnDay=document.getElementById("returnDay");
//    var searchBtn=document.getElementById("search_btn");
    var onewayTab=document.getElementById("onewayTab");
    var roundTab=document.getElementById("roundTab");
    
    if(flag){
    	if(navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1){
	        returnMonth.style.display="table-row";
	        returnDay.style.display="table-row";
    	}else{
	        returnMonth.style.display="block";
	        returnDay.style.display="block";
    	}
		returnMonth.style.visibility="visible";
		returnDay.style.visibility="visible";
//		searchBtn.style.display="none";
       
        onewayTab.onmouseout = function()
        {
            onewayTab.setAttribute("src", onewayTab.getAttribute("src").replace("_on.", "_off."));
        }
        onewayTab.onmouseover = function()
        {
            onewayTab.setAttribute("src", onewayTab.getAttribute("src").replace("_off.", "_on."));
        }
        onewayTab.setAttribute("src", onewayTab.getAttribute("src").replace("_on.", "_off."));
        roundTab.onmouseout="";

        document.getElementById("toAndFromCondition").value = "2";
       
    }else{
//        returnMonth.style.display="none";
//        returnDay.style.display="none";
       returnMonth.style.visibility="hidden";
       returnDay.style.visibility="hidden";
//        searchBtn.style.display="inline";
//        searchBtn.style.visibility="visible";
       
        onewayTab.onmouseout="";
        roundTab.onmouseout = function()
        {
            roundTab.setAttribute("src", roundTab.getAttribute("src").replace("_on.", "_off."));
        }
        roundTab.setAttribute("src", roundTab.getAttribute("src").replace("_on.", "_off."));

        document.getElementById("toAndFromCondition").value = "1";
    }
}

	/**
	 * EnterKey無効化
	 */
	function doClick(e) {    
		var key;
		if (window.event) {
			key = window.event.keyCode; // IE
		} else {
			key = e.which;              // Firefox
		}

		if (key == 13) {
			return false;
		}
	}


	/**
	 * フォーカス設定
	 */
var initFocus = [];

	function setFocus() {
		if (initFocus[0] == null) { 
			if (document.getElementById("initialFocus") != null) { 
				document.getElementById("initialFocus").focus(this);
			}
		} else {
			if (document.getElementsByName(initFocus[0]) != null) {
				if (initFocus[1] == null) {
					document.getElementsByName(initFocus[0]).item(0).focus(this);
				} else {
					document.getElementsByName(initFocus[0]).item(initFocus[1]).focus(this);
				}
			}
		} 
	} 

////////////////////////////////////////////////////////////////////////////////////////////////////
///	addEventListener
////////////////////////////////////////////////////////////////////////////////////////////////////
if(window.addEventListener) {
	window.addEventListener("load", setFocus, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", setFocus);
}

