var gnvNum = 8;
var preGnv = new Array;

var impath= nv_root_path + "/share/images/";

for(var i=0;i<gnvNum;i++){
	preGnv[i] = impath + 'global_nv_0'+(i+1)+'_a.gif';
}
preloadimgArray(preGnv);

//var nv_root_path="http://www.mitsubishi-motors.co.jp";
//var nv_root_path="";


document.write('<scr'+'ipt type="text/javascript" src="http://mmc.dga.jp/common/js/search_tool.js"></scr'+'ipt>');
document.write('<scr'+'ipt type="text/javascript" src="http://mmc.dga.jp/common/js/jquery.js"></scr'+'ipt>');
document.write('<scr'+'ipt type="text/javascript" src="http://mmc.dga.jp/common/js/sa/i_search_assist.js" charset="UTF-8"></scr'+'ipt>');

function global_header_write(chkflg){
var global_header;
var global_navibox;
global_header = '<form onsubmit="return mysearch();" action="" name="search_form"><div id="header"><div class="left"><div class="inner"><p><a href="http://www.mitsubishi-motors.co.jp/"><img src="'+nv_root_path+'/share/images/header_logo_01.gif" alt="MITSUBISHI MOTORS" title="MITSUBISHI MOTORS トップページへ" width="93" height="63"><\/a><\/p><\/div><\/div>\n';

global_header += '<div class="right"><div class="inner"><div class="headerbox1"><p><a href="'+nv_root_path+'/sitemap/index.html">サイトマップ<\/a>&nbsp;|&nbsp;<a href="'+nv_root_path+'/support/recall/index.html">リコール情報</a>&nbsp;|&nbsp;<a href="'+nv_root_path+'/reference/index.html">お問い合わせ<\/a><\/p><\/div>';

global_header += '<div class="headerbox2"><div class="leftbox2"><img src="'+nv_root_path+'/share/images/header_tx_01.gif" alt="サイト内検索" width="79" height="20"><\/div><div class="rightbox2"><p><input type="text" class="search" size="20" name="kw" id="i_search_text_input" autocomplete="off"><input type="image" src="'+nv_root_path+'/share/images/header_bt_01.gif" value="検索" alt="検索" class="button1" onclick="mysearch();"><a href="http://www.mitsubishi-motors.com/"><img src="'+nv_root_path+'/share/images/header_bt_02.gif" alt="Global" width="75" height="16" class="button2"><\/a><\/p><\/div><\/div><\/div><\/div><\/div>';

global_header += '  <input type="hidden" value="co" name="type"><input type="hidden" value="s" name="ie"><\/form>\n';

global_navibox = '<div id="global"><div class="globalArea"><div class="inner"><ul>\n';
global_navibox += '<li id="grv00"><a href="'+nv_root_path+'/index.html" title="ホーム" onMouseOver="swapglnvb(\'01_a\');return false;" onMouseOut="swapglnvb(\'01\');return false;"><img src="'+nv_root_path+'/share/images/global_nv_01.gif" alt="ホーム" name="global_nv_01" width="46" height="22"><\/a><\/li>\n';
global_navibox += '<li id="grv01"><a href="'+nv_root_path+'/lineup/index.html" title="ラインアップ" onMouseOver="swapglnvb(\'02_a\');return false;" onMouseOut="swapglnvb(\'02\');return false;"><img src="'+nv_root_path+'/share/images/global_nv_02.gif" alt="ラインアップ" name="global_nv_02" width="88" height="22"><\/a><\/li>\n';
global_navibox += '<li id="grv02"><a href="'+nv_root_path+'/purchase/index.html" title="購入検討サポート" onMouseOver="swapglnvb(\'03_a\');return false;" onMouseOut="swapglnvb(\'03\');return false;"><img src="'+nv_root_path+'/share/images/global_nv_03.gif" alt="購入検討サポート" name="global_nv_03" width="96" height="22"><\/a><\/li>\n';
global_navibox += '<li id="grv03"><a href="'+nv_root_path+'/support/index.html" title="ユーザーサポート/カーライフ" onMouseOver="swapglnvb(\'04_a\');return false;" onMouseOut="swapglnvb(\'04\');return false;"><img src="'+nv_root_path+'/share/images/global_nv_04.gif" alt="ユーザーサポート/カーライフ" name="global_nv_04" width="148" height="22"><\/a><\/li>\n';
global_navibox += '<li id="grv04"><a href="http://www.mitsubishi-motors.co.jp/motorsports/index.html" title="モータースポーツ" onMouseOver="swapglnvb(\'05_a\');return false;" onMouseOut="swapglnvb(\'05\');return false;"><img src="'+nv_root_path+'/share/images/global_nv_05.gif" alt="モータースポーツ" name="global_nv_05" width="93" height="22"><\/a><\/li>\n';
global_navibox += '<li id="grv05"><a href="'+nv_root_path+'/special/index.html" title="スペシャルコンテンツ"onMouseOver="swapglnvb(\'06_a\');return false;" onMouseOut="swapglnvb(\'06\');return false;"><img src="'+nv_root_path+'/share/images/global_nv_06.gif" alt="スペシャルコンテンツ" name="global_nv_06" width="109" height="22"><\/a><\/li>\n';
global_navibox += '<li id="grv06"><a href="'+nv_root_path+'/corporate/index.html" title="企業情報"onMouseOver="swapglnvb(\'07_a\');return false;" onMouseOut="swapglnvb(\'07\');return false;"><img src="'+nv_root_path+'/share/images/global_nv_07.gif" alt="企業情報" name="global_nv_07" width="57" height="22"><\/a><\/li>\n';
global_navibox += '<li id="grv07"><a href="'+nv_root_path+'/social/index.html" title="社会・環境への取り組み" onMouseOver="swapglnvb(\'08_a\');return false;" onMouseOut="swapglnvb(\'08\');return false;"><img src="'+nv_root_path+'/share/images/global_nv_08.gif" alt="社会・環境への取り組み" name="global_nv_08" width="97" height="22"><\/a><\/li>\n';
global_navibox += '<\/ul><\/div><\/div><\/div>\n';

document.writeln(global_header);
document.write(global_navibox);

if(typeof writeglb == "function") return;

listset();

}


