DI_sLeftImageUrl	= "images/zhengqiuyijian.gif";
DI_sRightImageUrl	= "images/right01.gif";
DI_sClickUrl		= "";
var DI_sClickUrlLeft = "http://www.qhd54.gov.cn/bbs/index.php?boardid=11";
var DI_sClickUrlRight = "http://www.qhd54.gov.cn/oa/shownews.php?id=549"
DI_sImageUrl		= "";
DI_iImageWidth		= parseInt("64");
if (isNaN(DI_iImageWidth)) DI_iImageWidth = 64;
DI_iImageHeight	= parseInt("300");
if (isNaN(DI_iImageHeight)) DI_iImageHeight = 300;

DI_iMinWindowWidth = 786 + DI_iImageWidth * 2;	/* avoid covering the web content */
DI_iTop	= 127;
DI_iLeft = 0;
DI_iRight = 0;
DI_iTimeout = 500;

DI_blClosed = false;
/*---- common codes begin ----*/
var __bs__ = navigator.userAgent.indexOf("MSIE") > 0 ?
	"MSIE" : "others";
var __dt__ = (document.documentElement.clientHeight > 0) &&
	(__bs__ == "MSIE" || document.body.clientHeight > document.documentElement.clientHeight) ?
	"W3C" : "undefined";
function MK_pageY() {
	if (__bs__ == "MSIE") {
		if (__dt__ == "W3C")
			return document.documentElement.scrollTop;
		else
			return document.body.scrollTop;
	} else {
		return window.pageYOffset;
	}
}
function MK_pageX() {
	if (__bs__ == "MSIE") {
		if (__dt__ == "W3C")
			return document.documentElement.scrollLeft;
		else
			return document.body.scrollLeft;
	} else {
		return window.pageXOffset;
	}
}
function MK_pageH() {
	if (__dt__ == "W3C")
		return document.documentElement.clientHeight;
	else
		return document.body.clientHeight;
}
function MK_pageW() {
	if (__dt__ == "W3C")
		return document.documentElement.clientWidth;
	else
		return document.body.clientWidth;
}
function MK_posY(o, v) {
	if (!o || !o.style) return ;
	if (v) {
		o.style.top = parseInt(v) + "px";
	} else {
		return o.style.top;
	}
}
function MK_posX(o, v) {
	if (!o || !o.style) return ;
	if (v) {
		o.style.left = parseInt(v) + "px";
	} else {
		return o.style.left;
	}
}

function MK_makeAdFodderHTML(sImageUrl, sImageName, iWidth, iHeight) {
	var _src = sImageUrl == "" ? sImageName : sImageUrl;
	return (!_src.match(/\.swf$/gi)? '<img src="$src$" height="300" width="64" border="0" />' :
		'<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="300" width="64">\n' +
		'<param name="movie" value="$src$" />\n' +
		'<param name="quality" value="high" />\n' +
		'<param name="wmode" value="opaque" />\n' +
		'<embed height="300" width="64"' +
		' src="$src$" quality="high" wmode="opaque"' +
		' type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer">' +
		'</embed>' +
		'</object>')
	.replace(/\$src\$/gi, _src).replace(/\$height\$/gi, iHeight).replace(/\$width\$/gi, iWidth);
}
/*---- common codes end ----*/
function closead() {
	DI_blClosed = true;
	DI_Hide();
}

function DI_Hide() {
	try {
	document.getElementById('DI_LDiv').style.display = 'none';
	document.getElementById('DI_RDiv').style.display = 'none';
	} catch(e) {}
}

function JsCloseDAD() {
	closead();
	return false ;
}

function DI_Show() {
	if (DI_blClosed) return;
	try {
	document.getElementById('DI_LDiv').style.display = 'block';
	document.getElementById('DI_RDiv').style.display = 'block';
	} catch(e) {}
}

function DI_Load() {
	var style_class ;
/*	try {
		if (__bs__ == "MSIE")
			document.styleSheets[0].addRule('.div_floating_ad', 'position:absolute');
		else
			document.styleSheets[0].insertRule('.div_floating_ad {position:absolute}', document.styleSheets[0].cssRules.length);
		style_class = 'class="div_floating_ad" style="display:none; float:none;"';
	} catch(e) {*/
		style_class = 'style="position:absolute; display:none; float:none;"';
/*	}*/
	var _temp = '<div id="$div_id$" ' + style_class + '>\n' +
		'	<div style="float:none;"><a href="$js_ad_click$" target="_blank">$js_ad_content$</a></div>\n' +
		'	<div style="float:none; text-align:right;"><img style="cursor:pointer;" src="images/db_close.gif" onClick="javascript:JsCloseDAD();"></div>\n' +
		'</div>\n';
	var _lcon = MK_makeAdFodderHTML(DI_sImageUrl, DI_sLeftImageUrl, DI_iImageWidth, DI_iImageHeight);
	var _rcon = MK_makeAdFodderHTML(DI_sImageUrl, DI_sRightImageUrl, DI_iImageWidth, DI_iImageHeight);
	var _lstr = _temp.replace(/\$js_ad_click\$/gi, DI_sClickUrlLeft)
		.replace(/\$div_id\$/gi, 'DI_LDiv').replace(/\$js_ad_content\$/gi, _lcon);
	var _rstr = _temp.replace(/\$js_ad_click\$/gi, DI_sClickUrlRight)
		.replace(/\$div_id\$/gi, 'DI_RDiv').replace(/\$js_ad_content\$/gi, _rcon);
	document.writeln(_lstr);
	document.writeln(_rstr);
	setInterval("DI_Move();", DI_iTimeout);
}

function DI_Move() {
	if(MK_pageW() < DI_iMinWindowWidth) {
		DI_Hide();
		return;
	}
	DI_Show();
	try {
	var ldiv = document.getElementById('DI_LDiv');
	MK_posY(ldiv, DI_iTop);
	MK_posX(ldiv, DI_iLeft);
	var rdiv = document.getElementById('DI_RDiv');
	MK_posY(rdiv, DI_iTop);
	MK_posX(rdiv, MK_pageX() + MK_pageW() - DI_iImageWidth - DI_iRight);
	} catch(e) {}
}
/* start */
DI_Load();
document.write('<img src="" width="0" height="0" style="width:0px; height:0px; visibility:hidden; display:none; " />');
