// Hide MAINBODY
function closemainb() {
	document.getElementById('d1main_body').style.display='none';
	document.getElementById('closebtn').style.display='none';
	document.getElementById('openbtn').style.display='block';
}

function openmainb() {
	document.getElementById('d1main_body').style.display='block';
	document.getElementById('openbtn').style.display='none';
	document.getElementById('closebtn').style.display='block';
}

function closemainb2() {
	document.getElementById('d1main_bodyTop').style.display='none';
	document.getElementById('closebtn').style.display='none';
	document.getElementById('openbtn').style.display='block';
}

function openmainb2() {
	document.getElementById('d1main_bodyTop').style.display='block';
	document.getElementById('openbtn').style.display='none';
	document.getElementById('closebtn').style.display='block';
}





// MAIN LOGO
function d1logos() {
	document.write('<h1 id="d1logo"><a href="\/D1/apr/ap/NList_h.dll/?cgr=GP" title="Top Page"><img class="png_bg" src="\/d1\/images\/toppage\/d1gp_logo.png" alt="D1 GRAND PRIX" \/><\/a><\/h1>');
	document.write('<div id="srsponsor"><a href="http:\/\/www.gran-turismo.com\/" target="_blank"><img class="png_bg" src="\/d1\/images\/toppage\/gt_logo.png" alt="GRAN TOURISMO" \/><\/a><\/div>');
//	document.write('<div id="anv"><iframe src="/frebtn.html" scrolling="no" style="width: 275px; height: 133px;" frameborder="0" allowtransparency="true"></iframe></div>');
}



// SPONSOR BAR
function sponsors_frm() {
	document.write('<div id="sponsor_box" style="width: 1003px; height: 56px;"><iframe src="\/d1\/sponsors\/sponsor_barflashtop.html" name="sponsors_bar" id="sponsors_bar" border="0" frameborder="0" framespacing="0" scrolling="no" allowTransparency="true" style="margin: 0; padding: 0; width: 1003px; height: 56px;"><\/iframe><\/div>');
	document.write('<p style="position:fixed; top: 0; _top: 0; right: 0; z-index: 1000;"><a href="/D1/apr/ap/NList_h.dll/?cgr=SL"><img class="png_bg" src="/images/toppage/gotoSL.png" alt="D1 GRAND PRIX" /></a></p><p style="position:fixed; top: 0; _top: 0; right: 0; z-index: 990; width: 100%; height: 2px; background:url(/images/toppage/gotoSL_head.png); background-repeat: repeat-x;"></p>');
	//document.write('<p style="position:fixed; top: 0; _top: 0; right: 175px; z-index: 900;"><a href="/d1/index_topen.html"><img class="png_bg" src="/d1/images/items/englishbtn2.png" alt="D1 GRAND PRIX" /></a></p><p style="position:fixed; top: 0; _top: 0; right: 0; z-index: 990; width: 100%; height: 2px; background:url(/images/toppage/gotoSL_head.png); background-repeat: repeat-x;"></p>');
}


// PAGE FOOTER
function ___pgfooter() {
	document.write('<div id="d1footer"><p>Copyright 2010 &nbsp;D1 CORPORATION All Rights Reserved.<\/p><\/div>');
}

// PAGE FOOTER
function pgfooter() {
	document.write('<div id="d1footer" class="fltclr"><p class="ft_copy">Copyright 2010 &nbsp;D1 CORPORATION All Rights Reserved.<\/p>');
	document.write('<p class="ft_back"><a class="png_bg" href="#BACK" onclick="history.back();return false" title="BACK">BACK<\/a><\/p>');
	document.write('<p class="ft_home"><a class="png_bg" href="\/d1\/index_top.html" title="HOME">HOME<\/a><\/p><\/div>');
}


function pgfooter_n() {
	document.write('<div id="d1footer" class="fltclr"><p class="ft_copy">');
	document.write('<a href="\/d1\/user\/index.html">D1 ユーザーデスク<\/a>&nbsp;|&nbsp;<a href="\/d1\/aboutD1\/outline.html">株式会社D1コーポレーション<\/a>&nbsp;|&nbsp;&nbsp;');
	document.write('Copyright 2011 &nbsp;D1 CORPORATION All Rights Reserved.<\/p><\/div>');
}



// ROUND BADGE 2
function rndbadge2() {
//	document.write('<div class="d1rd_badge2" style="left:672px;top:40px;"><a href="\/d1\/sl\/sl2011\/sluni\/sluni_index.html" title="D1SL CHAMPION CARNIVAL" ><img class="png_bg" src="\/d1\/sl\/sl2011\/sluni\/sluni_image\/topcatch.png" alt="D1SL" \/><\/a><\/div>');

//	document.write('<div class="d1rd_badge2" style="left:420px; top:30px;"><a href="/d1/gp/gp2011/gp1108/gp1108_index.html" title="Rd.8 FUJI SPEEDWAY" ><img class="png_bg" src="\/d1\/gp\/gp_img\/11series\/11108gp_badge.png" alt="Next Round" style="margin: 5px 0 0 0; vertical-align:top;" \/></a><\/div>');
}

