<!--//

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 wopen(url){
//     win=window.open(url, "subwin", "width=700, height=850");
// }


function changeImg(iName,img){
	document.images[iName].src=img;
}

function _JumpURLnewWin(url,sizeX,sizeY) 
{
  if (url != ''){
    win=window.open(url,"a","scrollbars=1,resizable=yes,width=" + sizeX + ",height=" + sizeY);
  }
}
function _TargetWinOpen(url,sizeX,sizeY,target) 
{
  if (url != ''){
    win=window.open(url,target,"scrollbars=1,resizable=yes,width=" + sizeX + ",height=" + sizeY);
  }
}
function SelectJumpURL(obj) 
{
  url = obj.options[obj.selectedIndex].value;
  if (url != '')
  {
    window.location = url;
  }
}
function mOvr(src,clrOver){ 
	if (!src.contains(event.fromElement)){
		src.style.cursor = 'hand'; 
		src.bgColor = clrOver; 
	} 
} 
function mOut(src,clrIn){ 
	if (!src.contains(event.toElement)){ 
		src.style.cursor = 'default'; 
		src.bgColor = clrIn; 
	} 
} 


//showLayer
function showLay(idName){ 
	if(document.getElementById){//NN6,Mozilla,IE5用
		document.getElementById(idName).style.visibility = 'visible';
	}else if(document.all){//IE4用
		document.all(idName).style.visibility = 'visible';
	}else if(document.layers){//NN4用
		document.layers[idName].visibility = 'show';
	}
}

//hideLayer
function hideLay(idName){ 
	if(document.getElementById){//NN6,Mozilla,IE5用
		document.getElementById(idName).style.visibility = 'hidden';
	}else if(document.all){//IE4用
		document.all(idName).style.visibility = 'hidden';
	}else if(document.layers){//NN4用
		document.layers[idName].visibility = 'hide';
	}
}

// 画像のonLoad
var url = new Array(


"/common/footerNvg01_on.gif",
"/common/footerNvg02_on.gif",
"/common/footerNvg03_on.gif"

);

var theImages = new Array;
function preLoad(){
	for(var i = 0; i < url.length; i++){
		theImages[i] = new Image;
		theImages[i].src = url[i];
	}
}

function disp(url){

window.open(url, "window_name", "width=545,height=650,scrollbars=yes");

} 

// スムーススクロール
function SmoothScroll(targetID){
  if( !document.getElementById ) {return true;}
  var step=10;  //初速度
  var max=400;  //最高速度
  var accel=4;  //加速度
  var interval=30;  //加速インターバル
  var current_y = document.body.scrollTop  || document.documentElement.scrollTop;
  var element=document.getElementById(targetID);
  if (!element){return true;}
  var target_y = 0;
  for (i = element;i.offsetParent;i=i.offsetParent ){
    target_y += i.offsetTop;
  }
  var count=0;
  if ( current_y > target_y ){ step = -(step); accel = -(accel);}
  var timerid = setInterval( function(){
    if (step<max) step += (count*accel);
    if ( Math.abs(current_y-target_y) < Math.abs(step) ){
      window.scrollTo((document.body.scrollTop  || document.documentElement.scrollTop),target_y);
      clearInterval(timerid);
      return false;
    }else{
      window.scrollBy(0,step);
      current_y += step;
      count++;
    }
  },interval);
  return false;
}


function area_map(stNUM,areacd){
	if(document.area_box.area_name01.value == stNUM){
		Duplicate();
	}else if(document.area_box.area_name02.value == stNUM){
		Duplicate();
	}else if(document.area_box.area_name03.value == stNUM){
		Duplicate();
	}else{
	
		if(document.area_box.area_name01.value == ""){
			document.area_box.area_name01.value = stNUM;
			document.area_box.area_cd01.value = areacd;
		}else if(document.area_box.area_name02.value == ""){
			document.area_box.area_name02.value = stNUM;
			document.area_box.area_cd02.value = areacd;
		}else if(document.area_box.area_name03.value == ""){
			document.area_box.area_name03.value = stNUM;
			document.area_box.area_cd03.value = areacd;
		}else{
			Overflow();
		}
	}
	
	
//	for (i=0; i<document.area_box.elements.length; i++){
//		if (document.area_box.elements[i].value == document.area_name.elements[stNUM].value){
//			Duplicate();
//			break;
//		}
//		if (document.area_box.elements[i].value == ""){
//			document.area_box.elements[i].value = document.area_name.elements[stNUM].value;
//			break;
//		}
//	}
//	for(j=0; j<document.area_check.elements.length; j++){
//		if (document.area_check.elements[j].value == stNUM){
//			document.area_check.elements[j].checked=true;
//		}
//	}
//	if (i >= document.area_box.elements.length) {
//		Overflow();
//	}
}

function Duplicate(){
//	alert("クリックした駅は既に選択済みです。");
}
function Overflow(){
	flag = confirm("これ以上選択できません。エリア選択を解除しますか？");
	if(flag){
		document.area_box.area_name01.value = "";
		document.area_box.area_cd01.value = "";
		document.area_box.area_name02.value = "";
		document.area_box.area_cd02.value = "";
		document.area_box.area_name03.value = "";
		document.area_box.area_cd03.value = "";
	}
}

// smartRollover

function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_rll."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_rll.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_rll."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}



//-->
