function XAdFlash(url, linkurl, l, t, w, h){
	this.url = url;
	this.linkurl = linkurl;
	this.left = l;
	this.top = t;
	this.width = w;
	this.height = h;
}
function XAdStreem(AdStreem){
	this.AdStreem = AdStreem;
	this.closemovie = function(){
		if(this.StreemFlash.url.substr(this.StreemFlash.url.length-4).toLowerCase() == ".swf")
		{
		document.getElementById(this.AdStreem + '_may5_streemFlash').Rewind();
		document.getElementById(this.AdStreem + '_may5_streemFlash').Stop();
		}
		document.getElementById(this.AdStreem + '_may5_floatDiv').style.visibility='visible';
		document.getElementById(this.AdStreem + '_may5_streemDiv').style.visibility='hidden';
	}
	this.PlayAdStreem = function(b){
		if(navigator.appName == "Microsoft Internet Explorer"){
		if(this.StreemFlash.url.substr(this.StreemFlash.url.length-4).toLowerCase() == ".swf")
		{
			if(b) document.getElementById(this.AdStreem + '_may5_streemFlash').Play();
		}
			document.getElementById(this.AdStreem + '_may5_streemDiv').style.visibility = 'visible';
			document.getElementById(this.AdStreem + '_may5_floatDiv').style.visibility = 'hidden';
		}
	}
	this.closebtn = function(){
		document.getElementById(this.AdStreem + '_may5_streemFlashDiv').innerHTML = '';
		document.getElementById(this.AdStreem + '_may5_floatDiv').innerHTML = '';
	}
	this.AutoMove = function(){
		var bdy = (document.documentElement && document.documentElement.clientWidth)?document.documentElement:document.body;
		document.getElementById(this.AdStreem + '_may5_streemDiv').style.left = (bdy.offsetWidth - this.StreemFlash.width) / 2 + this.StreemFlash.left;
		document.getElementById(this.AdStreem + '_may5_streemDiv').style.top = bdy.scrollTop + this.StreemFlash.top;
		document.getElementById(this.AdStreem + '_may5_floatDiv').style.left = (this.FloatFlash.left >= 0)? (bdy.scrollLeft + this.FloatFlash.left):(bdy.offsetWidth + bdy.scrollLeft - this.FloatFlash.width + this.FloatFlash.left - 20);
		document.getElementById(this.AdStreem + '_may5_floatDiv').style.top = bdy.scrollTop + bdy.offsetHeight - this.FloatFlash.height - this.FloatFlash.top - 40;
		setTimeout('eval("'+this.AdStreem +'.AutoMove()")', 50);
	}
/*显示大广告*/
	this.showStreemDiv = function(){
		document.write('<div id="' + this.AdStreem + '_may5_streemDiv" style=\"z-index:999;visibility:hidden;overflow:visible;position:absolute;left:0px;top:0px;width:'+ this.StreemFlash.width +'px;height:'+ (this.StreemFlash.height + 17) +'px\" align=\"right\">');
		document.write('<div id="'+ this.AdStreem + '_may5_streemFlashDiv" style=\"z-index:999;position:relative;\">');
		document.write('<img style=\"margin:0;padding:0;position:absolute;right:0;top:0;\" src=\"/images/tab_close.gif\" onClick=\"eval(\'' + this.AdStreem + '.closemovie();\');\" border=0>');
        if(this.StreemFlash.url.substr(this.StreemFlash.url.length-4).toLowerCase() == ".swf")
		document.write('<EMBED id="'+ this.AdStreem + '_may5_streemFlash" src="'+ this.StreemFlash.url +'" type=\"application/x-shockwave-flash\" wmode=\"transparent\" quality=\"high\" allowScriptAccess=\"always\" width='+ this.StreemFlash.width +' height='+ this.StreemFlash.height +'></EMBED>');
		else
		document.write("<a href='"+this.StreemFlash.linkurl+"' target='_blank'><img src='"+this.StreemFlash.url+"' width='"+ this.StreemFlash.width +"' height='"+this.StreemFlash.height+"' border='0' /></a>");		
		document.write('</div>');
		document.write('</div>');
		document.write('<div id="' + this.AdStreem + '_may5_floatDiv" style=\"z-index:1;visibility:hidden;overflow:visible;position:absolute;left:0px;top:0px;width:'+ this.FloatFlash.width +'px;height:'+ (this.FloatFlash.height + 17) +'px\">');
/*显示小广告*/
        if(this.FloatFlash.url.substr(this.FloatFlash.url.length-4).toLowerCase() == ".swf")
		document.write("<EMBED src='"+this.FloatFlash.url+"' type='application/x-shockwave-flash' wmode='transparent' quality='high' allowScriptAccess='always' width="+ this.FloatFlash.width +" height="+ this.FloatFlash.height +"></EMBED>");
		else
		document.write("<a href='"+this.FloatFlash.linkurl+"' target='_blank'><img src='"+this.FloatFlash.url+"' border='0' /></a>");		
/*显示控制按钮*/
		document.write('<table bgcolor="#cccccc" border="0" cellpadding="2" cellspacing="0" width="100%"><tr><td align=\"center\" width=\"50%\"><a style=\"font-size:12px;color:#000000;text-decoration:none;\" onclick=\"javascript:eval(\'' + this.AdStreem + '.closebtn();\');return false;\" href=\"#\">关 闭</a></td><td align=\"center\" width=\"50%\" bgcolor=\"#000000\"><a style=\"font-size:12px;color:#cccccc;text-decoration:none;\" onclick=\"javascript:eval(\'' + this.AdStreem + '.PlayAdStreem(true);\');return false;\" href=\"#\">重 播</a></td></tr></TABLE>');
		document.write('</div>');
		document.write("<SCR"+"IPT language=JavaScript event=FSCommand(command,args) for="+ this.AdStreem + "_may5_streemFlash>"+ this.AdStreem + "_may5_floatDiv.style.visibility='visible';"+ this.AdStreem + "_may5_streemDiv.style.visibility='hidden';"+ 'document.getElementById(\"' + this.AdStreem + '_may5_streemFlash\").Stop();'+"</SCR"+"IPT>");
		this.AutoMove();
		this.PlayAdStreem();
		setTimeout('eval("'+this.AdStreem +'.closemovie()")', 15000);
	}
}
