var flashDir = "skins/banks/flash/";
var imageDir = "skins/banks/images/";
var h=200;
var w=200;
var vFlashVersion = fGetFlashVersion();

if(document.location.search.indexOf("flash=no")>-1)
	vFlashVersion = 0;

function fWriteBanner(flashFile, imageFile, height, width) {
	height = (height) ? (height) : (h);
	width  = (width) ? (width) : (w);
	if (vFlashVersion>=5) {
		fWriteSWF(flashFile, height, width);
	} else {
		fWriteIMG(imageFile, height, width); 
	}
}

function fWriteSWF(flashFile, height, width) {
	var txt = "";
	txt += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'" ';
	txt += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">';
	txt += '<param name="movie" value="'+flashDir+flashFile+'" />';
	txt += '<param name="quality" value="high" />';
	txt += '<param name="menu" value="false" />';
 	txt += '<param name="bgcolor" value="#FFFFFF" />';
	txt	+= '<embed src="'+flashDir+flashFile+'" quality="high" ';
	txt += 'pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>';
	txt += '</object>';
	document.write(txt);
}

function fGetFlashVersion(){var latestV=8;flVersion=0;var agent=navigator.userAgent.toLowerCase();if(agent.indexOf("mozilla/3")!=-1&&agent.indexOf("msie")==-1){flVersion=0;}if(navigator.plugins!=null&&navigator.plugins.length>0){var flashPlugin=navigator.plugins['Shockwave Flash'];if(typeof flashPlugin=='object'){for(var i=latestV;i>=3;i--){if(flashPlugin.description.indexOf(i+'.')!=-1){flVersion=i;break;}}}}else if(agent.indexOf("msie")!=-1&&parseInt(navigator.appVersion)>=4&&agent.indexOf("win")!=-1&&agent.indexOf("16bit")==-1){var doc='<scr'+'ipt language="VBScript"\> \n';doc+='On Error Resume Next \n';doc+='Dim obFlash \n';doc+='For i = '+latestV+' To 3 Step -1 \n';doc+='   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';doc+='   If IsObject(obFlash) Then \n';doc+='      flVersion = i \n';doc+='      Exit For \n';doc+='   End If \n';doc+='Next \n';doc+='</scr'+'ipt\> \n';document.write(doc);}else if(agent.indexOf("webtv/2.5")!=-1)flVersion=3;else if(agent.indexOf("webtv")!=-1)flVersion=2;else{flVersion=-1;}return flVersion;}

function fWriteIMG(imageFile, height, width){
	document.write('<img src="'+imageDir+imageFile+'" border="0" alt="" height="'+height+'" width="'+width+'" />');
}