// JavaScript Document
var fodTime = 0;
function geto(o){ return (typeof o == "object")?o:document.getElementById(o);}
function swTabs(e){if(typeof e=="string"){e=geto(e);}var isAjax,sobject;var cls="on";var tmp=e.id.split("_");var sid=tmp[0];var snum=tmp[1];sobject=geto(sid+"_"+snum+"_Info");e.className=cls;if(!isAjax){swLabs(sobject,sid,snum)}tmp=sobject=isAjax=maxItemNum=null;}
function swLabs(sobject,sid,snum){var maxItemNum;var cls="";try{var i=1;maxItemNum=gp[sid][0];while(i<=maxItemNum){if(i!=snum){var tmp1,tmp2;tmp1=geto(sid+"_"+i);tmp2=geto(sid+"_"+i+"_Info");tmp1.className=cls;tmp2.style.display = "none";}i++}}catch(e){}sobject.style.display="block";}
function tagOver(a){clearTimeout(fodTime);fodTime=0;fodTime = setTimeout(function(){swTabs(a)},50);}
function tagOut(a){clearTimeout(fodTime);fodTime=0;}


var fodTime2 = 0;
function geto2(o){ return (typeof o == "object")?o:document.getElementById(o);}
function swTabs2(e){if(typeof e=="string"){e=geto2(e);}var isAjax,sobject;var cls="onn";var tmp=e.id.split("_");var sid=tmp[0];var snum=tmp[1];sobject=geto2(sid+"_"+snum+"_Info");e.className=cls;if(!isAjax){swLabs2(sobject,sid,snum)}tmp=sobject=isAjax=maxItemNum=null;}
function swLabs2(sobject,sid,snum){var maxItemNum;var cls="";try{var i=1;maxItemNum=gp[sid][0];while(i<=maxItemNum){if(i!=snum){var tmp1,tmp2;tmp1=geto2(sid+"_"+i);tmp2=geto2(sid+"_"+i+"_Info");tmp1.className=cls;tmp2.style.display = "none";}i++}}catch(e){}sobject.style.display="block";}
function tagOver2(a){clearTimeout(fodTime2);fodTime2=0;fodTime2 = setTimeout(function(){swTabs2(a)},50);}
function tagOut2(a){clearTimeout(fodTime2);fodTime2=0;}



var fodTime3 = 0;
function geto3(o){ return (typeof o == "object")?o:document.getElementById(o);}
function swTabs3(e){if(typeof e=="string"){e=geto3(e);}var isAjax,sobject;var cls="on1";var tmp=e.id.split("_");var sid=tmp[0];var snum=tmp[1];sobject=geto3(sid+"_"+snum+"_Info");e.className=cls;if(!isAjax){swLabs3(sobject,sid,snum)}tmp=sobject=isAjax=maxItemNum=null;}
function swLabs3(sobject,sid,snum){var maxItemNum;var cls="";try{var i=1;maxItemNum=gp[sid][0];while(i<=maxItemNum){if(i!=snum){var tmp1,tmp2;tmp1=geto3(sid+"_"+i);tmp2=geto3(sid+"_"+i+"_Info");tmp1.className=cls;tmp2.style.display = "none";}i++}}catch(e){}sobject.style.display="block";}
function tagOver3(a){clearTimeout(fodTime3);fodTime3=0;fodTime3 = setTimeout(function(){swTabs3(a)},50);}
function tagOut3(a){clearTimeout(fodTime3);fodTime3=0;}
//全局头部滚动信息加载
function Roller(sId, iDelay, iSpeed, iheight){
    var rollBox = geto(sId);
	var iDelay = iDelay||3000;//每次停顿事件。
	var iSpeed=iSpeed||50;//滚动速度。
	var iheight = iheight||20;//容器高度
	var timer = null, pause = false;
	
	var start = function(){
		timer = setInterval(rollUp,iSpeed);
	}
	
	var rollUp = function(){
		if(pause){ return;}
		    rollBox.scrollTop += 2;
			if(rollBox.scrollTop % iheight == 0){
				clearInterval(timer);
				rollBox.appendChild(rollBox.getElementsByTagName('li')[0]);
				rollBox.scrollTop=0;
				setTimeout(start,iDelay);
			}
	}
  
    rollBox.onmouseover = function(){pause = true;}
	rollBox.onmouseout = function(){pause = false;}
  
    setTimeout(start,iDelay);
}
window.onload = function(){
Roller('rollBox', 3000, 50, 20)
}



//设为首页&加入收藏
var isIE=(document.all&&document.getElementById&&!window.opera)?true:false; 
var isMozilla=(!document.all&&document.getElementById&&!window.opera)?true:false; 
var isOpera=(window.opera)?true:false;
var seturl='url(#default#homepage)';
var weburl=window.location.href;
var webname=document.title;

function myhomepage()	{
	if(isMozilla){
		try {netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");} 
		catch (e){alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',weburl);
	}
	if(isIE){
		this.homepage.style.behavior=seturl;this.homepage.sethomepage(weburl); 
	}
}

function addfavorite()
{

	if(isMozilla){
		if (document.all){ window.external.addFavorite(weburl,webname);}
		else if (window.sidebar){ window.sidebar.addPanel(webname, weburl,"");}
	}
	if(isIE){window.external.AddFavorite(weburl, webname);}	
}

function SetSearchValue(s)
{
if(s.value=='请输入要查询的项目')
s.value=''
}

function pubajax(url,actionstr,divID)
{
//pubajax('http://localhost/click.aspx','id=888018811108','click_888018811108');
$.ajax({
type: "get",
url: url+"?no-cache="+Math.random(),
data: actionstr,
success: function(returnvalue)
{
if (returnvalue.indexOf("??")>-1) 
$("#"+divID).html(""); 
else 
$("#"+divID).html(returnvalue); 
} 
}); 
}
