//ブックマークに追加
function Fav(){document.write('<ul class="navi_common clearfix">');if(document.uniqueID){document.write('<li class="first"><a href="javascript:void(0);" onclick="window.external.AddFavorite(\'http://www.mapion.co.jp\', \'Mapion [情報地図サイト マピオン]\'); return false;">ブックマークに追加</a></li>');}document.write('<li><a href="http://help.mapion.co.jp/">ヘルプ</a></li>');document.write('<li class="last"><a href="/QA/sitemap/sitemap.html">サイトマップ</a></li>');document.write('</ul>');}

//ログ取得
var _ANALYTICS_ROOT = '/img/log';
function analytics(path){
if(path.charAt(0)!="/")path="/"+path;
var img = new Image(1,1);
var d = new Date();
img.onload=function(){delete d;delete img;}
img.src = _ANALYTICS_ROOT+path+"?"+d.getTime();
}

//テキスト広告

function adsTxt(ReplaceL,ReplaceR,elemL,elemR){
if(document.getElementById(ReplaceL) && document.getElementById(ReplaceR) && document.getElementById(elemL) && document.getElementById(elemR)){
var ReplaceL = document.getElementById(ReplaceL);
var ReplaceR = document.getElementById(ReplaceR);
var elemL = document.getElementById(elemL);
var elemR = document.getElementById(elemR);
elemL.parentNode.replaceChild(ReplaceL,elemL);
elemR.parentNode.replaceChild(ReplaceR,elemR);
}
}

function adsTxtL(){
document.write("<scr" + "ipt type='text/javascript'>");
document.write("var amp_med = '123';");
document.write("var amp_site = '364';");
document.write("var amp_frame = '11629';");
document.write("var amp_iframe = '0';");
document.write("var amp_type = '1';");
document.write("var amp_text = '000000';");
document.write("var amp_rurl = document.referrer;");
document.write("var amp_send = location.protocol + '//ads.adjust-net.jp/adserver/ad/ads.js';");
document.write("</scr" + "ipt>");
document.write("<scr" + "ipt language='javascript' src='" + amp_send + "'></scr" + "ipt>");
}
function adsTxtR(){
var impAcn = "IMPASEG";
var impAco = document.cookie;
var impApos = impAco.indexOf(impAcn+"=");
var impAseg = (impApos!=-1)?impAco.substring(impApos+impAcn.length+1,(impAco.indexOf("; ",impApos)!=-1)?impAco.indexOf("; ",impApos):impAco.length):null;
impAseg = (impAseg)?unescape(impAseg):null;

impAserver = "http://as.dc.impact-ad.jp";
impAtag = "/SITE=MP.MAPION.DAC/AREA=TEXT/AAMSZ=340X20/CL=TEXT/OENCJP=UTF8";
impAtarget = (impAseg)?impAtag+"/"+impAseg:impAtag;

impArnd = Math.round(Math.random() * 100000000);
if (!impApid) var impApid = Math.round(Math.random() * 100000000);
document.write('<scr');
document.write('ipt src="' + impAserver + '/jserver/acc_random=' + impArnd + impAtarget + '/pageid=' + impApid + '">');
document.write('</scr');
document.write('ipt>');
}

//季節特集
function special_pickup(){
//html上ののid取得
var recommend_random = document.getElementById("recommend_random");
var recommend_random_dt = document.getElementById("recommend_random_dt");
var recommend_random_dd = document.getElementById("recommend_random_dd");

var recommend_url = new Array();
var recommend_src = new Array();
var recommend_txt = new Array();
var recommend_alt = new Array();

recommend_url[0] = 'http://beauty.mapion.co.jp/';
recommend_src[0] = '/mt-img/beauty_435x100.jpg';
recommend_txt[0] = '美容院やネイルサロン、リラクサロンの検索は<a href="http://beauty.mapion.co.jp/">マピオンビューティー</a>。';
recommend_alt[0] = 'あなたにぴったりのビューティーサロンが見つかる！';

recommend_url[1] = 'http://coupon.mapion.co.jp/';
recommend_src[1] = 'http://www.mapion.co.jp/mt-img/coupon_435x100.gif';
recommend_txt[1] = 'グルメ・エステ・温泉も50%OFF～！<a href="http://coupon.mapion.co.jp/">マピオンクーポン</a>でお得なクーポンをゲット！';
recommend_alt[1] = 'マピオンクーポン50%OFF お得なクーポンをゲット！';

recommend_url[2] = 'http://special.mapion.co.jp/hanabi0807/';
recommend_src[2] = 'http://www.mapion.co.jp/mt-img/special_435x100.jpg';
recommend_txt[2] = '<a href="http://special.mapion.co.jp/hanabi0807/">マピオン花火特集2011 全国の花火大会情報を紹介</a>';
recommend_alt[2] = 'マピオン花火特集2011 全国の花火大会情報を紹介';

var i= Math.floor(Math.random( ) * recommend_url.length) ;

//html上に書き出す内容
var specialBig = '';
specialBig += '<a href="' + recommend_url[i] + '">';
specialBig += '<img src="' + recommend_src[i] + '" alt="' + recommend_alt[i] + '" />';
specialBig += '</a>';
specialBig += '<p style="margin:5px 0 0;">' + recommend_txt[i] + '</p>';
document.write(specialBig);
}