function rndbadge3() {
	document.write('<div class="d1rd_badge2" style="left:265px; top:10px;"><a href="\/d1\/gp\/gp2010\/index.html" title="D1GP" ><img class="png_bg" src="\/d1\/gp\/gp_img\/10series\/10cal_badge_e.png" alt="Next Round" style="margin: 5px 0 0 50px; vertical-align:top;" \/></a><\/div>');
}


// CLOSE MAINBODY
function closebody() {
	document.write('<div class="close_mainbody"><a id="closebtn" href="#" onclick="closemainb();return false;" title="CLOSE">&times;<\/a>');
	document.write('<a id="openbtn" href="#" onclick="openmainb();return false;" title="OPEN" style="display:none;">+<\/a><\/div>');
}

function closebody() {
	document.write('<div class="close_mainbody"><a id="closebtn" href="#" onclick="closemainb2();return false;" title="CLOSE">&times;<\/a>');
	document.write('<a id="openbtn" href="#" onclick="openmainb2();return false;" title="OPEN" style="display:none;">+<\/a><\/div>');
}

function d1footNavi1() {
	document.write('<ul class="d1footNavi Ftext fltclr"><li class="Fmenu"><li class="Fmenu"><a href="/press/index_gp_release.html">プレス</a> |&nbsp;</li><li class="Fmenu"><a href="/d1/entrant/2012entry/license.html">エントラント</a> |&nbsp;</li><li class="Fmenu"><a href="/D1/apr/ap/NList_h.dll/?cgr=SL">D1 STREET LEGAL</a> |&nbsp;</li><li class="Fmenu"><a href="/d1/aboutD1/world_drift.html">WORLD DRIFT</a> |&nbsp;</li><li class="Fmenu"><a href="/d1/aboutD1/">D1 GRAND PRIXとは?</a> |&nbsp;</li><li class="Fmenu"><a href="/d1/gp/gp2011/index.html">開催スケジュール</a> |&nbsp;</li><li class="Fmenu"><a href="#">TOP</a> |&nbsp;</li><!-- li class="Fmenu"><a href="/ticket/index.html">チケット購入 </a>|&nbsp;</li --></ul>');
}

function d1footNavi2() {
	//document.write('<ul class="d1footNavi Ftext fltclr"><li class="Fmenu"><a href="http://www.totalsportsasia.com/jpn/" target="_blank">競技映像の海外販売</a> |&nbsp;</li><li class="Fmenu"><a href="/press/index_gp_release.html">プレス</a> |&nbsp;</li><li class="Fmenu"><a href="/d1/entrant/2011entry/2011d1_license.html">エントラント</a> |&nbsp;</li><li class="Fmenu"><a href="/D1/apr/ap/NList_h.dll/?cgr=SL">D1 STREET LEGAL</a> |&nbsp;</li></ul>');
}




// SSL Check
function chkssl() {
	if (window.location.host=="www.d1gp.co.jp" && document.location.protocol==="http:") {
		location.replace('https://'+window.location.host+window.location.pathname);
	}
}


// SSL off
function offssl() {
	if (document.location.protocol==="https:") {
		location.replace('http://'+window.location.host+window.location.pathname);
	}
}



//iPad

    //< ![CDATA[
      vborder("/global/iphone.css","/global/iphone.css","/global/iphone.css.css");
    //]]>
	
	function vborder(){
  window.iPad = /iPad/.test(navigator.userAgent);
  if(iPad){
    var args = arguments,
    d = document,
    head = d.getElementsByTagName('head'),
    linktag = function(h,m){
      var tag = d.createElement("link");
      tag.href = h;
      tag.media = m;
      tag.type = "text/css";
      tag.rel = "stylesheet";
      return tag;
    };
    if(args[0]) head.item(0).appendChild(linktag(args[0],"only screen and (max-device-width: 1024px)"));
    if(args[1]) head.item(0).appendChild(linktag(args[1],"all and (orientation:landscape)"));
    if(args[2]) head.item(0).appendChild(linktag(args[2],"all and (orientation:portrait)"));
  }
};




// Thanks to BraveNewCode's WPtouch iPhone Theme for the UA list.
// (http://wordpress.org/extend/plugins/wptouch/)
function is_mobile () {
  var useragents = [
    'iPhone',         // Apple iPhone
    'iPod',           // Apple iPod touch
    'Android',        // 1.5+ Android
    'dream',          // Pre 1.5 Android
    'CUPCAKE',        // 1.5+ Android
    'blackberry9500', // Storm
    'blackberry9530', // Storm
    'blackberry9520', // Storm v2
    'blackberry9550', // Storm v2
    'blackberry9800', // Torch
    'webOS',          // Palm Pre Experimental
    'incognito',      // Other iPhone browser
    'webmate'         // Other iPhone browser
  ];
  var pattern = new RegExp(useragents.join('|'), 'i');
  return pattern.test(navigator.userAgent);
}
if (is_mobile()) {
  var link = document.createElement('link');
  link.rel = 'stylesheet';
  link.type = 'text/css';
  link.href = '/global/iphone.css';
  document.getElementsByTagName('head')[0].appendChild(link);
}






