/* PreLoad
------------------------------------------------*/
if (window.addEventListener) {  /* Firefox,Safari,Opera */  
    window.addEventListener("load", preLoad, false);  
   }   
 else if (window.attachEvent) {  /* IE4, IE5, IE6, IE7 */  
     window.attachEvent("onload", preLoad);  
   }      
 else if (document.getElementById || document.all) { /* その他DOM準拠 */  
     window.onload = preLoad;  
   }  

function preLoad() {
	//読み込む画像を記入
	var imglist = [
	"images/faq_menu_ad_on.gif",
	"images/faq_menu_cm_on.gif",
	"images/faq_menu_eisei_on.gif",
	"images/faq_menu_radio_on.gif",
	"images/faq_menu_shinbun_on.gif",
	"images/faq_menu_zasshi_on.gif"
	];
	preImage = new Array();

	for (i=0; i<imglist.length; i++) {
	  preImage[i] = new Image();
	  preImage[i].src = imglist[i];
	}
}

/* Navigation
------------------------------------------------*/
function nav(n){
	var m_flg = false;
	var url = window.location.href;
	var pos = url.indexOf("_m");
	var pos2 = url.indexOf("?");

	var tag1;
	var tag2;
	var tag3;
	var tag4;
	var tag5;
	var tag6;
	
	if((pos !== -1)){
		var query = url.substr(pos+1,1);
		if(query =="m"){
			m_flg = true;
		}
	}
	if((pos2 !== -1)){
		var query = url.substring(pos2 + 1);
		if(query =="m"){
			m_flg = true;
		}
	}
	
//全てマウスオーバーできる状態で書き出し
	if(m_flg){
		tag1 = '<a href="f100_m.html"onmouseover="button1.src=\'images/faq_menu_ad_on.gif\';" onmouseout="button1.src=\'images/faq_menu_ad.gif\';"><img name="button1" src="images/faq_menu_ad.gif" width="135" height="29" border="0" alt="ADGOGO全般"></a>';
		tag2 = '<a href="f200_m.html"onmouseover="button2.src=\'images/faq_menu_cm_on.gif\';" onmouseout="button2.src=\'images/faq_menu_cm.gif\';"><img name="button2" src="images/faq_menu_cm.gif" width="135" height="29" border="0" alt="CMGOGO"></a>';
		tag3 = '<a href="f300_m.html"onmouseover="button3.src=\'images/faq_menu_eisei_on.gif\';" onmouseout="button3.src=\'images/faq_menu_eisei.gif\';"><img name="button3" src="images/faq_menu_eisei.gif" width="135" height="29" border="0" alt="衛星CMGOGO"></a>';
		tag4 = '<a href="f400_m.html"onmouseover="button4.src=\'images/faq_menu_radio_on.gif\';" onmouseout="button4.src=\'images/faq_menu_radio.gif\';"><img name="button4" src="images/faq_menu_radio.gif" width="135" height="29" border="0" alt="ラジオCMGOGO"></a>';
		tag5 = '<a href="f600_m.html"onmouseover="button5.src=\'images/faq_menu_shinbun_on.gif\';" onmouseout="button5.src=\'images/faq_menu_shinbun.gif\';"><img name="button5" src="images/faq_menu_shinbun.gif" width="135" height="29" border="0" alt="新聞ADGOGO"></a>';
		tag6 = '<a href="f500_m.html"onmouseover="button6.src=\'images/faq_menu_zasshi_on.gif\';" onmouseout="button6.src=\'images/faq_menu_zasshi.gif\';"><img name="button6" src="images/faq_menu_zasshi.gif" width="138" height="29" border="0" alt="雑誌ADGOGO"></a>';
	}else{
		tag1 = '<a href="f100.html"onmouseover="button1.src=\'images/faq_menu_ad_on.gif\';" onmouseout="button1.src=\'images/faq_menu_ad.gif\';"><img name="button1" src="images/faq_menu_ad.gif" width="135" height="29" border="0" alt="ADGOGO全般"></a>';
		tag2 = '<a href="f200.html"onmouseover="button2.src=\'images/faq_menu_cm_on.gif\';" onmouseout="button2.src=\'images/faq_menu_cm.gif\';"><img name="button2" src="images/faq_menu_cm.gif" width="135" height="29" border="0" alt="CMGOGO"></a>';
		tag3 = '<a href="f300.html"onmouseover="button3.src=\'images/faq_menu_eisei_on.gif\';" onmouseout="button3.src=\'images/faq_menu_eisei.gif\';"><img name="button3" src="images/faq_menu_eisei.gif" width="135" height="29" border="0" alt="衛星CMGOGO"></a>';
		tag4 = '<a href="f400.html"onmouseover="button4.src=\'images/faq_menu_radio_on.gif\';" onmouseout="button4.src=\'images/faq_menu_radio.gif\';"><img name="button4" src="images/faq_menu_radio.gif" width="135" height="29" border="0" alt="ラジオCMGOGO"></a>'
		tag5 = '<a href="f600.html"onmouseover="button5.src=\'images/faq_menu_shinbun_on.gif\';" onmouseout="button5.src=\'images/faq_menu_shinbun.gif\';"><img name="button5" src="images/faq_menu_shinbun.gif" width="135" height="29" border="0" alt="新聞ADGOGO"></a>'
		tag6 = '<a href="f500.html"onmouseover="button6.src=\'images/faq_menu_zasshi_on.gif\';" onmouseout="button6.src=\'images/faq_menu_zasshi.gif\';"><img name="button6" src="images/faq_menu_zasshi.gif" width="138" height="29" border="0" alt="雑誌ADGOGO"></a>'
	}

//アクティブ化
	if(n==1){
		tag1 ='<img src="images/faq_menu_ad_on.gif" width="135" height="29" border="0" alt="ADGOGO全般">';
	}else if(n==2){
		tag2 ='<img src="images/faq_menu_cm_on.gif" width="135" height="29" border="0" alt="CMGOGO">';
	}else if(n==3){
		tag3 ='<img src="images/faq_menu_eisei_on.gif" width="135" height="29" border="0" alt="衛星CMGOGO">';
	}else if(n==4){
		tag4 ='<img src="images/faq_menu_radio_on.gif" width="135" height="29" border="0" alt="ラジオCMGOGO">';
	}else if(n==6){
		tag5 ='<img src="images/faq_menu_shinbun_on.gif" width="135" height="29" border="0" alt="新聞ADGOGO">';
	}else if(n==5){
		tag6 ='<img name="button6" src="images/faq_menu_zasshi_on.gif" width="138" height="29" border="0" alt="雑誌ADGOGO">';
	}

	tag =  '<table width="823" border="0" cellpadding="0" cellspacing="0">';
	tag += '<tr>';
	tag += '<td>'+tag1+'</td>';
	tag += '<td><img src="images/spacer.gif" alt="" width="2" height="1"></td>';
	tag += '<td>'+tag2+'</td>';
	tag += '<td><img src="images/spacer.gif" alt="" width="2" height="1"></td>';
	tag += '<td>'+tag3+'</td>';
	tag += '<td><img src="images/spacer.gif" alt="" width="2" height="1"></td>';
	tag += '<td>'+tag4+'</td>';
	tag += '<td><img src="images/spacer.gif" alt="" width="2" height="1"></td>';
	tag += '<td>'+tag5+'</td>';
	tag += '<td><img src="images/spacer.gif" alt="" width="2" height="1"></td>';
	tag += '<td>'+tag6+'</td>';
	tag += '</tr>';
	tag += '</table>';
	
document.write(tag);
}


