/* ------------------------------
 conf
------------------------------ */
// load files
var LDJSF = [
	{'src': 'prototype.js', 'charset': 'UTF-8'},
	{'src': 'rollover.js', 'charset': 'UTF-8'},
	{'src': 'linkarea.js', 'charset': 'UTF-8'},
	{'src': 'smoothScroll.js', 'charset': 'UTF-8'},
	{'src': 'heightLine.js', 'charset': 'UTF-8'}
];


/* ------------------------------
 not modify here.
------------------------------ */
var scTag = document.getElementsByTagName('script');
var jsDir = '';
var len = scTag.length;
for(var i = 0; i < len; i++){
	var s = scTag[i];
	if(s.src && s.src.indexOf('common.js') != -1){
		jsDir = s.src.substring(0,s.src.indexOf('common.js'));
	}
}

len = LDJSF.length;
for(var i = 0; i < len; i++){
	document.write('<script type="text/javascript" src="' + jsDir + LDJSF[i].src + '" charset="' + LDJSF[i].charset + '"></script>');
}

function openWindow(URL,Winname,intW,intH){
	if(navigator.appVersion.indexOf("Windows") > -1) intW = parseInt(intW) + 16;
	newwin = window.open(URL,Winname,"width=" + intW + ",height=" + intH + ",scrollbars=yes,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=yes");
	newwin.focus();
}

function getCookie(name){
	var start = document.cookie.indexOf(name + "=");
	var len = start + name.length + 1;
	if((!start) && (name != document.cookie.substring(0, name.length))){
		return null;
	}
	if(start == -1){
		return null;
	}
	var end = document.cookie.indexOf(';', len);
	if(end == -1){
		end = document.cookie.length;
	}
	return unescape(document.cookie.substring(len, end));
}

function setCookie(name, value, expires, path, domain, secure){
	var today = new Date();
	today.setTime(today.getTime());
	if(expires){
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date(today.getTime() + (expires));
	document.cookie = name + '=' + escape(value) +
		((expires)? ';expires=' + expires_date.toGMTString() : '') + 
		((path)? ';path=' + path : '') +
		((domain)? ';domain=' + domain : '') +
		((secure)? ';secure' : '');
}

function deleteCookie(name, path, domain){
	if(getCookie(name)){
		document.cookie = name + '=' +
			((path)? ';path=' + path : '') +
			((domain )? ';domain=' + domain : '') +
			';expires=Thu, 01-Jan-1970 00:00:01 GMT';
	}
}



/* ------------------------------
 popup window
------------------------------ */

window.onload=autoPOP;

function autoPOP()
{
	var x = document.getElementsByTagName('a');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].getAttribute('className') == 'popup' || x[i].getAttribute('class') == 'popup')
		{
			x[i].onclick = function () {
			return winOpen(this.href)
			}
			x[i].title += '(Popup)';
		}
	}
};

function winOpen(url) {
	window.open(
		url,
		'popup',
		'width=700,height=700,scrollbars=1,resizable=1'
	);

	return false;
};



/* ------------------------------
 window close
------------------------------ */

function close_win(){
  var nvua = navigator.userAgent;
    if(nvua.indexOf('MSIE') >= 0){
      if(nvua.indexOf('MSIE 5.0') == -1) {
        top.opener = '';
      }
    }
    else if(nvua.indexOf('Gecko') >= 0){
      top.name = 'CLOSE_WINDOW';
      wid = window.open('','CLOSE_WINDOW');
    }
    top.close();
}



function shopentryWin(){
	mwin = window.open("shopentry.php","shopentryWin","width=800,height=800,menubar=yes,scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no");	shopentryWin.focus();
}



/* ------------------------------
 ZEBRA EFECT
------------------------------ */
//-------------値設定---------------
 
var classN = "zebra";    //クラス名を指定
var addClass1 = "even";    //奇数タグのクラス名を指定
var addClass2 = "odd ";    //偶数タグのクラス名を指定
 
//---------------------------------
 
function ulZebra() {
    if (!document.getElementsByTagName) return false;
 
    var zebraTables = document.getElementsByTagName("table");
    
    for (var i=0; i < zebraTables.length; i++) {
        if (zebraTables[i].className.match(classN)) {
 
            var zebraRows = zebraTables[i].getElementsByTagName("tr");
            
            for (var k=0; k < zebraRows.length; k++) {
                if (k%2) {
                    zebraRows[k].className = addClass2;
                } else {
                    zebraRows[k].className = addClass1;
                }
            }
        }
    }
}
 
try{
	window.addEventListener("load",ulZebra,false);
}catch(e){
	window.attachEvent("onload",ulZebra);
}



/* ------------------------------
 print for Firefox
------------------------------ */

var firefox = (navigator.userAgent.indexOf("Firefox") != -1)? true : false;
if(firefox) document.write('<link rel="stylesheet" type="text/css" media="print" href="/common/css/print_fx.css" />');


try {
  document.execCommand('ImageCache', false, true);
} catch(e) {}







