﻿/*
 * 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;
	}	



var kyori=null;
var myspeed = 4; 
function SMscroll() { 
   if ((navigator.appName.indexOf("Internet Explorer",0) != -1) && kyori ==null) {
     kyori =  document.body.scrollHeight;
   } else if (window.innerHeight&& kyori ==null) {
     kyori= window.innerHeight;
   }
 var idoukyori = kyori/myspeed;
 var titen = kyori-idoukyori;
 window.scrollTo(0,titen);
 if (titen > 1) {
   var Timer1 = setTimeout("SMscroll()",15);
   kyori = titen; 
 } else {
   kyori=null;
   window.scrollTo(0,0);
 }
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}



function flashwrite() {

htm = ""
htm+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'"
htm+="        codebase='http://download.macromedia.com/pub/shockwave/"
                  htm+="cabs/flash/swflash.cab'"
htm+="        width   = 200 " 
htm+="        height  = 160 >"
htm+="<param  name    = movie value='swf/top/topitem.swf'>"
htm+="<param  name    = quality value=high>"
htm+="<embed  src     = 'swf/top/topitem.swf'"
htm+="        quality = high  "
htm+="        width   = 200"
htm+="        height  = 160"
htm+="        type    = 'application/x-shockwave-flash' "
htm+="        pluginspage='http://www.macromedia.com/go/getflashplayer'>"
htm+="</embed>"
htm+="</object>"

document.write(htm)

}


function panelflash(no) {


swfname="panel"+no+".swf";

paramname="<param  name    = movie value='swf/" +swfname+ "'>";
embedsrc="<embed  src     = 'swf/"+swfname+"' "

htm = ""
htm+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'"
htm+="        codebase='http://download.macromedia.com/pub/shockwave/"
                  htm+="cabs/flash/swflash.cab'"
htm+="        width   = 77 " 
htm+="        height  = 77 >"
htm+=paramname
htm+="<param  name    = quality value=high>"
htm+=embedsrc
htm+="        quality = high  "
htm+="        width   = 77"
htm+="        height  = 77"
htm+="        type    = 'application/x-shockwave-flash' "
htm+="        pluginspage='http://www.macromedia.com/go/getflashplayer'>"
htm+="</embed>"
htm+="</object>"

document.write(htm)

}

function getDate(){
	var date = new Date();
	var year = date.getYear();
	var year4 = (year < 2000) ? year+1900 : year;
	var month = date.getMonth() + 1;
	var date = date.getDate();
	if (month < 10) {
		month = "0" + month;
	}
	if (date < 10) {
		date = "0" + date;
	}
	var strDate = year4 + "/" + month + "/" + date;
	return strDate;
}

