var exAd = function(id, src1, width1, height1, src2, width2, height2, url, cover) {
	document.write("<div id=\"exAd_" + id + "\"><div id=\"" + id + "_ex1\"></div><div id=\"" + id + "_ex2\"></div></div>");
	var div = document.getElementById("exAd_" + id);
	var div1 = document.getElementById(id + "_ex1");
	var div2 = document.getElementById(id + "_ex2");
	if (src1.substring(src1.length - 4, src1.length) == ".swf") {
		var flash1 = new sinaFlash(src1, "", width1, height1, "7", "", false, "high");
		flash1.addParam("wmode", "opaque");
		flash1.addVariable("adlink", escape(url));
		flash1.write(div1.id);
	} else {
		div1.innerHTML = "<a href=\"" + url + "\" target=\"_blank\"><img src=\"" + src1 + "\" width=\"" + width1 + "\" height=\"" + height1 + "\" border=\"0\"></a>";
	}
	if (src2.substring(src2.length - 4, src2.length) == ".swf") {
		var flash2 = new sinaFlash(src2, "", width2, height2, "7", "", false, "high");
		flash2.addParam("wmode", "opaque");
		flash2.addVariable("adlink", escape(url));
		flash2.write(div2.id);
	} else {
		div2.innerHTML = "<a href=\"" + url + "\" target=\"_blank\"><img src=\"" + src2 + "\" width=\"" + width2 + "\" height=\"" + height2 + "\" border=\"0\"></a>";
	}
	div.style.position = "relative";
	with(div1.style) {
		width = width1 + "px";
		height = height1 + "px";
		position = "relative"; //border = "solid 1px #F00";
	}
	with(div2.style) {
		width = width2 + "px";
		height = height2 + "px";
		visibility = "hidden";
		position = "absolute";
		zIndex = 999;
		//left = (div1.offsetLeft) + "px";
		top = div1.offsetTop + "px";
	}
	var timeout;
	div1.onmouseover = function() {
		expansion();
		timeout = window.setTimeout(contraction, 5000);
	}
	div2.onmouseout = function() {
		contraction();
		window.clearTimeout(timeout);
	}
	var expansion = function() {
		div2.style.visibility = "visible";
		if (!cover) {
			div1.style.width = width2 + "px";
			div1.style.height = height2 + "px";
		}
	}
	var contraction = function() {
		div2.style.visibility = "hidden";
		if (!cover) {
			div1.style.width = width1 + "px";
			div1.style.height = height1 + "px";
		}
	}
}