//プレゼント
function present(){
//html上ののid取得
var present_random = document.getElementById("SecPresent").getElementsByTagName("dd")[0];
var present_random_dt = present_random.getElementsByTagName("dt")[0];
var present_random_dd = present_random.getElementsByTagName("dd")[0];
var present_random_div = present_random.getElementsByTagName("div")[0];

var present_url = new Array();
var present_src = new Array();
var present_title = new Array();
var present_txt = new Array();


present_url[0] = "http://yorukoyoruta.jp/present/?banner_id=mp_top_present";
present_src[0] = "mt-img/mp_top.jpg";
present_title[0] = "子どもと一緒に遊べる絵本プレゼント！";
present_txt[0] = "うれしい顔、笑った顔、いろ～んな顔を作って・遊んで・笑える「かおノート」。";

var i= Math.floor(Math.random( ) * present_url.length);

//html上に書き出す内容
var presentTxt = '';
presentTxt += '<dl>';
presentTxt += '<dt>';
presentTxt += '<a href="' + present_url[i] + '" target="yoruko">' + present_title[i] + '</a>';
presentTxt += '</dt>';
presentTxt += '<dd>' + present_txt[i] + '</dd>';
presentTxt += '</dl>';
presentTxt += '<div class="thum">';
presentTxt += '<a href="' + present_url[i] + '" target="yoruko">';
presentTxt += '<img src="' + present_src[i] + '" alt="' + present_title[i] + '" />';
presentTxt += '</a>';
presentTxt += '</div>';
document.write(presentTxt);
}

//Flash（地図からさがす）
function createSWF_map(){
var flash_varsion = FlashPlayerVer();
if(flash_varsion != 0){
document.write('<div id="FlashMap" class="clearfix">');
document.write('<div id="FlashMapTitle">地図から探す</div>');
document.write('<div id="FlashMapConts">');
//IEの場合
if(document.uniqueID){
document.write('<embed type="application/x-shockwave-flash" src="/fla/mapionflash950px.swf?20101227" width="455" height="246" quality="high" wmode="transparent" allowScriptAccess="always" flashvars="ad_link=/topics/3dmaps/&ad_img=http://www.mapion.co.jp/badge/map/MAPM101102_map3d.gif"></embed>');
}
//IE以外の場合
else{
document.write('<object type="application/x-shockwave-flash" data="/fla/mapionflash950px.swf?20101227" width="455" height="246">');
document.write('<param name="movie" value="/fla/mapionflash950px.swf?20101227" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="allowScriptAccess" value="always" />');
document.write('<param name="flashvars" value="ad_link=/topics/3dmaps/&ad_img=http://www.mapion.co.jp/badge/map/MAPM101102_map3d.gif" />');
document.write('</object>');
}
document.write('</div>');
document.write('</div>');
}
//flash playerがインストールされていない場合、もしくはversionが満たない場合(noscriptと同内容)
else{
var kenName = new Array("北海道","青森県","岩手県","宮城県","秋田県","山形県","福島県","茨城県","栃木県","群馬県","埼玉県","千葉県","東京都","神奈川県","新潟県","富山県","石川県","福井県","山梨県","長野県","岐阜県","静岡県","愛知県","三重県","滋賀県","京都府","大阪府","兵庫県","奈良県","和歌山県","鳥取県","島根県","岡山県","広島県","山口県","徳島県","香川県","愛媛県","高知県","福岡県","佐賀県","長崎県","熊本県","大分県","宮崎県","鹿児島県","沖縄県");
var noFlashTxt = '';
noFlashTxt += '<div id="NoFlashMap">';
noFlashTxt += '<dl>';
noFlashTxt += '<dt>日本地図から探す</dt>';
noFlashTxt += '<dd>都道府県名をクリックしてください。</dd>';
noFlashTxt += '</dl>';
noFlashTxt += '<ul>';
for(var i=1; i<=47; i++){
if(i<10){var num = "0" + i;}else{var num = i;}
noFlashTxt += '<li class="map' + num + '"><a href="http://www.mapion.co.jp/map/admi' + num + '.html">' + kenName[i-1] + '</a></li>';
}
noFlashTxt += '</ul>';
noFlashTxt += '</div>';
document.write(noFlashTxt);
}
}

