//**********************************************************************
// By click the arrow to open or close the menu, which is on top of the screen.
// param@ o :           the object of the document,which be clicked
// param@ imagePath: the path of the image｣ｬwhich is before the clicked node
//**********************************************************************

function ChangeStatus(o, imagePath)
{

    if (o.parentNode)
    {
    
    
        if (o.parentNode.className == "Opened")
        {
            o.parentNode.className = "Closed";
            o.src=""+imagePath+"images/arrow_blue_r.gif";
        }
        else
        {
            o.parentNode.className = "Opened";
            o.src=""+imagePath+"images/arrow_gray_d.gif";
        }
        
        var parentId = o.parentNode.id;
        
        if(parentId=="li_1" || parentId=="li_2" || parentId=="li_3" || parentId=="li_4")
        {
            if(document.getElementById(parentId).className!="Closed")
            {
                document.getElementById("li_1").className = "Closed";
                document.getElementById("li_2").className = "Closed";
                document.getElementById("li_3").className = "Closed";
                document.getElementById("li_4").className = "Closed";
                document.getElementById("li_1").children[1].src = ""+imagePath+"images/arrow_blue_r.gif";
                document.getElementById("li_2").children[1].src = ""+imagePath+"images/arrow_blue_r.gif";
                document.getElementById("li_3").children[1].src = ""+imagePath+"images/arrow_blue_r.gif";
                document.getElementById("li_4").children[1].src = ""+imagePath+"images/arrow_blue_r.gif";
                
                document.getElementById(parentId).className = "Opened";
                o.src=""+imagePath+"images/arrow_gray_d.gif";
            }
            setTimeout("showDropdown('1')",50);
        }
        
    }
}

//**********************************************************************
// By click the node to open or close the menu, which is on the left side of the screen.
// param@ o : the object of the document,which be clicked
// param@ imagePath: the path of the image｣ｬwhich is before the clicked node
//**********************************************************************

function ChangeStatus1(o, imagePath )
{
    if (o.parentNode)
    {
        if (o.parentNode.className == "Opened")
        {
            o.parentNode.className = "Closed";
           o.firstChild.rows[0].cells[0].childNodes[0].src=""+imagePath+"images/arrow_blue_r.gif"
           o.className="changeCB" ;
           o.firstChild.rows[0].cells[1].className="changeCB";
        }
        else
        {
            o.parentNode.className = "Opened";
            o.firstChild.rows[0].cells[0].childNodes[0].src=""+imagePath+"images/arrow_gray_d.gif"
            o.className="changeCA" ;
            o.firstChild.rows[0].cells[1].className="changeCA";
        }                
    }              
}        

//**********************************************************************
// Display the string of 'GE Capital' when mouse over the logo image
// param@ imgObject : the object of the logo image
// param@ id: a flag for the switch statement
//**********************************************************************

function toolTip(imgObject, id){
	switch(id)
	{
	case 1:
	 imgObject.title= 'GE Capital';
	  break;    		
	}		
}

//**********************************************************************
// Link to a new window depending on the option of the select
// param@ obj : the object of the option 
//**********************************************************************

function onSelect(obj)
{
          if  (obj.value  != "")
          {
          	if (obj.value == "kinyushohin"){
          		window.open('../../info/kinyushohin.html');
          		return false;
          	}else{
          		window.location.href=obj.value ;
          	}
          }
      		
}

//**********************************************************************
// By click the buttons to link to new windows  
// param@ id : a flag for the switch statement, and it decides which window will be opened
//**********************************************************************

function gotopage(id)
{
    switch(id)
    {
    case 1: 
     location.href="message.html";
      break;
    case 2:  
     location.href="aboutgecapital.html";
      break;      
   case 3:  
     location.href="http://www.ge.com/jp/";
      break;       
    }       
}

//**********************************************************************
// By mouse over to display the menu, which is on top of the screen.
// param@ elemId : part of document ID
//**********************************************************************

