//处理广告JS



//处理飘浮广告

if(typeof(includead) == "undefined")includead=0;

if(includead == "1")//启用飘浮广告

{

	if(typeof(adhref) == "undefined") adhref = "http://www.und.cn";

	if(typeof(adimage) == "undefined") adimage = "http://www.und.cn/moban/map/999.gif";

	else

	{

		url = location.pathname;

		if(url.indexOf("\\") != -1)

		{

			url = url.replace(/\\/g,"/");

		}

		url = url.substr(0,url.lastIndexOf("/"));

		url = url.substr(0,url.lastIndexOf("/"));

		adimage = url+"/image/"+adimage;

	}

document.write("<div id=\"img\" style=\"position:absolute;\"><a href=\""+adhref+"\" target=_blank><img src=\""+adimage+"\" onmouseover=\"pause_resume();\" onmouseout=\"pause_resume();\" style=\"border:none\"></a></div>");

var xPos = 20;

var yPos = document.body.clientHeight;

var step = 1;

var delay = 10; 

var height1 = 0;

var Hoffset = 0;

var Woffset = 0;

var yon = 0;

var xon = 0;

var pause = true;

var interval;

img.style.top = yPos;



function changePos() {

	width = document.body.clientWidth;

	height1 = document.body.clientHeight;

	Hoffset = img.offsetHeight;

	Woffset = img.offsetWidth;

	img.style.left = xPos + document.body.scrollLeft;

	img.style.top = yPos + document.body.scrollTop;

	if (yon)

	{

		yPos = yPos + step;

	}

	else

	{

		yPos = yPos - step;

	}

	if (yPos < 0)

	{

		yon = 1;

		yPos = 0;

	}

	if (yPos >= (height1 - Hoffset))

	{

		yon = 0;

		yPos = (height1 - Hoffset);

	}

	if (xon)

	{

		xPos = xPos + step;

	}

	else

	{

		xPos = xPos - step;

	}

	if (xPos < 0)

	{

		xon = 1;

		xPos = 0;

	}

	if (xPos >= (width - Woffset)) 

	{

		xon = 0;

		xPos = (width - Woffset);

	}

}

function start()

{

	img.visibility = "visible";

	interval = setInterval('changePos()', delay);

}

function pause_resume() {

	if(pause)

	{

		clearInterval(interval);

		pause = false;

	}

	else

	{

		interval = setInterval('changePos()',delay);

		pause = true;

	}

}

start();

}

else//不启用飘浮广告

{

		

}



//下面处理调出广告

//('','','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=200,height=300')

if(typeof(includeopen) == "undefined")includeopen = "0";

if(includeopen == "1")//启用调出广告

{

	if(typeof(toolbar) == "undefined")toolbar = "yes";

	if(typeof(location1) == "undefined")location1 = "yes";

	if(typeof(status1) == "undefined")status1 = "yes";

	if(typeof(menubar) == "undefined")menubar = "yes";

	if(typeof(scrollbars) == "undefined")scrollbars = "yes";

	if(typeof(resizable) == "undefined")resizable = "yes";

	if(typeof(width) == "undefined")width = "800";

	if(typeof(height) == "undefined")height = "600";

	if(typeof(openurl) == "undefined")openurl = "http://www.und.cn";

	var feature = 'toolbar='+toolbar+',status='+status1+',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable+',width='+width+',height='+height+' ,location='+location1+' ';

	window.open(openurl,'blank',feature);

}

else//不启用调出广告

{



}

