/************************************************
  
    Site Name: FDA Fuji Dream Airlines
	Description: common script
	Version: 1.0
	Author: Takanori Saito
	Last Modified : Takanori Saito

************************************************/


////////////////////////////////////////////////////////////////////////////////////////////////////
///	Index用htmlローダー
////////////////////////////////////////////////////////////////////////////////////////////////////

//*
window.onload = setOnload;

function setOnload() {
	bannerDivision();
	//targetControll();
	//loadDocFile("info.html","disp1");
	//loadDocFile("http://www.info.fujidreamairlines.com/guide.html","disp2");
	//loadDocFile("banner.html","disp3");
	//loadDocFile("http://www.info.fujidreamairlines.com/newsframe.html","disp4");
}
/*
function loadDocFile(fName, idName) {
    this.idName = createXMLHttpRequest(function() { 
        document.getElementById(idName).innerHTML = ((this.readyState == 4) && (this.status == 200)) ? this.responseText : "Loading...";
    });
    if (this.idName) {
        this.idName.open("GET", fName, true);
        this.idName.send(null);
    }
}
function createXMLHttpRequest(cbFunc) {
	var XMLhttpObject = null;
	try {
		XMLhttpObject = new XMLHttpRequest();
	}catch(e){
		try{
			XMLhttpObject = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				XMLhttpObject = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){
				return null;
			}
		}
	}
	if(XMLhttpObject) XMLhttpObject.onreadystatechange = cbFunc;
	return XMLhttpObject;
}
*/
function bannerDivision() {
////////////////////////////////////////////////////////////////////////////////////////////////////
///	Info部分
////////////////////////////////////////////////////////////////////////////////////////////////////
/*
	var obj = document.getElementById("disp1");
	obj.innerHTML = '<script type="text/javascript" src="http://www.info.fujidreamairlines.com/common/js/flashloader.js" charset="utf-8"></script>';
*/
////////////////////////////////////////////////////////////////////////////////////////////////////
///	ガイド部分
///////////////////////////////////////////////
/////////////////////////////////////////////////////
	var obj = document.getElementById("disp2");
	//*本番環境
	obj.innerHTML = '<h1><a href="http://www.info.fujidreamairlines.com/gourmet/index.html"><img src="http://www.info.fujidreamairlines.com/index/img/guide_head.gif" alt="グルメガイドトップ" /></a></h1><div id="guidelist"><ul><li><a href="http://www.info.fujidreamairlines.com/gourmet/shizuoka/index.html"><img src="http://www.info.fujidreamairlines.com/index/img/guide_shizuoka.gif" alt="静岡グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.info.fujidreamairlines.com/gourmet/sapporo/index.html"><img src="http://www.info.fujidreamairlines.com/index/img/guide_sapporo.gif" alt="札幌グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.info.fujidreamairlines.com/gourmet/matsumoto/index.html"><img src="http://www.info.fujidreamairlines.com/index/img/guide_matsumoto.gif" alt="松本グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.info.fujidreamairlines.com/gourmet/komatsu/index.html"><img src="http://www.info.fujidreamairlines.com/index/img/guide_komatsu.gif" alt="小松グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.info.fujidreamairlines.com/gourmet/fukuoka/index.html"><img src="http://www.info.fujidreamairlines.com/index/img/guide_fukuoka.gif" alt="福岡グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.info.fujidreamairlines.com/gourmet/kumamoto/index.html"><img src="http://www.info.fujidreamairlines.com/index/img/guide_kumamoto.gif" alt="熊本グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.info.fujidreamairlines.com/gourmet/kagoshima/index.html"><img src="http://www.info.fujidreamairlines.com/index/img/guide_kagoshima.gif" alt="鹿児島グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.info.fujidreamairlines.com/gourmet/index.html"><img src="http://www.info.fujidreamairlines.com/index/img/guide_new.gif" alt="新着ご当地自慢" width="134" height="122" /></a></li></ul></div>';
	/*/
	/*テスト環境
	obj.innerHTML = '<h1><a href="http://www.sst-contents.com/fda/gourmet/index.html"><img src="http://www.sst-contents.com/fda/index/img/guide_head.gif" alt="グルメガイドトップ" /></a></h1><div id="guidelist"><ul><li><a href="http://www.sst-contents.com/fda/gourmet/shizuoka/index.html"><img src="http://www.sst-contents.com/fda/index/img/guide_shizuoka.gif" alt="静岡グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.sst-contents.com/fda/gourmet/sapporo/index.html"><img src="http://www.sst-contents.com/fda/index/img/guide_sapporo.gif" alt="札幌グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.sst-contents.com/fda/gourmet/matsumoto/index.html"><img src="http://www.sst-contents.com/fda/index/img/guide_matsumoto.gif" alt="松本グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.sst-contents.com/fda/gourmet/komatsu/index.html"><img src="http://www.sst-contents.com/fda/index/img/guide_komatsu.gif" alt="小松グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.sst-contents.com/fda/gourmet/fukuoka/index.html"><img src="http://www.sst-contents.com/fda/index/img/guide_fukuoka.gif" alt="福岡グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.sst-contents.com/fda/gourmet/kumamoto/index.html"><img src="http://www.sst-contents.com/fda/index/img/guide_kumamoto.gif" alt="熊本グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.sst-contents.com/fda/gourmet/kagoshima/index.html"><img src="http://www.sst-contents.com/fda/index/img/guide_kagoshima.gif" alt="鹿児島グルメガイド" width="134" height="122" /></a></li><li><a href="http://www.sst-contents.com/fda/gourmet/index.html"><img src="http://www.sst-contents.com/fda/index/img/guide_new.gif" alt="新着ご当地自慢" width="134" height="122" /></a></li></ul></div>';
	//*/
////////////////////////////////////////////////////////////////////////////////////////////////////
///	ニュース
////////////////////////////////////////////////////////////////////////////////////////////////////
	var obj = document.getElementById("disp4");
	//*本番環境
	obj.innerHTML = '<h1><img src="http://www.info.fujidreamairlines.com/index/img/news_head.gif" /></h1><img src="http://www.info.fujidreamairlines.com/index/img/news_head2.gif" /><iframe src="http://www.info.fujidreamairlines.com/news.html" width="572" height="121" frameborder="0"></iframe>';
	//*/
	/*テスト環境
	obj.innerHTML = '<h1><img src="http://www.info.fujidreamairlines.com/index/img/news_head.gif" /></h1><img src="http://www.info.fujidreamairlines.com/index/img/news_head2.gif" /><iframe src="http://www.sst-co/news.html" width="572" height="121" frameborder="0"></iframe>';
	//*/
////////////////////////////////////////////////////////////////////////////////////////////////////
///	バナー部分
////////////////////////////////////////////////////////////////////////////////////////////////////
	var obj = document.getElementById("disp3");
	//*本番環境
	obj.innerHTML = '<ul><li><a href="http://www.info.fujidreamairlines.com/flight_info/"><img src="http://www.info.fujidreamairlines.com/index/img/banner_02_off.gif" width="290" height="47" /></a></li><li><a href="javascript:void(0);" onclick="newWindowOpen();"><img src="http://www.info.fujidreamairlines.com/index/img/banner_01_off.gif" width="290" height="47" /></a></li><li><a href="http://www.info.fujidreamairlines.com/recommend/"><img src="http://www.info.fujidreamairlines.com/index/img/banner_orix_off.gif" width="290" height="47" /></a></li><li><a href="http://www.info.fujidreamairlines.com/shop/index.html"><img src="http://www.info.fujidreamairlines.com/index/img/banner_shop_off.gif" width="290" height="47" /></a></li><li><a href="http://www.info.fujidreamairlines.com/dl/gallery.html"><img src="http://www.info.fujidreamairlines.com/index/img/banner_05_off.gif" width="290" height="47" /></a></li><li><img src="http://www.info.fujidreamairlines.com/index/img/banner_mobile.gif" width="290" height="230" /></li></ul>';

	//*/
	/*テスト環境
	obj.innerHTML = '<ul><li><a href="http://www.sst-contents.com/fda/flight_info/"><img src="http://www.sst-contents.com/fda/index/img/banner_02_off.gif" width="290" height="47" /></a></li><li><a href="javascript:void(0);" onclick="newWindowOpen();"><img src="http://www.sst-contents.com/fda/index/img/banner_01_off.gif" width="290" height="47" /></a></li><li><a href="http://www.sst-contents.com/fda/recommend/"><img src="http://www.sst-contents.com/fda/index/img/banner_orix_off.gif" width="290" height="47" /></a></li><li><a href="http://www.sst-contents.com/fda/shop/index.html"><img src="http://www.sst-contents.com/fda/index/img/banner_shop_off.gif" width="290" height="47" /></a></li><li><a href="http://www.sst-contents.com/fda/dl/gallery.html"><img src="http://www.sst-contents.com/fda/index/img/banner_05_off.gif" width="290" height="47" /></a></li><li><img src="http://www.sst-contents.com/fda/index/img/banner_mobile.gif" width="290" height="230" /></li></ul>';
	//*/
}
function newWindowOpen() {
	window.open('http://www.info.fujidreamairlines.com/reservation/reserve_exp.html','mywindow1','width=600, height=482, menubar=no, toolbar=no, scrollbars=no');
}

////////////////////////////////////////////////////////////////////////////////////////////////////
///	Target Controll
////////////////////////////////////////////////////////////////////////////////////////////////////

function targetControll() {
	if(!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		var str = anchor.getAttribute("href");
		if (str.match('http://www.info.fujidreamairlines.com')){
			anchor.target = "_self";
		}
	}
}