function GetCookieVal(offset) 
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(sName) 
{
	var arg = sName + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
	{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return GetCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function addMouseEvent() {	
	var inputs = document.getElementsByTagName('input');
	for (i=0;i<inputs.length;i++) {
		var inputtype = inputs[i].type.toLowerCase();
		if(inputtype == 'checkbox' || inputtype == 'radio') continue;
		inputs[i].onfocus=function() {
			this.className='focus';
			var temptips=document.getElementById(this.id+'tips');
			if (temptips && GetCookie('spTips')!=1) {
				temptips.style.display='block';
				//temptips.style.width=this.offsetWidth-10+'px';
				temptips.style.top=findPosY(this)-4+'px';
				temptips.style.left=findPosX(this)+this.offsetWidth+3+'px';
				//alert(findPosY(this));
			}
		}
		inputs[i].onblur=function() {
			this.className='';
			var temptips=document.getElementById(this.id+'tips');
			if (temptips) {
				myTimeout = window.setTimeout(function() {temptips.style.display='none';}, 0); 
				//temptips.style.display='none';
			}
		}
	}
	//为信息列表添加选中效果
	var articleList=document.getElementById('articlelist');
	var temstatus='';
	if (articleList) {
		var articleRows=articleList.getElementsByTagName('tr');
		for(i=1;i<articleRows.length;i++){
			for(j=1;j<articleRows[i].cells.length;j++) {
				articleRows[i].cells[j].onclick=function() {
					var tempCheckbox=this.parentNode.getElementsByTagName('input')[0];
					var tempTh=this.parentNode.getElementsByTagName('th')[0];
					if (tempCheckbox && !tempTh) {
						if(tempCheckbox.checked!=true){
							tempCheckbox.checked=true;
							this.parentNode.style.background='#F8F5E5';
							temstatus=this.parentNode.style.background;
						} else {
							tempCheckbox.checked=false;
							this.parentNode.style.background='';
							temstatus=this.parentNode.style.background;
						}
					}		
				}	
			}
				
			articleRows[i].onmouseover=function() {
				temstatus=this.style.background;
				if(this.style.background!='#F8F5E5') {
					this.style.background='#F8F5E5';
				}
			}
			
			articleRows[i].onmouseout=function() {
				this.style.background=temstatus;
			}
		}
	}
}
//
//Event.observe(window,"load",addMouseEvent,false);

function bbimg(src)
{
	
}

function resizepic(src)
{
	
}