//======================================================================
//Mac_NN6.xのCSS対処用パッチ
//======================================================================
function fontPatch() {
	sSheet = document.stylesheets(document.stylesheets.length-1);
	if (document.defaultView.getComputedStyle(document.body,'"').getPropertyValue("font-size") == "14px") {
	sSheet.insertRule("body {font-size:16px}" .sSheet.cssRules,length);
	}
}
if (document.defaultView && document.styleSheets)window.onload = fontPatch;


//======================================================================
//NN4.5のCSS対処用
//======================================================================
function fontPatch() {
	sSheet = document.stylesheets(document.stylesheets.length-1);
	if (document.defaultView.getComputedStyle(document.body,'"').getPropertyValue("font-size") == "14px") {
	sSheet.insertRule("body {font-size:16px}" .sSheet.cssRules,length);
	}
}
if (document.defaultView && document.styleSheets)window.onload = fontPatch;

//======================================================================
//ロールオーバー（プリロード）
//======================================================================

var menu = Array(9);

function loadImage() {
// top以外のg_naviボタン画像プリロード

	var srcs = new Array("g_navi_about","g_navi_performance_bscs","g_navi_home","g_navi_performance_tvtokyo","g_navi_performance_video","g_navi_about_map","g_navi_performance","g_navi_about_profile","g_navi_program","g_navi_performance_stage","g_navi_employment");
	preloadimg("img/",srcs);
	doflag = true;
	
	// 以下、古いの 
	/*
	for (var i=0; i < 10 ; i++) {
		menu[i] = new Image();
	}

	menu[0].src = "img/navi/bu_company_outline_r.gif";
	menu[1].src = "img/navi/bu_company_map_r.gif";
	menu[2].src = "img/navi/bu_product_tokyo_r.gif";
	menu[3].src = "img/navi/bu_product_bs_r.gif";
	menu[4].src = "img/navi/bu_product_butai_r.gif";
	menu[5].src = "img/navi/bu_product_video_r.gif";
	menu[6].src = "img/navi/bu_program_bangumi_r.gif";
	menu[7].src = "img/navi/bu_jinzai_voice_r.gif";
	menu[8].src = "img/navi/bu_jinzai_saiyou_r.gif";
	menu[9].src = "img/navi/bu_program_prizes_r.gif";
	*/
}

//======================================================================
//Window Open
//======================================================================

function opWin(url,name,width,height){
	newWin = window.open(url,name,"width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes");
	newWin.focus();
}


//======================================================================
//ロールオーバーもろもろ（by sasayaki)
//======================================================================

///// init /////
lastimgname = "";
doflag = false;


///// プリロード /////
function preloadimg(pDir, pArray) {
	fileDir = pDir;
//	preloadcl = new Array();
	preloadhi = new Array();
	var maxnum = pArray.length -1;
	for (i=0; i <= maxnum; i++) {
//		preloadcl[i] = new Image();
//		preloadcl[i].src=(fileDir + pArray[i] + "_cl.gif");
		preloadhi[i] = new Image();
		preloadhi[i].src=(fileDir + pArray[i] + "_hi.gif");
	}
}


///// フラグセット /////
function doflagSet(pState){
	if (doflag != pState) {
		doflag = pState;
		lastimgnamesrc = "";
	}
}


///// mouseOver function /////
function mov(pName,pNameSub) {if (doflag) {
		filename = pName;
		if ("" + pNameSub != "undefined") {lastimgname = eval('document.' + pNameSub)}
		else {lastimgname = eval('document.' + filename)}
		lastimgnamesrc = lastimgname.src;
		theDir = lastimgnamesrc.substring(0, lastimgnamesrc.lastIndexOf("/") +1);
		//alert(theDir);
		lastimgname.src=(theDir + filename + "_hi.gif");
}}


///// mouseDown function /////
function mdo() {if (doflag) {
//		lastimgname.src=(fileDir + filename + "_cl.gif");
}}


///// mouseUp function /////
function mup() {if (doflag) {
		lastimgname.src=lastimgnamesrc;
}}


///// mouseOut function /////
function mou() {if (doflag) {
		if(lastimgnamesrc != "") {lastimgname.src = lastimgnamesrc};
}}


//======================================================================
// お問い合わせwindow open
//======================================================================

function openContact() {
	protx_contact = window.open("contact.html",'protx_contact','height=260,width=460,status=no,resizable=no,scrollbars=no');
	if (parseInt(navigator.appVersion.charAt(0)) > 3) {
		protx_contact.focus();protx_contact.focus();protx_contact.focus();protx_contact.focus();protx_contact.focus();
	}
}



