/***7
 *	Description :
 *		右边贴底浮动 RBM (RightBottomMove)
 */

//初始化变量
RBM_sImageName		= "http://img1.qq.com/2006/pics/539/539731.jpg";				// 图片名
RBM_sClickUrl		= "http://news.phoenixtv.com/phoenixtv/83922909344563200/index.shtml";					// 点击链接
RBM_sImageUrl		= "http://img1.qq.com/2006/pics/539/539731.jpg";					// 图片URL

RBM_iImageWidth		= parseInt("80");			// 图片宽度
if (isNaN(RBM_iImageWidth)) RBM_iImageWidth = 80;

RBM_iImageHeight	= parseInt("80");			// 图片高度
if (isNaN(RBM_iImageHeight)) RBM_iImageHeight = 80;

image_right = 10;									// 图片右边距
image_bottom = 5;									// 图片下边距

time_out = 1;										// 调整位置时间间隔
scrollbar_width = 20;			 					// 滚动条宽度
document.ns = navigator.appName == "Netscape";		// 浏览器类型

// 显示广告内容
function RBM_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 RBM_Load()
{
	if (document.ns)
	{
		document.write("<layer id=RBM_Div top=300 width=64 height=80><a href='", RBM_sClickUrl, " border='0' target=_blank>");
		RBM_ShowContent(RBM_sImageUrl, RBM_sImageName, RBM_iImageWidth, RBM_iImageHeight);
		document.write("</a></layer>");
	}
	else
	{
		document.write("<div id=RBM_Div style='position: absolute;width:64;top:300;visibility: visible;z-index: 1'><a href='", RBM_sClickUrl ,"' target=_blank>");
		RBM_ShowContent(RBM_sImageUrl, RBM_sImageName, RBM_iImageWidth, RBM_iImageHeight);
		document.write("</a></div>");
	}

	RBM_Move();
}

// 浮动广告
function RBM_Move()
{
	if(document.ns)
	{
		document.RBM_Div.pageY	= pageYOffset + (window.innerHeight - iImageHeight) - scrollbar_width - image_bottom;
		document.RBM_Div.pageX	= pageXOffset + window.innerWidth - scrollbar_width - image_right - RBM_iImageWidth;
	}
	else
	{
		RBM_Div.style.top		= document.body.scrollTop + (document.body.offsetHeight - RBM_iImageHeight) - scrollbar_width - image_bottom;
		RBM_Div.style.left		= document.body.scrollLeft + document.body.offsetWidth - scrollbar_width - image_right - RBM_iImageWidth;
	}

	setTimeout("RBM_Move();", time_out);
}

//-- start

RBM_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);