////////////////////////////////////////////////////////////////////////////////
//
// GMAPJ WebSite Navigations Function
//
////////////////////////////////////////////////////////////////////////////////
//
//
//ロールオーバー
//
function initRollovers() {
    if (!document.getElementById) {
        return;
    }
    var aPreLoad = new Array();
    var sTempSrc;
    var aImages = document.getElementsByTagName('img');
    for (var i = 0; i < aImages.length; i++) {        
        if (aImages[i].className == 'imgover') {
            var src = aImages[i].getAttribute('src');
            var ftype = src.substring(src.lastIndexOf('.'), src.length);
            var hsrc = src.replace(ftype, '_a'+ftype);
            aImages[i].setAttribute('hsrc', hsrc);
            aPreLoad[i] = new Image();
            aPreLoad[i].src = hsrc;
            aImages[i].onmouseover = function() {
                sTempSrc = this.getAttribute('src');
                this.setAttribute('src', this.getAttribute('hsrc'));
            }
            aImages[i].onmouseout = function() {
                if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_a'+ftype, ftype);
                this.setAttribute('src', sTempSrc);
            }
        }
    }
}

try {
    window.addEventListener("load", initRollovers, false);
} catch(e) {
    window.attachEvent("onload", initRollovers);
}

//
//ポップアップコントロール
//
function openwin(url) {
	new_win = window.open(url,"new_win","toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1");
	new_win.focus();
}

function openpop(url) {
	pop_win = window.open(url,"pop_win","width=480,height=600,toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=0");
	pop_win.focus();
}

function openpop_wide(url) {
	pop_win = window.open(url,"pop_win","width=800,height=890,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1");
	pop_win.focus();
}


//
//コーピーライト生成
//
function CreateCopyright()
{
document.write('<img src="/img/interface/copyright.gif" alt="Copyright General Motors Asia Pacific (Japan) Ltd. All rights reserved." width="245" height="9" id="copyright" />');
}


//
//フッターリンク生成
//
function CreateFooterLinks() {
    var url = (location.hostname == 'stage.ch.gmapj.com')
        ? 'stage.gmj.gmapj.com'
        : 'www.gmjapan.co.jp';
document.write('<li><a href="/newsrelease/"><img src="/img/interface/btn_newsrelease.gif" alt="プレスリリース" width="58" height="11" /></a></li>');
document.write('<li><a href="/about/index.html"><img src="/img/interface/btn_about.gif" alt="GMAPJについて" width="72" height="11" /></a></li>');
document.write('<li><a href="/info/index.html"><img src="/img/interface/btn_info.gif" alt="環境への取り組み" width="72" height="11" /></a></li>');
document.write('<li><a href="/recruits/"><img src="/img/interface/btn_recruit.gif" alt="採用情報" width="37" height="11" /></a></li>');
document.write('<li><a href="/link/index.html"><img src="/img/interface/btn_link.gif" alt="関連サイト" width="43" height="11" /></a></li>');
document.write('<li><a href="/pressroom/"><img src="/img/interface/btn_pressroom.gif" alt="プレスルーム" width="54" height="11" /></a></li>');
document.write('<li><a href="/policy/index.html"><img src="/img/interface/btn_policy.gif" alt="サイトポリシー" width="59" height="11" /></a></li>');
document.write('<li><a href="/privacy/index.html"><img src="/img/interface/btn_privacy.gif" alt="個人情報保護ポリシー" width="90" height="11" /></a></li>');
document.write('<li class="navi_right"><a href="/sitemap.html"><img src="/img/interface/btn_sitemap.gif" alt="サイトマップ" width="50" height="11" /></a></li>');
}