//レクタングルバナー
function expandOn(){document.getElementsByTagName("body")[0].className = "AdsExpand";}
function expandOff(){elem_body = document.getElementsByTagName("body")[0];elem_body.className = "";elem_body.removeAttribute("class");}
function ads_rectangle(){




var type = "nothing";

var rectangle_path = "";
var rectangle_noflash = "";
var badge_check = "なし";
if(badge_check == "あり"){var rectangle_url = "http://www.mapion.co.jp/badge/top100913.html";}else{var rectangle_url = "";}

if(type == "flash"){
var flash_varsion = FlashPlayerVer();
if(flash_varsion != 0){
//IEの場合
if(document.uniqueID){
document.write('<embed type="application/x-shockwave-flash" src="' + rectangle_path +'" width="300" height="250" quality="high" wmode="transparent"></embed>');
}
//IE以外の場合
else{
document.write('<object type="application/x-shockwave-flash" data="' + rectangle_path +'" width="300" height="250">');
document.write('<param name="movie" value="' + rectangle_path +'" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="wmode" value="transparent" />');
document.write('</object>');
}
}
//flash playerがインストールされていない場合、もしくはversionが満たない場合(noscriptと同内容)
else{
if(rectangle_noflash != ""){
document.write('<a href="' + rectangle_url + '" target="_blank">');
document.write('<img src="' + rectangle_noflash + '" alt="" />');
document.write('</a>');
}
}
}
if(type == "flashExpand"){
var IECheck = /*@cc_on!@*/false;
var flash_varsion = FlashPlayerVer();
if(flash_varsion != 0){
//IEの場合
if(IECheck){
document.write('<div onmouseover="expandOn();" onmouseout="expandOff();">');
document.write('<embed type="application/x-shockwave-flash" src="' + rectangle_path +'" width="869" height="250" quality="high" wmode="transparent"></embed>');
document.write('</div>');
}
//IE以外の場合
else{
document.write('<div onmouseover="expandOn();" onmouseout="expandOff();">');
document.write('<a href="' + rectangle_url +'" target="_blank">');
document.write('<img src="' + rectangle_noflash + '" alt="" />');
document.write('</a>');
document.write('</div>');
}
}
//flash playerがインストールされていない場合、もしくはversionが満たない場合)
else{
if(rectangle_noflash != ""){
document.write('<a href="' + rectangle_url + '" target="_blank">');
document.write('<img src="' + rectangle_noflash + '" alt="" />');
document.write('</a>');
}
}
}
if(type == "img"){
document.write('<a href="' + rectangle_url +'" target="_blank">');
document.write('<img src="' + rectangle_path + '" alt="" />');
document.write('</a>');
}
if(type == "default"){
var yj_sid="784201715"
var yj_loc="APREC"
var random=new Date();
var yj_st=""
var yj_prp="jp_adn_mpo"
var yj_sig="cb04cb13c958b4bf35f6d6421034b1abb7755684"
var yj_dom="mapion.co.jp"
var yj_ads="http://yeas.yahoo.co.jp"
var yj_src=yj_ads+'/n?f='+yj_sid+'&p='+yj_prp+'&l='+yj_loc+'&c=r'+'&domain='+yj_dom+'&sig='+yj_sig+'&st='+yj_st+'&jcode=u&rnd='+random.getTime();
document.write('<sc'+'ript language="JavaScript" type="text/javascript" src="'+yj_src+'">');
document.write('</sc'+'ript>');
}
}

//Flash有無、バージョンチェック
function FlashPlayerVer(){
//初期設定
var flashplayer_ver = 0;
//IE以外の場合
if(navigator.plugins && navigator.mimeTypes['application/x-shockwave-flash']){var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;if(plugin){flashplayer_ver = parseInt(plugin.description.match(/\d+\.\d+/));}}
//IEの場合、もしくはFlash Playerがインストールされていない場合
else{try{var flashOCX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").match(/([0-9]+)/);if(flashOCX){flashplayer_ver = parseInt(flashOCX[0]);}}catch(e){}}
//Flash Playerがインストールされていない、もしくはバージョンが6以下の場合
if(flashplayer_ver <= 6){flashplayer_ver = 0;}
return flashplayer_ver;
}





