function ntjBanner(image,url){
	this.m_image = new Image();
	this.m_image.src = image;
	this.m_url = url;
	this.src = this.m_image.src;
}
ntjBanner.prototype.set=function(img){
	img.src=this.m_image.src;
	var url = this.m_url;
	if(url!=""){
		if(navigator.appVersion.indexOf("MSIE")!=-1){
			img.onmouseover=function(){img.style.cursor = "hand";};
			img.onmouseout=function(){img.style.cursor = "default";};
		}else{
			img.onmouseover=function(){img.style.cursor = "pointer";};
			img.onmouseout=function(){img.style.cursor = "default";};
		}
		img.onclick=function(){window.open(url,'','')};
	}
};
/*
// 全体設定
//
*/

//var header_banner = new ntjBanner("http://www.navitime.co.jp/pcstorage/img/banner_enq.jpg","https://pr.navitime.co.jp/enquete/");
//var header_banner_top = new ntjBanner("http://www.navitime.co.jp/pcstorage/img/banner_quiz.jpg","http://pr.navitime.co.jp/");

// for Default
//var header_banner = new ntjBanner("http://www.navitime.co.jp/pcstorage/img/null.gif","");
//var header_banner_top = new ntjBanner("http://www.navitime.co.jp/pcstorage/img/null.gif","");

//var header_banner = new ntjBanner("http://www.navitime.co.jp/pcstorage/img/banner_wcup.gif","http://www.navitime.co.jp/pcstorage/html/wcup/");
//var header_banner_top = new ntjBanner("http://www.navitime.co.jp/pcstorage/img/banner_wcup.gif","http://www.navitime.co.jp/pcstorage/html/wcup/");

function setPath(p){ path = p;}

function getCopyright(){
	document.write('&copy; ');
	var now = new Date()
	document.write(now.getFullYear());
	document.write(' NAVITIME JAPAN. All Rights Reserved.');
}

function setLoadImages(){
	MM_preloadImages(
				"img/icon_address.gif"
				,"img/icon_address_act.gif"
				,"img/icon_station.gif"
				,"img/icon_station_act.gif"
				,"img/icon_post.gif"
				,"img/icon_post_act.gif"
				,"img/icon_tel.gif"
				,"img/icon_tel_act.gif"
				,"img/icon_spot.gif"
				,"img/icon_spot_act.gif");
}

function openWindow(url,x,y,scrollbar){
	scrollbar = scrollbar == null ? "" : ",scrollbars=yes";
	window.open(url,"","width="+x+",height="+y+",statusbars=yes"+scrollbar);
}

function selectPullDown()
{
	var LCode = document.pullDown.categoryList.value;
	var ACode = document.pullDown.areaList.value;
	
	document.pullDown.LCode.value = LCode;
	document.pullDown.ACode.value = ACode;
    document.pullDown.submit();
	
}

var agent = navigator.userAgent;
var appver = navigator.appVersion;
var navi = navigator.appName;


var isDom = (document.getElementById!=null);
var isOpera = (agent.indexOf("Opera")>-1);
var isIe4 = (document.all && !isDom && !isOpera);
var isIe5 = (document.all && isDom && !isOpera);
var isIe = (isIe4 || isIe5);
var isFF = (agent.indexOf("Firefox")>-1);
var isNN = (navi.indexOf("Netscape",0)>-1 && !isFF);
var isNN4 = (document.layers && isNN);
var isNN6 = (isDom && isNN);
var isWin = (agent.indexOf('Win') != -1);
var isMac = (agent.indexOf('Mac') != -1);

function getWindowWidth(){

	if(isNN || isOpera || isFF) return window.innerWidth;
	if(isIe5) return document.body.clientWidth;
	return 0;
}
function getWindowHeight(){
	if(isNN || isOpera || isFF) return window.innerHeight;
	if(isIe5) return document.body.clientHeight;
	return 0;
}

function LinkActive(obj){
	obj.style.background="#fff799";
	obj.style.color="#555555";
	obj.style.cursor = "hand";
	obj.className='layeractive';
}
function LinkDefault(obj){
	obj.style.background="#FFFFFF";
	obj.style.color="#4444AA";
	obj.style.textDecoration ="Underline";
	obj.style.cursor = "hand";
	obj.className='layerlink';
}
function LinkSelect(obj){
	obj.style.background="#8888CC";
	obj.style.color="#FFFFFF";
	obj.style.cursor = "default";
	obj.className='layerselect';
}

var m_cookie = document.cookie;
function getCookie(name){
	name+="=";
	m_cookie+=";";
	var start = m_cookie.indexOf(name);
	if(start!=-1){
		var end = m_cookie.indexOf(";",start);
		var value = m_cookie.substring(start+(name.length),end);
			return decodeURL(value);
//			return window.decodeURIComponent ? window.decodeURIComponent(value) : unescape(value);
	}
	return '';
}

function decodeURL(str){
	var s0, i, j, s, ss, u, n, f;
	s0 = "";                // decoded str
	for (i = 0; i < str.length; i++){   // scan the source str
		s = str.charAt(i);
		if (s == "+"){
			s0 += " ";
		}else{
			if (s != "%"){
				s0 += s;
			}else{
				u = 0;          // unicode of the character
				f = 1;          // escape flag, zero means end of this sequence
				while (true) {
					ss = "";    // local str to parse as int
						for (j = 0; j < 2; j++ ) {  // get two maximum hex characters to parse
							sss = str.charAt(++i);
							if (((sss >= "0") && (sss <= "9")) || ((sss >= "a") && (sss <= "f"))  || ((sss >= "A") && (sss <= "F"))) {
								ss += sss;          // if hex, add the hex character
							}else{
								--i; break;
							}    // not a hex char., exit the loop
						}
					n = parseInt(ss, 16);           // parse the hex str as byte
					if (n <= 0x7f){u = n; f = 1;}   // single byte format
					if ((n >= 0xc0) && (n <= 0xdf)){u = n & 0x1f; f = 2;}   // double byte format
					if ((n >= 0xe0) && (n <= 0xef)){u = n & 0x0f; f = 3;}   // triple byte format
					if ((n >= 0xf0) && (n <= 0xf7)){u = n & 0x07; f = 4;}   // quaternary byte format (extended)
					if ((n >= 0x80) && (n <= 0xbf)){u = (u << 6) + (n & 0x3f); --f;}    // not a first, shift and add 6 lower bits
					if (f <= 1){break;}             // end of the utf byte sequence
					if (str.charAt(i + 1) == "%"){ i++ ;}                   // test for the next shift byte
					else {break;}                   // abnormal, format error
				}
			s0 += String.fromCharCode(u);           // add the escaped character
			}
		}
	}
	return s0;
}

function getUser(){
	if(getCookie("info").indexOf(".")==-1) return "";
	return getCookie("info").split(".")[0];
}

function getCarrier(){
	if(getCookie("info").indexOf(".")==-1) return "";
	return getCookie("info").split(".")[1];
}