/*
	Mitsubishi Corporation Homepage
	http://www.mitsubishi.co.jp/jp/
	[ mitsubishi.js ]
*/

//var dir = '../';
var dir ='jp/';

var isPc = (navigator.userAgent.indexOf("Windows") != -1);
var isMac = (navigator.userAgent.indexOf("Mac") != -1);
var isNS = (navigator.appName == "Netscape");
var isNS4 = (isNS && (navigator.userAgent.indexOf("Gecko") == -1));
var isNS6 = (isNS && (navigator.userAgent.indexOf("Gecko") != -1));
var isIE = ((navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Opera") == -1));
var isIEPc = ((navigator.userAgent.indexOf("MSIE") != -1) && isPc && (navigator.userAgent.indexOf("Opera") == -1));
var isIEPc5 = ((navigator.userAgent.indexOf("MSIE 5.0") != -1) && isPc && (navigator.userAgent.indexOf("Opera") == -1));
var isIEPc55 = ((navigator.userAgent.indexOf("MSIE 5.5") != -1) && isPc && (navigator.userAgent.indexOf("Opera") == -1));
var isIEPc6 = ((navigator.userAgent.indexOf("MSIE 6.") != -1) && isPc && (navigator.userAgent.indexOf("Opera") == -1));
var isIEMac = ((navigator.userAgent.indexOf("MSIE") != -1) && isMac && (navigator.userAgent.indexOf("Opera") == -1));
var version = parseInt(navigator.appVersion);
var lP = location.pathname;





var loaded = 0;
var last = "";
var ml_btn_off = 'images/leftnav/ml_btn.gif';
var ml_btn_on = 'images/leftnav/ml_btn_o.gif';

	gm_about_off = new Image();gm_about_off.src = dir + 'images/gm_about.gif';
	gm_about_on = new Image();gm_about_on.src = dir + 'images/gm_about_o.gif';
	gm_csr_off = new Image();gm_csr_off.src = dir + 'images/gm_csr.gif';
	gm_csr_on = new Image();gm_csr_on.src = dir + 'images/gm_csr_o.gif';
	gm_bg_off = new Image();gm_bg_off.src = dir + 'images/gm_bg.gif';
	gm_bg_on = new Image();gm_bg_on.src = dir + 'images/gm_bg_o.gif';
	gm_pr_off = new Image();gm_pr_off.src = dir + 'images/gm_pr.gif';
	gm_pr_on = new Image();gm_pr_on.src = dir + 'images/gm_pr_o.gif';
	gm_ir_off = new Image();gm_ir_off.src = dir + 'images/gm_ir.gif';
	gm_ir_on = new Image();gm_ir_on.src = dir + 'images/gm_ir_o.gif';
	gm_network_off = new Image();gm_network_off.src = dir + 'images/gm_network.gif';
	gm_network_on = new Image();gm_network_on.src = dir + 'images/gm_network_o.gif';
	gm_contact_off = new Image();gm_contact_off.src = dir + 'images/gm_contact.gif';
	gm_contact_on = new Image();gm_contact_on.src = dir + 'images/gm_contact_o.gif';
	
	gm_connection_off = new Image();gm_connection_off.src = dir + 'images/gm_connection.gif';
	gm_connection_on = new Image();gm_connection_on.src = dir + 'images/gm_connection_o.gif';
	
	//add lyy 1123
	lm_1_1_on = new Image(); lm_1_1_on.src =   dir + 'images/lm_1_1_o.gif';
	lm_1_1_off = new Image();lm_1_1_off.src =  dir + 'images/lm_1_1.gif';
	
	lm_1_2_on = new Image(); lm_1_2_on.src =   dir + 'images/lm_1_2_o.gif';
	lm_1_2_off = new Image();lm_1_2_off.src =  dir + 'images/lm_1_2.gif';
	
	lm_1_3_on = new Image(); lm_1_3_on.src =   dir + 'images/lm_1_3_o.gif';
	lm_1_3_off = new Image();lm_1_3_off.src =  dir + 'images/lm_1_3.gif';
	
	
	lm_2_1_on = new Image(); lm_2_1_on.src =   dir + 'images/lm_2_1_o.gif';
	lm_2_1_off = new Image();lm_2_1_off.src =  dir + 'images/lm_2_1.gif';
	
	lm_2_2_on = new Image(); lm_2_2_on.src =   dir + 'images/lm_2_2_o.gif';
	lm_2_2_off = new Image();lm_2_2_off.src =  dir + 'images/lm_2_2.gif';
	
	lm_2_3_on = new Image(); lm_2_3_on.src =   dir + 'images/lm_2_3_o.gif';
	lm_2_3_off = new Image();lm_2_3_off.src =  dir + 'images/lm_2_3.gif';
	
	lm_3_1_on = new Image(); lm_3_1_on.src =   dir + 'images/lm_3_1_o.gif';
	lm_3_1_off = new Image();lm_3_1_off.src =  dir + 'images/lm_3_1.gif';
	
	lm_4_1_on = new Image(); lm_4_1_on.src =   dir + 'images/lm_4_1_o.gif';
	lm_4_1_off = new Image();lm_4_1_off.src =  dir + 'images/lm_4_1.gif';
	
	lm_4_2_on = new Image(); lm_4_2_on.src =   dir + 'images/lm_4_2_o.gif';
	lm_4_2_off = new Image();lm_4_2_off.src =  dir + 'images/lm_4_2.gif';


	
	lm_5_1_on = new Image(); lm_5_1_on.src =   dir + 'images/lm_5_1_o.gif';
	lm_5_1_off = new Image();lm_5_1_off.src =  dir + 'images/lm_5_1.gif';
	
	lm_5_2_on = new Image(); lm_5_2_on.src =   dir + 'images/lm_5_2_o.gif';
	lm_5_2_off = new Image();lm_5_2_off.src =  dir + 'images/lm_5_2.gif';


	
	lm_6_1_on = new Image(); lm_6_1_on.src =   dir + 'images/lm_6_1_o.gif';
	lm_6_1_off = new Image();lm_6_1_off.src =  dir + 'images/lm_6_1.gif';


//add lyy 

function changepict(){
	s_location="";
	var len=0;
	var position=0;
	 s_sub="";
	lyy=document.location;
    	
	//if (lyy1.toString().indexOf("b",0)>0) document.writeln("helen1");
	//必衼E糜胻oString()否则有大问题，担搁时间。
	if (document.location.toString().indexOf("jp",0)>0 )
		//subdirectory	
		{ 	
		position= lyy.toString().indexOf("jp",0);

		s_sub=lyy.toString().substring(position);
		//document.write(s_sub);
		}
	else
		//head html
		{
		position=lyy.toString().indexOf("index",0);
		s_sub=lyy.toString().substring(position);
		//document.write(s_sub);
		}
	
	switch (s_sub)
 { 
	case "jp/information/index.html": document.lm_1_1.src= dir + 'images/lm_1_1_o.gif';
				break;
	case "jp/information/says.html": document.lm_1_2.src= dir + 'images/lm_1_2_o.gif'; 
				break;
	case "jp/information/think.html":document.lm_1_3.src= dir + 'images/lm_1_3_o.gif';
				break;
	case "jp/business/index.htm":   document.lm_2_1.src= dir + 'images/lm_2_1_o.gif'; 
			     break;
	case "jp/business/tradeltd.htm":document.lm_2_2.src= dir + 'images/lm_2_2_o.gif';
				break;
	case "jp/business/business2.htm": document.lm_2_3.src= dir + 'images/lm_2_3_o.gif';
				break;
	case"jp/news/new.htm": document.lm_3_1.src= dir + 'images/lm_3_1_o.gif'; 
				break;
	case "jp/ir/index.htm":document.lm_4_1.src= dir + 'images/lm_4_1_o.gif';
				break;
	case "jp/ir/kabuInfo.htm": document.lm_4_2.src= dir + 'images/lm_4_2_o.gif';
				break;
	case "jp/introduction/index.htm": document.lm_5_1.src= dir + 'images/lm_5_1_o.gif'; 
				break;
	case "jp/introduction/introduction.htm":document.lm_5_2.src= dir + 'images/lm_5_2_o.gif';
				break;
	case "jp/connection/index.htm" : document.lm_6_1.src= dir + 'images/lm_6_1_o.gif';
				break;
	case "index.htm": document.lm_3_1.src= 'jp/'+ 'images/lm_3_1_o.gif'; 
				break;

} 
	//document.writeln(s_sub);
	//　case "jp/information/think.html":document.lm_1_3.src= dir + 'images/lm_1_3_o.gif';
	//case "jp/information/index.html": document.lm_1_1.src= dir + 'images/lm_3_1_o.gif';



}//end fun


	
	

loaded = 1;

function roll(imageName, imageState) {
	if (loaded == 1 && imageState != ''&& imageState != '1') {
		tabOn = eval(imageName+"_"+imageState+".src");
		document [imageName].src = tabOn;
	}
}





function openWin(url,wname,w,h,resizable,toolbar,scrollbars){

		//if(isMac) w += 12;

		if (h >= (screen.height-30)){
			h = screen.height-100;
			w += 18;
			scrollbars = 1;
		}

		if (w >= (screen.width-30)){
			w = screen.width-100;
			h += 20;
			scrollbars = 1;
		}
	
		if (w <= 310){//僼僢僞乕偺夋憸傛傝傕彫偝偔側偭偰偟傑偆偨傔丅偦偺嵟彫偑310
			w = 320;
		}
		
		win_set = 'width=' + w;
		win_set += ',height=' + h;
		win_set += ',resizable=' + resizable;
		win_set += ',toolbar=' + toolbar;
		win_set += ',scrollbars=' + scrollbars;
		win_set += ',fullscreen=no';
		
		url =  url + ((url.match(/&/))? 'width=' : '?width=') + w + '&height=' + h;
		
		swin = window.open(url,wname,win_set);
		swin.focus();
}





function is_opener() {
	var ua = navigator.userAgent;
	if(!!window.opener)
		if( ua.indexOf('MSIE 4')!=-1 && ua.indexOf('Win')!=-1)
			return !window.opener.closed
	else return typeof window.opener.document  == 'object';
	else return false;
}

function is_speechOpener() {
	var ua = navigator.userAgent;
	if(!!window.parent.parent.opener)
		if( ua.indexOf('MSIE 4')!=-1 && ua.indexOf('Win')!=-1)
			return !window.parent.parent.opener.closed
	else return typeof window.parent.parent.document  == 'object';
	else return false;
}


//億僢僾傾僢僾僂僀儞僪僂偐傜恊僂僀儞僪僂傪儘乕僪
function loadOpener(url){
	if(is_opener()){
		window.opener.location.href=url;
		window.opener.focus();
	}else{
		win_set = 'directories=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes';
		swin = window.open(url,'NEW',win_set);
		swin.focus();
	}
}

//IR僗僺乕僠偺億僢僾傾僢僾僂僀儞僪僂偐傜恊僂僀儞僪僂傪儘乕僪
function speechloadOpener(url){
	if(is_speechOpener()){
		window.parent.parent.opener.location.href=url;
		window.parent.parent.opener.focus();
	}else{
		win_set = 'directories=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes';
		swin = window.open(url,'NEW',win_set);
		swin.focus();
	}
}





// 僂僀儞僪僂昞帵
function newwindow(w_id) {
	var w_id;
	var formUrl;
	if(w_id == "products") formUrl = 'form_products.html';//摉幮偺庢埖彜昳丒僒乕價僗偵偮偄偰
	else if(w_id == "ir") formUrl = 'form_ir.html';//IR乮搳帒壠忣曬乯偵偮偄偰
	else if(w_id == "req_ir") formUrl = 'form_req_ir.html';//帒椏惪媮僼僅乕儉乮搳帒壠娭楢乯
	else if(w_id == "press") formUrl = 'form_report.html';//曬摴娭楢
	else if(w_id == "environ") formUrl = 'form_environ.html';//幮夛丒娐嫬妶摦偵偮偄偰
	else if(w_id == "public") formUrl = 'form_public.html';//堦斒偺偍栤偄崌傢偣
	else if(w_id == "req") formUrl = 'form_req.html';//帒椏惪媮僼僅乕儉
	
	openWin('https://' + location.host + '/jp/contact/' + formUrl,'FORM',710,740,1,0,1);
}

// 儕儕乕僗擔帺摦僠僃僢僋
function question_in() {
	var  yy = document.form_rep.release_date_y.value;
	var  mm = document.form_rep.release_date_m.value;
	var  dd = document.form_rep.release_date_d.value;
	if ((yy != "") || (mm != "") || (dd != "")){
		document.form_rep.elements["question_type"][0].checked = true;
	}
}

// 儕儕乕僗擔
function date_cl() {
	document.form_rep.release_date_y.value = "";
	document.form_rep.release_date_m.value = "";
	document.form_rep.release_date_d.value = "";
}