/* swap image */
function swapglnvb(num){
	var img=impath+"global_nv_"+num+".gif";
	var nm="global_nv_"+num.substring(0,2);
	swapimage(nm,img);
}


function global_footer_write(chkflg){
	
var global_footer;

if(chkflg == 0){
global_footer = '<div class="linkArea"><p><a href="'+nv_root_path+'/usage/index.html">サイトのご利用について<\/a>&nbsp;|&nbsp;<a href="'+nv_root_path+'/privacy/index.html">個人情報保護方針<\/a><\/p><\/div>';
}else{
global_footer = '<div id="footer"><div class="linkArea"><p><a href="'+nv_root_path+'/usage/index.html">サイトのご利用について<\/a>&nbsp;|&nbsp;<a href="'+nv_root_path+'/privacy/index.html">個人情報保護方針<\/a><\/p><\/div><div class="copyrightArea"><p>(c) Mitsubishi Motors Corporation. All rights reserved.<\/p><\/div><\/div>';
}

document.write(global_footer);

}


//--------------------------------------------
// global Navigation 
// Float MENU 
//--------------------------------------------

		  
document.write('<scr'+'ipt type="text/javascript" src="'+nv_root_path+'/share/script/globalmenu.js"><\/scr'+'ipt>');

var firston = true;
var timerb;
var time_sec = 1;
var timestop = false;
var defid = 'float0';
var layerleftset = new Array(14,60,148,244,392,485,594,651);
	  
		  
function globalnvFloat(){
	this.initialize.apply(this, arguments);
}
function listset(){
	
	if(!document.getElementById('global')) return;
	var nvobj = document.getElementById('global').getElementsByTagName('a');
	
	var baselayer = document.createElement('div');
	baselayer.id = 'floatbase';
	
	
	var ifm = document.createElement('iframe');
	ifm.id = 'ifm';
	ifm.frameborder = 0;
	baselayer.appendChild(ifm);
	
	for(var i=0; i<nvobj.length; i++){
		var floatlayer = document.createElement('div');
		floatlayer.id = 'float' +i;
			
		var gnv = new globalnvFloat(nvobj,baselayer,floatlayer,i);
		gnv.setEevnt();
	}
	
}


globalnvFloat.prototype = {
		
	initialize:function(nvobj,baselayer,floatlayer,num){
	
		this.bttag = nvobj;
		this.num = num;
		if(!globalnvList) return;
		if(globalnvList[this.num]){
		var ul = document.createElement('ul');
		
		for(var j=0;j<globalnvList[this.num].length;j++){
		var li = document.createElement('li');
		
		li.innerHTML = globalnvList[this.num][j];		
		ul.appendChild(li);

		floatlayer.appendChild(ul);
		
		
		}
		addListener(floatlayer, 'mouseover',floatev);
		addListener(floatlayer, 'mouseout',floatev);
		
	
		
		baselayer.appendChild(floatlayer);
		//document.getElementById('general').appendChild(baselayer);
		document.getElementsByTagName('body')[0].appendChild(baselayer);
		}
	},
	
	setEevnt:function(){	
	for(var i=0;i<this.bttag.length;i++){
	addListener(this.bttag[i], 'mouseover',gete);
	addListener(this.bttag[i], 'mouseout',gete);
	}
	},
	
	getev:function(e){
	if(!e) return;
	if(e.target){
	e.stopPropagation();
	}else{
	window.event.cancelBubble = true;
	}
	}
}

function gete(e){
	
	globalnvFloat.prototype.getev(e);
	
	var ctarget = this;
	
	if(e.type == 'click'){
	//listcont.prototype.showhidden(ctarget);
	}
	if(e.type == 'mouseout'){
	settime();
	}
	if(e.type == 'mouseover'){
	lyclear();
	timestop = true;
	clearInterval(timerb);
	
	var getid = ctarget.parentNode.id;
	
	var getidnum = getid.slice(4);
	if(getidnum == "0") return;
	document.getElementById('float'+getidnum).style.left = layerleftset[getidnum];
	document.getElementById('float'+getidnum).style.display = 'block';
	if(document.getElementById('ifm') && (getidnum == '1' || getidnum == '2')){
	document.getElementById('ifm').style.height = document.getElementById('float'+getidnum).offsetHeight;
	document.getElementById('ifm').style.left = layerleftset[getidnum];
	document.getElementById('ifm').style.display = 'block';
	}
	defid = 'float'+getidnum;
	}
}

function floatev(e){
	globalnvFloat.prototype.getev(e);
	
	if(e.type == 'click'){
	//listcont.prototype.showhidden(ctarget);
	}
	if(e.type == 'mouseout'){
	settime();
	}
	if(e.type == 'mouseover'){
	timestop = true;
	clearInterval(timerb);
	}
}

function outcheck(){
	time_sec --;
	if(time_sec <=0){
		clearInterval(timerb);
		if(!timestop){
		lyclear();
		}
	}
}

function settime(){
	if(!timestop) return;
	time_sec = 1;
	timestop = false;
	timerb = setInterval(outcheck,200);	
}

function lyclear(){
	if(document.getElementById('ifm')) document.getElementById('ifm').style.display = 'none';
	document.getElementById(defid).style.display = 'none';
}




