//sd attachBanner Script
var link_url = "http://slamdunk-sc.shueisha.co.jp/"
var mydomain = "http://slamdunk-sc.shueisha.co.jp/banner/";
var swf_url= mydomain+"north.swf";
var banner_url= mydomain+"north.jpg"; 

//タテヨコのサイズ
var w=468;
var h=60;


var body = document['CSS1Compat' == document.compatMode ? 'documentElement' : 'body'];

//Distinguish Browsers 
var isOpera;
var uAgent  = navigator.userAgent.toUpperCase();
var isMac	= ( (uAgent.indexOf("MAC") >= 0) ? true : false ) ;
var isWin	= ( (uAgent.indexOf("WIN") >= 0) ? true : false ) ;
var isUnix	= ( (uAgent.indexOf("X11") >= 0) ? true : false ) ;
var isNav	= ( document.layers ? true : false ) ;
var isIE	= ( document.all ? true : false ) ;
var isGecko	= ( document.getElementById ? true : false ) ;
if ( uAgent.indexOf("OPERA") >= 0 ) {
	var isOpera = true ;
	isIE = false ;
	isOpera = true;
}
var isIE5;
var isIE4;
if (isIE) {
	var escapeVer = 0;
	var version = "";
	var s = 0;
	var e = 0;
	var appVer  = navigator.userAgent;
	s = appVer.indexOf("MSIE ",0) + 5;
	e = appVer.indexOf(";",s);
	brVer = appVer.substring(s,e);
	if (4.0 <= brVer) {
		isIE4 = true;
	} else {
		isIE5 = false;
	}
	if (5.0 <= brVer) {
		isIE5 = true;
	} else {
		isIE5 = false;
	}
}



//Distinguish Flash Plugin
var MM_contentVersion = 8;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}






function writeBanner(){
	var bActive=false;
	if(MM_FlashCanPlay){
		bActive=true;
		var tags = '<object id="normal" width="'+w+'" height="'+h+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+"<param name='allowScriptAccess' value='always' />"
		+'<param name="movie" value="'+ swf_url + '" /><param name="menu" value="false" /><param name="quality" value="best" />'
		+'<param name="scale" value="noscale" /><param name="salign" value="lt" /><param name="wmode" value="opaque" />'
		+'<embed src="' + swf_url+ '" quality=best pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" allowScriptAccess="always" wmode="opaque" ><\/embed><\/object>';
		document.writeln(tags);
	}else{
		bActive=false;
		document.write("<a href='http://slamdunk-sc.shueisha.co.jp/' target='aba'><img src='" + banner_url + "' border='0'></a>");
	}
	//alert("bActive:"+bActive);
}



//window resize
function position(which){
	if(bActive){
		var w=document.body.clientWidth;
		var h=document.body.clientHeight;
		if(which=="all"){
			document.all.floatLayer.style.width=w;
			document.all.floatLayer.style.height=h;
		}else if(which=="w"){
			return w;
		}else if(which=="h"){
			return h;
		}else if(which=="x"){
			return (w-130);
		}
	}
}



//window.onresize=position("all");
writeBanner();

