<!--
	function hcAD(p_ADType,p_ObjName,p_Src,p_Param,p_Link)
	{
		var args = hcAD.arguments;
		if (args.length > 0)
		{
			var adType = args[0];

			if (adType == "FlyAnyWhere" && args.length == 5)
			{
				HCAD_FlyAnyWhere(args[1],args[2],args[3],args[4]);
			}
			else if (adType == "DuiLian" && args.length == 5)
			{
				HCAD_DuiLian(args[1],args[2],args[3],args[4]);
			}
			else
			{

			}
		}
	}

	//---- Start DuiLian ----//
	function HCAD_DuiLian(p_ObjName,p_Src,p_Param,p_Link)
	{
		if (document.getElementById(p_ObjName))
		{
			alert("DuiLian 元素 [" + p_ObjName + "] 重复");
		}
		else
		{
			var width,height,left,right,top,bottom;
			width = HCAD_GetParamValue(p_Param,"width");
			height = HCAD_GetParamValue(p_Param,"height");
			left = HCAD_GetParamValue(p_Param,"left");
			right = HCAD_GetParamValue(p_Param,"right");
			top = HCAD_GetParamValue(p_Param,"top");
			bottom = HCAD_GetParamValue(p_Param,"bottom");

			if (width == "") width = 0;
			if (height == "") height = 0;

			var divLeft = left;
			var divTop = top;
			if (divLeft == "" && right != "") divLeft = document.body.clientWidth - right - width;
			if (divTop == "" && bottom != "") divTop = document.body.clientHeight - bottom - height;

			document.write("<DIV id=" + p_ObjName);
			document.write(" style='POSITION: absolute;");
			if (divLeft != "") document.write("LEFT: " + divLeft + "px;");
			if (divTop != "") document.write("TOP: " + divTop + "px;");
			if (width != "" && width != 0) document.write("width: " + width + "px;");
			if (height != "" && height != 0) document.write("height: " + height + "px;");

			document.write("'>");
			document.write(" " + HCAD_GetFileHTMLCode(p_Src,p_Param,p_Link) + " ");
			document.write("</DIV>");

			if(javascriptEnabled())
			{
				var x = left
				var y = top;
				var tempValue;
				if (x == "" && right != "")
				{
					tempValue = right*1 + width*1;
					x = "document.body.clientWidth-" + tempValue + "";
				}
				if (y == "" && bottom != "")
				{
					tempValue = bottom*1 + height*1;
					y = "document.body.clientHeight-" + tempValue + "";
				}

				setInterval("HCAD_PlayDuiLian(" + p_ObjName + "," + x + "," + y + ")",10);
			}
		}
	}

	function HCAD_PlayDuiLian(p_Obj,p_X,p_Y)
	{
		if (p_Obj != "" && p_X != "" && p_Y != "")
		{
			var delta=0.02;
			if(screen.width <= 800)
			{
				p_Obj.style.display= 'none';
				return;
			}
			if(p_Obj.offsetLeft != (document.body.scrollLeft + p_X)) 
			{
				var dx = (document.body.scrollLeft + p_X - p_Obj.offsetLeft) * delta;
				dx = (dx > 0 ? 1:-1) * Math.ceil(Math.abs(dx));
				p_Obj.style.left = p_Obj.offsetLeft + dx;
			}

			if(p_Obj.offsetTop != (document.body.scrollTop + p_Y)) 
			{
				var dy=(document.body.scrollTop + p_Y - p_Obj.offsetTop) * delta;
				dy = (dy > 0 ? 1:-1) * Math.ceil(Math.abs(dy));
				p_Obj.style.top = p_Obj.offsetTop + dy;
			}
			p_Obj.style.display = '';
		}
	}
	//---- end DuiLian ----//

	//---- Start FlyAnyWhere ----//
	function HCAD_FlyAnyWhere(p_ObjName,p_Src,p_Param,p_Link)
	{
		if (p_ObjName != "" && p_Src != "")
		{
			if (document.getElementById(p_ObjName))
			{
				alert("FlyAnyWhere 元素 [" + p_ObjName + "] 重复");
			}
			else
			{
				var width,height,transparent;
				width = HCAD_GetParamValue(p_Param,"width");
				height = HCAD_GetParamValue(p_Param,"height");

				var vmin=1;
				var vmax=2;
				var vr=2;
				var moveXX,moveYY,moveVX,moveVY;
				moveVX = vmin + vmax * Math.random();
				moveVY = vmin + vmax * Math.random();
				moveXX = 600;
				moveYY = 0;
				
				document.write("<DIV id=" + p_ObjName);
				document.write(" style='LEFT: 535px;POSITION: absolute; TOP: 18px;'>");
				document.write(" " + HCAD_GetFileHTMLCode(p_Src,p_Param,p_Link) + " ");
				document.write("</DIV>");

				if(javascriptEnabled())
				{
					if (width == '') width = 0;
					if (height == '') height = 0;
					HCAD_MoveFlyAnyWhere(eval(p_ObjName),width,height,moveXX,moveYY,moveVX,moveVY,vmin,vmax,vr);
				}
			}
		}
	}

	function HCAD_MoveFlyAnyWhere(p_Obj,p_Width,p_Height,moveXX,moveYY,moveVX,moveVY,p_VMin,p_VMax,p_VR)
	{
		if(p_Obj != "")
		{
			var pageX;
			var pageY;
			var pageW;
			var pageH;
			if(navigator.appName.indexOf("Internet Explorer") == -1)
			{
				pageX = window.pageXOffset;
				pageW = window.innerWidth;
				pageY = window.pageYOffset;
				pageH = window.innerHeight;
			}
			else
			{
				pageX=window.document.body.scrollLeft;
				pageW=window.document.body.offsetWidth-8;
				pageY=window.document.body.scrollTop;
				pageH=window.document.body.offsetHeight;
			}

			moveXX = moveXX + moveVX;
			moveYY = moveYY + moveVY;
			moveVX += p_VR * (Math.random() - 0.5);
			moveVY += p_VR * (Math.random() - 0.5);

			if(moveVX > (p_VMax + p_VMin))  moveVX = (p_VMax + p_VMin) * 2 - moveVX;
			if(moveVX < (-p_VMax-p_VMin)) moveVX = (-p_VMax - p_VMin) * 2 - moveVX;
			if(moveVY > (p_VMax+p_VMin))  moveVY = (p_VMax + p_VMin) * 2 - moveVY;
			if(moveVY < (-p_VMax-p_VMin)) moveVY = (-p_VMax - p_VMin) * 2 - moveVY;

			if(moveXX <= pageX)
			{
				moveXX = pageX;
				moveVX = p_VMin + p_VMax * Math.random();
			}
			if(moveXX >= pageX + pageW - p_Width)
			{
				moveXX = pageX + pageW - p_Width;
				moveVX = -p_VMin - p_VMax * Math.random();
			}
			if(moveYY <= pageY)
			{
				moveYY = pageY;
				moveVY = p_VMin + p_VMax * Math.random();
			}
			if(moveYY >= pageY + pageH - p_Height)
			{
				moveYY = pageY + pageH - p_Height;
				moveVY = -p_VMin - p_VMax * Math.random();
			}

			//移动对象
			if(navigator.appName.indexOf("Internet Explorer") == -1)
			{
				p_Obj.top = moveYY;
				p_Obj.left= moveXX;
			} 
			else
			{
				p_Obj.style.pixelLeft = moveXX;
				p_Obj.style.pixelTop = moveYY;
			}
			setTimeout("HCAD_MoveFlyAnyWhere("
				+ p_Obj.id
				+ "," + p_Width
				+ "," + p_Height
				+ "," + moveXX
				+ "," + moveYY
				+ "," + moveVX
				+ "," + moveVY
				+ "," + p_VMin
				+ "," + p_VMax
				+ "," + p_VR
				+ ")",100);
		}
	}
	//---- End FlyAnyWhere ----//

	function javascriptEnabled()
	{
		var result = false;
		var aver = parseInt(navigator.appVersion.substring(0,1));

		if(navigator.appName.indexOf("Internet Explorer") != -1)
		{
			if(aver >= 4)
			{
				result = navigator.javaEnabled();
			}
		}
		if(navigator.appName.indexOf("Netscape") != -1)  
		{
			if(aver >= 4)
			{
				result = navigator.javaEnabled();
			}
		}
		return result;
	}

	function HCAD_GetFileType(p_Src)
	{
		var arr,ext;
		if (p_Src != "")
		{
			if (p_Src.indexOf(".") != -1)
			{
				arr = p_Src.split(".");
				ext = arr[arr.length-1];
			}
		}
		return ext;
	}

	function HCAD_GetFileHTMLCode(p_Src,p_Param,p_Link)
	{
		var fileType,ext,code;
		code = "";
		ext = HCAD_GetFileType(p_Src);

		var width = "";
		var height = "";
		var className = ""
		var transparent = "";
		if (p_Param != "")
		{
			width = HCAD_GetParamValue(p_Param,"width");
			height = HCAD_GetParamValue(p_Param,"height");
			className = HCAD_GetParamValue(p_Param,"class");
			transparent = HCAD_GetParamValue(p_Param,"transparent");
		}

		if (ext != "")
		{
			ext = ext.toLowerCase();
			if (ext == "gif" || ext == "jpg" || ext == "jpeg" || ext == "png")
			{
				code = "<img src='" + p_Src + "'";
				if (width != "")
				{
					code += " width='" + width + "'";
				}
				if (width != "")
				{
					code += " height='" + height + "'";
				}
				if (className != "")
				{
					code += " class='" + className + "'";
				}
				if (transparent != "")
				{
					//code += "";
				}
				code += " border=0>";
				if (p_Link != "")
				{
					code = "<a href=" + p_Link + " target=_blank>" + code + "</a>";
				}
			}
			else if (ext == "swf")
			{
				code += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"";
				code += " codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\"";
				if (width != "")
				{
					code += " width=\"" + width + "\"";
				}
				if (height != "")
				{
					code += " height=\"" + height + "\"";
				}
				code += ">";
				code += " <param name=\"movie\" value=\"" + p_Src + "\">";
				if (transparent == "1" || transparent == "yes")
				{
					code += "<param name=\"wmode\" value=\"transparent\">";
				}
				code += " <param name=\"quality\" value=\"high\">";
				code += " <embed src=\"" + p_Src + "\" quality=\"high\"";
				code += " pluginspage=\"http://www.macromedia.com/go/getflashplayer\"";
				code += " type=\"application/x-shockwave-flash\"";
				if (width != "")
				{
					code += " width=\"" + width + "\"";
				}
				if (height != "")
				{
					code += " height=\"" + height + "\"";
				}
				code += ">";
				code += " </embed></object>";
			}
		}
		return code;
	}

	function HCAD_GetParamValue(p_Params,p_Name)
	{
		var result = "";
		var arr1;
		var arr2;
		var i;
		var item;
		if (p_Params != "")
		{
			p_Params = p_Params.toLowerCase();
			p_Name = p_Name.toLowerCase();
			arr1 = p_Params.split(",");
			for (i = 0 ; i < arr1.length; i++)
			{
				item = HCAD_Trim(arr1[i]);
				if (item.indexOf(p_Name + "=") != -1)
				{
					arr2 = item.split("=");
					if (arr2.length == 2)
					{
						result = arr2[1];
					}
					break;
				}
			}
		}
		return result;
	}

	function HCAD_LeftTrim(str) 
	{ 
		if (str.charAt(0) == " ") 
		{ 
			str = str.slice(1); 
			str = HCAD_LeftTrim(str);
		} 
		return str; 
	} 

	function HCAD_RightTrim(str) 
	{ 
		var iLength; 

		iLength = str.length; 
		if (str.charAt(iLength - 1) == " ") 
		{ 
			str = str.slice(0, iLength - 1);
			str = HCAD_RightTrim(str);
		} 
		return str; 
	} 

	function HCAD_Trim(str) 
	{ 
		return HCAD_LeftTrim(HCAD_RightTrim(str)); 
	} 

//-->