function showDropdown(elemId){
	var arrElems = new Array('did'+elemId, 'didc'+elemId);
	var nLength = arrElems.length;
	var nIndex = 0;
	var navSubI;
	var inspText;
	for (nIndex; nIndex < nLength; nIndex++){
		elem = document.getElementById(arrElems[nIndex]);
		elem.style.visibility = "visible";
		elem.style.display = "block";
	}

	/* fix for the IE layers */
		var version=0;
		if (navigator.appVersion.indexOf("MSIE")!=-1){
			temp=navigator.appVersion.split("MSIE");
			version=parseFloat(temp[1]);
		}
		
		if (version != 0 && version !=8) {		
			if (navSubI = document.getElementById('navSubItem')){ 
				navSubI.className = "navSubItem navHidden"; 
			}
			if (inspText = document.getElementById('docTable')){
				inspText.className = "navHidden";
			}

			if (inspText = document.getElementById('inspiraText')){
				inspText.className = "navHidden inspiraText";
			}

			if (inspText = document.getElementById('pageTitle')){
				inspText.className = "navHidden";
			}

			if (inspText = document.getElementById('mainTable')){
				inspText.className = "navHidden";
			}    		
			if (inspText = document.getElementById('home_foot')){
				inspText.className = "navHidden";
			}  		
		}
	/* end fix layers */
	/* iframe */
			var DivRef = document.getElementById('didc1');
				var IfrRef = document.getElementById('DivShim');
				
				IfrRef.style.width = DivRef.offsetWidth;
				IfrRef.style.height = DivRef.offsetHeight;
				
				IfrRef.style.top = 19;
				IfrRef.style.left = -20;
				IfrRef.style.zIndex = DivRef.style.zIndex - 1;
				IfrRef.style.display = "block";        			
	}
	
//**********************************************************************
// By mouse out to hide the menu, which is on top of the screen.
// param@ elemId : part of document ID
//**********************************************************************

function hideDropdown(elemId){
	var arrElems = new Array('did'+elemId, 'didc'+elemId);
	var nLength = arrElems.length;
	var nIndex = 0;
	var navSubI;
	var inspText;    			
	for (nIndex; nIndex < nLength; nIndex++){
		elem = document.getElementById(arrElems[nIndex]);
		elem.style.visibility = "hidden";
		elem.style.display = "none";
	}

	if (navSubI = document.getElementById('navSubItem')){
		navSubI.className = "navSubItem navVisible";
	}

	if (navSubI = document.getElementById('pageTitle')){
		navSubI.className = "navVisible";
	}

	if (inspText = document.getElementById('docTable')){
		inspText.className = "navVisible";
	}

	if (inspText = document.getElementById('inspiraText')){
		inspText.className = "navVisible inspiraText";
	}

	if (inspText = document.getElementById('mainTable')){
		inspText.className = "navVisible";
	}
	if (inspText = document.getElementById('home_foot')){
		inspText.className = "";
	}
	var IfrRef = document.getElementById('DivShim');
	IfrRef.style.width = 0;
		IfrRef.style.height = 0;
		IfrRef.style.top = 0;
		IfrRef.style.left = 0;
	IfrRef.style.display = "none";  
	 			
}

//********************************************************************************
// By mouse over or out to change the background image of the menu｣ｬwhich is on top of the screen.
// param@ id : document ID
// param@ id : the path of the background image
//********************************************************************************

function imgChange(id, source){
	document.getElementById(id).style.background = "url("+source+") no-repeat 0px 0px";
} 

//**********************************************************************
// Popup
//**********************************************************************
// 変数：pxxx (先頭[p])
// 関数：open_xxx
//**********************************************************************


var pNotFocus = '';
var pUrl,pName,pWid,pHgt;

var pAppName = navigator.appName;
if( pAppName == "Microsoft Internet Explorer" ){
	if( navigator.userAgent.substr(navigator.userAgent.indexOf("MSIE") + 5,3) < 5.0 ){
		pNotFocus = "IE4";
	}
}

//=============================================
// open_popup()
//=============================================
function open_popup(pUrl,pName,pWid,pHgt){
	var pOpt = "toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,width=" + pWid + ",height=" + pHgt;
	var pWin = window.open(pUrl,pName,pOpt);

	if( pNotFocus != "IE4" && pWin != null ){
		pWin.focus();
	}
}

