/* -----------------------------------------------

functions

----------------------------------------------- */

//背景flashの描画

function swfBgEmded(content,file){

	//背景flashを描画

	var so_back = new SWFObject("/shared/swf/background.swf", "background_flash", "100%", "100%", "9", "#000000");

		so_back.useExpressInstall("/shared/swf/expressinstall.swf");

		so_back.addParam("loop", "false");

		so_back.addParam("quality", "high");

		so_back.addParam("menu", "false");

		so_back.addParam("wmode", "transparent");

		so_back.addVariable("content_name", content);

		so_back.addVariable("file_path", file);

		so_back.write("background_flash");

		

/*	swffit.fit("background_flash",900,600);*/

	

}



//ロールオーバー処理

function initRollOver() {

	//グローバルメニュー

	var image_cache = new Object();

	$("#sub_menu a img").not("[src*='_on.']").each(function(i) {

		var imgsrc = this.src;

		var dot = this.src.lastIndexOf('.');

		var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);

		image_cache[this.src] = new Image();

		image_cache[this.src].src = imgsrc_on;

		$(this).hover(

			function() { this.src = imgsrc_on;

			},

			function() { this.src = imgsrc;

			}

		);

	});

	//サブメニュー

	var image_cache2 = new Object(); 

	$("#sub_menu a img").not("[src*='_on.']").each(function(i) {

		var imgsrc = this.src;

		var dot = this.src.lastIndexOf('.');

		var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);

		image_cache2[this.src] = new Image();

		image_cache2[this.src].src = imgsrc_on;

		$(this).hover(

			function() { this.src = imgsrc_on;

				$(this).parent().parent().css("background", "#fff");

			},

			function() { this.src = imgsrc;

				$(this).parent().parent().css("background", "transparent");

			}

		);

	});

}



//外部リンク

window.onload = function() {

	var node_a = $('a');

	var thisPage = location.href;

	for (var i in node_a) {

		if (node_a[i].className == 'newwin') {

			node_a[i].onclick = function() {

			window.open(this.href, '', '');

			return false;

		};

	}



}

};



//ページスクロール

function pageTopScroll() {

	var scrj = 1;

	var scdist = document.body.parentNode.scrollTop;

	if(scrj<50 && scdist) {

		scdist = (scdist>2) ? Math.ceil(scdist*.2) : 1;

		scrj++;

		scrollBy(0,-scdist);

		setTimeout("pageTopScroll()",20);

	} else {

		scrollTo(0,0);

		scrj = 1;

	}

}



//ページクローズ

function close_win(){

var nvua = navigator.userAgent;

if(nvua.indexOf('MSIE') >= 0){

	if(nvua.indexOf('MSIE 5.0') == -1) {

		top.opener = '';

	}

}

else if(nvua.indexOf('Gecko') >= 0){

	top.name = 'CLOSE_WINDOW';

	wid = window.open('','CLOSE_WINDOW');

}

	top.close();

}




