/*
 * This file is part of EC-CUBE
 *
 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
 *
 * http://www.lockon.co.jp/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
	var preLoadFlag = "false";

	function preLoadImg(URL){

		arrImgList = new Array (
			URL+"img/header/basis_on.jpg",URL+"img/header/product_on.jpg",URL+"img/header/customer_on.jpg",URL+"img/header/order_on.jpg",
			URL+"img/header/sales_on.jpg",URL+"img/header/mail_on.jpg",URL+"img/header/contents_on.jpg",
			URL+"img/header/mainpage_on.gif",URL+"img/header/sitecheck_on.gif",URL+"img/header/logout.gif",
			URL+"img/contents/btn_search_on.jpg",URL+"img/contents/btn_regist_on.jpg",
			URL+"img/contents/btn_csv_on.jpg",URL+"img/contents/arrow_left.jpg",URL+"img/contents/arrow_right.jpg"
		);
		arrPreLoad = new Array();
		for (i in arrImgList) {
			arrPreLoad[i] = new Image();
			arrPreLoad[i].src = arrImgList[i];
		}
		preLoadFlag = "true";
	}

	function chgImg(fileName,imgName){
		if (preLoadFlag == "true") {
			document.images[imgName].src = fileName;
		}
	}
	
	function chgImgImageSubmit(fileName,imgObj){
	imgObj.src = fileName;
	}
	
	// サブナビの表示切替
	function naviStyleChange(ids, bcColor, color){
		document.getElementById(ids).style.backgroundColor = bcColor;
	}	
	
	function fnCheckBoxClick(object_id){
		if(document.getElementById(object_id).checked){
			document.getElementById(object_id).value = 1;
		}else{
			document.getElementById(object_id).value = 0;	
		}
	}
	
	function disableEnterKey(e)
	{
		 var key;     
		 if(window.event)
			  key = window.event.keyCode; //IE
		 else
			  key = e.which; //firefox     
	
		 return (key != 13);
	}

	function radio1_click()
	{
		document.getElementById("joint_name").value = "";
		document.getElementById("joint_name").disabled = true;
		
		document.getElementById("bridegroom_name").disabled = false;
		document.getElementById("bride_name").disabled = false;
		
		document.getElementById("bridegroom_name").focus();
	}
	function radio2_click()
	{
		document.getElementById("bridegroom_name").value = "";
		document.getElementById("bride_name").value = "";

		document.getElementById("bridegroom_name").disabled = true;
		document.getElementById("bride_name").disabled = true;

		document.getElementById("joint_name").disabled = false;
		document.getElementById("joint_name").focus();
		
	}
	
	function fnSetParam(order_id, cnt_order){
		document.form1.order_id.value = order_id;
		document.form1.cnt_order.value = cnt_order;
	}
	
	function fnChangeStateControl(controlName, state, clearValue){
		var objControll = document.getElementById(controlName);
		objControll.disabled = !state;
		if(clearValue){
			objControll.value = "";
		}
		
	}
	
	function fnShowPopUp(url,Top,Left,Height,Width,showToolbar,showMenuBar,showScrollBar,Resizable)
	{
			var strToolBar;
			var strMenuBar;
			var strScrollBar;
			var strResizable;
			if(showToolbar)
				strToolBar = 'toolbar=yes';
			else
				strToolBar = 'toolbar=no';
			if(showMenuBar)
				strMenuBar = 'menubar=yes';
			else
				strMenuBar = 'menubar=no';
			if(showScrollBar)
				strScrollBar = 'scrollbars=yes';
			else
				strScrollBar = 'scrollbars=no';
			if(Resizable)
				strResizable = 'resizable=yes';
			else
				strResizable = 'resizable=no';
			return window.open (url, "", config="top="+ Top +", left=" + Left + ", height=" + Height +
				", width="+ Width +", " + strToolBar + ", "+ strMenuBar +", "+ strScrollBar +", "+ strResizable +
				", location=no, directories=no, status=no");
	}
	
