var swfWallLocal = '';
var swfWallVars = '';
function swAddEvent(obj, evn, fn){
	if (obj.attachEvent) {
		obj["swfWall" + evn] = fn;
		obj.attachEvent('on' + evn, function(){obj["swfWall" + evn](window.event);});
	}
	else {
		if(obj.addEventListener) obj.addEventListener(evn, fn, false);
	}
}
var swPoll = {
	Interval: 150,
	toWidth: 0,
	toHeight: 0,
	Inter: 0,
	LastWidth:'',
	LastHeight:'',
	Poll: function(){
		var e = document.getElementById("swfWall");
		var f = document.getElementsByTagName("HTML");
		if(f && e){
			//clearInterval(this.Inter);
			//if(f[0].clientHeight > (f[0].offsetHeight)) 
			 	this.toHeight = (f[0].clientHeight);
			//else 
			// 	this.toHeight = (f[0].offsetHeight);
			//if((f[0].clientWidth) > f[0].offsetWidth)
				this.toWidth = (f[0].clientWidth);
			//else 
			// 	this.toWidth = (f[0].offsetWidth-1);
			this.LastWidth = this.toWidth + "px";
			e.style.width = this.LastWidth;
			this.LastHeight = this.toHeight + "px";
			e.style.height = this.LastHeight;
		}
	},
	Run: function(){
		this.Inter = setInterval(function(){swPoll.Poll();},this.Interval);
	}
}
//swAddEvent(window, 'load', 
function swRun(){
	var Continue=false;
	if (navigator.appVersion.indexOf("Win")!=-1) Continue=true;
	if (navigator.appVersion.indexOf("Mac")!=-1) Continue=true;
	if (navigator.appVersion.indexOf("X11")!=-1) Continue=false; //Unix won't work
	if (navigator.appVersion.indexOf("Linux")!=-1) Continue=false; //Linux won't work
	if(!Continue /*|| swfIsIE()*/){
		return;//Dont run unless windows of mac
	}
	if(typeof swfWallLocal == 'string' && swfWallLocal != ''){
		document.write('<div id="swfWall">' +//9.0.115
							'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"' +
							'	width="100%" ' +
							'	height="100%" ' +
							'	id="swfWall" ' +
							'	align="middle">' +
							'<param name="allowScriptAccess" value="sameDomain" />' +
							'<param name="movie" value="'+swfWallLocal+'" />' +
							'<param name="quality" value="high" />' +
							'<param name="bgcolor" value="#ffffff" />' +
							'<param name="wmode" value="transparent">' +
							'<param name="flashvars" value="'+swfWallVars+'">' +
							'<param name="scale" value="noscale" />' +
							'<embed src="'+swfWallLocal+'" ' +
							'	quality="high" ' +
							'	bgcolor="#ffffff" ' +
							'	flashvars="'+swfWallVars+'"' +
							'	wmode="transparent"' +
							'	width="100%" ' +
							'	scale="noscale" ' +
							'	height="100%" ' +
							'	name="swfWall" ' +
							'	align="middle" ' +
							'	allowScriptAccess="sameDomain" ' +
							'	type="application/x-shockwave-flash" ' +
							'	pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
							'</object></div>' +
							'<style type="text/css">' +
							'div#swfWall{position:fixed; z-index: 1;top:0px; left:1px; display:block;}' +
							'*html div#swfWall{display:none;}' +
							'</style>' +
							'<style type="text/css" media="print">' +
							'div#swfWall{position:fixed; z-index: 1;top:0px; left:1px; display:none;}' +
							'*html div#swfWall{display:none;}' +
							'</style>');
			swPoll.Run();	
			//swAddEvent(window, 'resize', function(){swPoll.Poll();});	
		
	}
}
//);
function swfWall(swf,flashvars){
	if(typeof swf == 'string' && swf != ''){
		swfWallLocal = swf;
		swfWallVars = flashvars;
		swRun();
	}
}

function swfIsIE() {
    var ua = navigator.userAgent;
    var MSIEOffset = ua.indexOf("MSIE");
    if (MSIEOffset == -1) return false;
    else return true;
}
