
// 默认浮动块的高度
var _height = 80; //px

// 默认浮动块的宽度
var _width = 200; //px

// 默认浮动速率
var _rate = 40;

// 内部参数
var _curX = 0;
var _curY = 0;
var _directionX = 1;
var _directionY = 1;
var stepX = 1;
var stepY = 1;


function onDone(src) {
  oPopup.innerHTML = src;
  floatPopup(); 
}

function showPopup() {
	var _parentElement = window.document.body;
	if (oPopup.style.display == 'none') oPopup.style.display = "block";

	oPopup.style.left = _curX;
	oPopup.style.top = _curY;
	oPopup.style.width = _width;
	oPopup.style.height = _height;

	_curX += stepX * _directionX;
	_curY += stepY * _directionY;
	if (_curY + _height >= _parentElement.clientHeight) {
		_curY = _parentElement.clientHeight - _height;
		_directionY *= -1;
	}
	if (_curX + _width >= _parentElement.clientWidth) {
		_curX = _parentElement.clientWidth - _width;
		_directionX *= -1;
	}
	if (_curY <= 0) {
		_curY = 0;
		_directionY *= -1;
	}
	if (_curX <= 0) {
		_curX = 0;
		_directionX *= -1;
	}
}

function floatPopup() {
	window.setInterval(showPopup, _rate);
}


/**
Logo对象
startDate	      开始时间
endDate         结束时间
src							源文件
model           广告的形式
               window 表示广告是弹出框的形式
               float  表示广告是浮动的形式
width						宽度（null值则取默认值）
height					高度（null值则取默认值）
rate						速率（null值则取默认值）
**/
function Logo(startDate, endDate, src, model, width, height, rate) {
	this.startDate = startDate;
	this.endDate = endDate;
	this.src = src;
	this.model= model;
	this._height = height || _height;
	this._width = width || _width;
	this._rate = rate || _rate;
}

function selectLogo() {
	var curDate = new Date();
	curDate.setHours(0,0,0,0); // 小时清空，保证判断正确。
	
	for (var index in LogoList) {
		if (curDate >= LogoList[index].startDate && curDate <= LogoList[index].endDate) {		
			curLogo = LogoList[index];
			_height = curLogo._height;
			_width = curLogo._width;
			_rate = curLogo._rate;
			break;
		}
	}
	if (curLogo != null && curLogo.model=="float")
		dwn.startDownload(curLogo.src, onDone);
	if (curLogo != null && curLogo.model=="window")

window.open(curLogo.src,'View','height='+curLogo._height+',width='+curLogo._width+',resizable=yes,scrollbars=no,location=no,toolbar=no,menubar=no,status=no');


}

var curLogo = null;

var LogoList = new Array();

// 此处增加新的链接
// 特别注意：YYYY,MM,DD 的月份是从0开始的
// 开始

//LogoList.push(new Logo(new Date(2005,1,5),new Date(2005,1,21),"/Heka/chunjienei/add.inc","float",302,72,null));

