// JavaScript Document
lastScrollY=0;
function heartBeat(){ 
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
    diffY = document.documentElement.scrollTop;
else if (document.body)
    diffY = document.body.scrollTop
else
    {/*Netscape stuff*/}
    
percent=.1*(diffY-lastScrollY); 
if(percent>0)percent=Math.ceil(percent); 
else percent=Math.floor(percent); 
document.getElementById("lovexin11").style.top=parseInt(document.getElementById("lovexin11").style.top)+percent+"px";

lastScrollY=lastScrollY+percent; 
}
suspendcode11="<div id=\"lovexin11\" style='right:5px;POSITION:absolute;TOP:500px;'><a href=\"javascript:window.external.AddFavorite('"+SiteHost+"',%20'"+SiteName+"')\"><img border=0 src=/images/favorite.gif></a></div>"

document.write(suspendcode11); 
window.setInterval("heartBeat()",1);


function GetByID(id)
{
   itm = null;
   if (document.getElementById)
   {
      itm = document.getElementById(id);
   }
   else if (document.all)
   {
      itm = document.all[id];
   }
   else if (document.layers)
   {
      itm = document.layers[id];
   }
   return itm;
}

function CheckAll(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != 'chkall' && e.type=='checkbox')
			if(e.checked == true)
			   e.checked = false;
			else
			   e.checked = true;
	}
}
function GetTime()
{
	now =   new Date();   
	y   =   now.getYear();   
	m   =   now.getMonth()+1;   
	d   =   now.getDate();   
	H   =   now.getHours();   
	i   =   now.getMinutes();   
	s   =   now.getSeconds();   
	return  y+""+m+""+d+""+H+""+i+""+s;  
}

function ClickLink(LinkID)
{
	$.get(AjaxURL+'Mode=Links&LinkID='+LinkID);
	return false;
}

function doClick(o)
{
	o.className="curtab";
	var j;
	var id;
	var e;
	for(var i=1;i<=7;i++)
	{
		id ="Nav"+i;
		j = document.getElementById(id);
		e = document.getElementById("Sun"+i);
		if(id != o.id)
		{
			j.className="";
			e.style.display = "none";
		}
		else
		{
			e.style.display = "block";
		}
	}
}
function CopyURL(obj)
{
  obj.select();
  js=obj.createTextRange();
  js.execCommand("Copy")
  alert("已将地址复制至剪切板！");
}

function QuerySetID(URL, SetID)
{
	$.get(
		URL, 
		function(data)
		{
			try
			{
				$('#'+SetID).html(data);
			}
			catch (e)
			{
				$('#'+SetID).html('查询失败！');
				return true;
			}
		}
	);
}
function CheckNumber(value)   //判断是不是大于0的数字
{
	var patten = /[^0-9]/;
	
	if(value <= 0)
		return false;	
	var patrn = /[0-9]+$/;
	if( patrn.test(value) ) return true;
}
function isEmail(s)
{
	var patrn = /[_a-zA-Z\d\-\.]+@[_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+$/;
	if( patrn.test(s) ) return true;
}

function isChinese(name) //中文值检测
{
	if(name.length == 0)
		return false;
	for(i = 0; i < name.length; i++) {
		if(name.charCodeAt(i) > 128)
			return true;
	}
	return false;
}