/***7
 *	Description :
 *		左边贴底浮动 LBM (LeftBottomMove)
 */

//初始化变量
LBM_sImageName		= "http://img1.qq.com/2006/pics/539/539731.jpg";				// 图片名
LBM_sClickUrl		= "http://news.phoenixtv.com/phoenixtv/83922909344563200/index.shtml";					// 点击链接
LBM_sImageUrl		= "http://img1.qq.com/2006/pics/539/539731.jpg";					// 图片URL

LBM_iImageWidth		= parseInt("80");			// 图片宽度
if (isNaN(LBM_iImageWidth)) LBM_iImageWidth = 80;

LBM_iImageHeight	= parseInt("80");			// 图片高度
if (isNaN(LBM_iImageHeight)) LBM_iImageHeight = 80;

image_left = 10;									// 图片左边距
image_bottom = 20;									// 图片下边距

time_out = 500;										// 调整位置时间间隔
scrollbar_width = 20;								// 滚动条宽度
document.ns = navigator.appName == "Netscape";		// 浏览器类型

// 显示广告内容
function LBM_ShowContent(ImageUrl, ImageName, iWidth, iHeight)
{
	var str, pos;
	if (ImageUrl!="")
	{
		//image not played by adverisement system
		str = /.swf/;
		pos = ImageUrl.search(str);
		if (pos==-1)
			document.write("<img src=\'", ImageUrl, "\' height=\'" + iHeight + "\' width=\'" + iWidth + "\' border=0>");
		else
			document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0\" height=",  iHeight, " width=", iWidth,">\n<param name=movie value=\'", ImageUrl,"\'>\n<param name=quality value=high>\n\n</object>");	
	}
	else if (ImageName!="")
	{
		//image played by adverisement system
		str = /.swf/;
		pos = ImageName.search(str);
		if (pos==-1)
			document.write("<img src=\'", ImageName, "\' height=\'" + iHeight + "\' width=\'" + iWidth + "\' border=0>");
		else
			document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0\" height=",  iHeight, " width=", iWidth,">\n<param name=movie value=\'", ImageName,"\'>\n<param name=quality value=high>\n\n</object>");	
	}
}

// 加载广告
function LBM_Load()
{
	if (document.ns)
	{
		document.write("<layer id=LBM_Div top=300 width=64 height=80><a href='", LBM_sClickUrl, " border='0' target=_blank>");
		LBM_ShowContent(LBM_sImageUrl, LBM_sImageName, LBM_iImageWidth, LBM_iImageHeight);
		document.write("</a></layer>");
	}
	else
	{
		document.write("<div id=LBM_Div style='position: absolute;width:64;top:300;visibility: visible;z-index: 1'><a href='", LBM_sClickUrl ,"' target=_blank>");
		LBM_ShowContent(LBM_sImageUrl, LBM_sImageName, LBM_iImageWidth, LBM_iImageHeight);
		document.write("</a></div>");
	}

	LBM_Move();
}

// 浮动广告
function LBM_Move()
{
	if(document.ns)
	{
		document.LBM_Div.pageY	= pageYOffset + (window.innerHeight - iImageHeight) - scrollbar_width - image_bottom;
		document.LBM_Div.pageX	= pageXOffset + image_left;
	}
	else
	{
		LBM_Div.style.top		= document.body.scrollTop + (document.body.offsetHeight - LBM_iImageHeight) - scrollbar_width - image_bottom;
		LBM_Div.style.left		= document.body.scrollLeft + image_left;
	}

	setTimeout("LBM_Move();", time_out);
}

//-- start

LBM_Load();

//-- end

function MM_reloadPage(init) 
{  
	//reloads the window if Nav4 resized
  	if (init==true) 
  		with (navigator) 
  		{
  			if ((appName=="Netscape")&&(parseInt(appVersion)==4)) 
			{
    				document.MM_pgW=innerWidth;
					document.MM_pgH=innerHeight;
					onresize=MM_reloadPage; 
			}
    	}
 	 else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) 
 	 	location.reload();
}
MM_reloadPage(true);