LogoList.push(new Logo(new Date(2008,1,4),new Date(2008,1,16),"Heka/2008_chunjieww/2008_chunjieww.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2008,2,7),new Date(2008,2,8),"Heka/2008_38w/2008_38w.htm","window",382,150,null));
LogoList.push(new Logo(new Date(2008,3,30),new Date(2008,4,3),"Heka/2008_51w/2008_51w.htm","window",382,150,null));
LogoList.push(new Logo(new Date(2008,4,19),new Date(2008,4,21),"Heka/2008_0519/2008_0519.htm","window",378,240,null));
LogoList.push(new Logo(new Date(2008,5,30),new Date(2008,6,1),"Heka/2008_71w/2008_71w.htm","window",346,150,null));
LogoList.push(new Logo(new Date(2008,6,31),new Date(2008,7,1),"Heka/2008_81w/20080801w.htm","window",320,183,null));
LogoList.push(new Logo(new Date(2008,8,8),new Date(2008,8,10),"Heka/2008_0910w/20080910w.htm","window",346,150,null));
LogoList.push(new Logo(new Date(2008,8,11),new Date(2008,8,15),"Heka/2008_0914w/20080914w.htm","window",320,240,null));
LogoList.push(new Logo(new Date(2008,8,28),new Date(2008,9,5),"Heka/2008_1001w/20081001w.htm","window",346,150,null));
LogoList.push(new Logo(new Date(2008,11,31),new Date(2009,0,3),"Heka/2009_yuandanww/2009_yuandanww.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2009,0,22),new Date(2009,1,1),"Heka/2009_chunjieww/2009_chunjieww.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2009,1,8),new Date(2009,1,9),"Heka/2009_yuanxiaoww/2009_yuanxiaoww.htm","window",360,164,null));
LogoList.push(new Logo(new Date(2009,2,7),new Date(2009,2,8),"Heka/2009_0308ww/20090308ww.htm","window",300,450,null));
LogoList.push(new Logo(new Date(2009,3,30),new Date(2009,4,3),"Heka/20090501w/20090501w.htm","window",382,150,null));
LogoList.push(new Logo(new Date(2009,4,4),new Date(2009,4,4),"Heka/20090504w/20090504w.htm","window",360,200,null));
LogoList.push(new Logo(new Date(2009,4,27),new Date(2009,4,30),"Heka/2009_duanwuww/2009_duanwuww.htm","window",360,267,null));
LogoList.push(new Logo(new Date(2009,4,31),new Date(2009,5,1),"Heka/20090601w/20090601w.htm","window",360,200,null));
LogoList.push(new Logo(new Date(2009,6,1),new Date(2009,6,1),"Heka/20090701w/20090701w.htm","window",346,150,null));
LogoList.push(new Logo(new Date(2009,7,1),new Date(2009,7,1),"Heka/20090801w/20090801w.htm","window",253,320,null));
LogoList.push(new Logo(new Date(2009,8,10),new Date(2009,8,10),"Heka/20090910w/20090910w.htm","window",346,206,null));
LogoList.push(new Logo(new Date(2009,8,30),new Date(2009,9,2),"Heka/20091001/20091001.htm","window",346,220,null));
LogoList.push(new Logo(new Date(2009,9,3),new Date(2009,9,3),"Heka/2009_zhongqiuw/2009_zhongqiuw.htm","window",320,252,null));
LogoList.push(new Logo(new Date(2009,9,4),new Date(2009,9,8),"Heka/20091001/20091001.htm","window",346,220,null));
LogoList.push(new Logo(new Date(2009,11,31),new Date(2010,0,3),"Heka/2010_yuandanw/2010_yuandanw.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2010,1,10),new Date(2010,1,22),"Heka/2010_chunjiew/2010_chunjiew.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2010,1,28),new Date(2010,1,28),"Heka/2010_yuanxiaow/2010_yuanxiaow.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2010,2,8),new Date(2010,2,8),"Heka/20100308w/20100308w.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2010,4,1),new Date(2010,4,3),"Heka/20100501w/20100501w.htm","window",350,158,null));
LogoList.push(new Logo(new Date(2010,4,4),new Date(2010,4,4),"Heka/20100504w/20100504w.htm","window",360,200,null));
LogoList.push(new Logo(new Date(2010,5,16),new Date(2010,5,16),"Heka/2009_duanwuww/2009_duanwuww.htm","window",360,267,null));
LogoList.push(new Logo(new Date(2010,6,1),new Date(2010,6,1),"Heka/20100701w/20100701w.htm","window",346,150,null));
LogoList.push(new Logo(new Date(2010,8,30),new Date(2010,9,7),"Heka/20101001w/20101001w.htm","window",346,220,null));
LogoList.push(new Logo(new Date(2010,11,24),new Date(2010,11,25),"Heka/2010_christmas/2010_christmas.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2010,11,31),new Date(2011,0,3),"Heka/2011_yuandanw/2011_yuandanw.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2011,0,30),new Date(2011,1,10),"Heka/2011_chunjiew/2011_chunjiew.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2011,1,17),new Date(2011,1,17),"Heka/2011_yuanxiaow/2011_yuanxiaow.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2011,2,8),new Date(2011,2,8),"Heka/20110308w/20110308w.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2011,3,30),new Date(2011,4,2),"Heka/20110501w/20110501w.htm","window",450,300,null));
LogoList.push(new Logo(new Date(2011,4,4),new Date(2011,4,4),"Heka/20110504w/20110504w.htm","window",552,352,null));
LogoList.push(new Logo(new Date(2011,5,1),new Date(2011,5,1),"Heka/20110601w/20110601w.htm","window",360,200,null));
LogoList.push(new Logo(new Date(2011,5,6),new Date(2011,5,6),"Heka/2011_duanwuw/2011_duanwuw.htm","window",360,267,null));
LogoList.push(new Logo(new Date(2011,5,30),new Date(2011,6,1),"Heka/20110701w/20110701w.htm","window",360,240,null));
LogoList.push(new Logo(new Date(2011,7,1),new Date(2011,7,1),"Heka/20110801w/20110801w.htm","window",320,213,null));
LogoList.push(new Logo(new Date(2011,8,10),new Date(2011,8,10),"Heka/20110910w/20110910w.htm","window",346,206,null));
LogoList.push(new Logo(new Date(2011,8,12),new Date(2011,8,12),"Heka/2011_zhongqiuw/2011_zhongqiuw.htm","window",320,252,null));
LogoList.push(new Logo(new Date(2011,8,30),new Date(2011,9,7),"Heka/20111001w/20111001w.htm","window",346,220,null));
LogoList.push(new Logo(new Date(2012,0,1),new Date(2012,0,3),"Heka/20120101w/20120101w.htm","window",300,370,null));
LogoList.push(new Logo(new Date(2012,0,22),new Date(2012,0,25),"Heka/20120119w/20120119w.htm","window",400,300,null));

// 结束


