addEvent=function(E,e,fn){
    E.attachEvent?E.attachEvent(e,function(){fn.call(E)}):E.addEventListener(e.slice(2),fn,false);
};
function H_t(st,num,str1,hd1,hd2) {
	for(i=1;i<=num;i++){
		if(i==str1){
			document.getElementById(st+"1_" + str1).className='hd_'+hd1;
			J=document.getElementById(st+"1_" + str1);
			/*
			addEvent(J,'onclick',function (){
			if(st=='ds'){
				url='/vod/info.php?ty='+ty;
			}else{
				url='/news/info.php?ty='+ty;
			}
			location.href=url;
			});
			*/
			document.getElementById(st+"_" + str1).style.display = "block";
		}
		else
		{	
			document.getElementById(st+"1_" + i).className='hd_'+hd2;
			document.getElementById(st+"_" + i).style.display = "none";
		}
	}	
}
function H_s(st,num,str1,hd1,hd2,ty) {
	for(i=1;i<=num;i++){
		if(i==str1){
			document.getElementById(st+"1_" + str1).className='i_'+hd1;
			J=document.getElementById(st+"1_" + str1);
			/*addEvent(J,'onclick',function (){
			if(st=='ds'){
				url='/vod/info.php?ty='+ty;
			}else{
				url='/news/info.php?ty='+ty;
			}
			location.href=url;
			});
			*/
			document.getElementById(st+"_" + str1).style.display = "block";
		}
		else
		{	
			document.getElementById(st+"1_" + i).className='i_'+hd2;
			document.getElementById(st+"_" + i).style.display = "none";
		}
	}	
}

// JavaScript Document
//设为首页
function setHomePage()
{
	if(document.all)
	{
		var obj = document.links(0);
		if (obj)
		{
			obj.style.behavior = 'url(#default#homepage)';
			obj.setHomePage(window.location.href);
		}
  	}
	else
	{
		if(window.netscape)
		{
			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', window.location.href);
   	}
}

//加入收藏
function addFavorite()
{
	var url		= document.location.href;
	var title	= document.title;
	if (document.all)
	{
		window.external.addFavorite(url,title);
	}
	else if (window.sidebar)
	{
		window.sidebar.addPanel(title, url,"");
	}
}
function u_sub(i){
	if(i==1){
		document.getElementById("r1").src="/images/r_1.jpg";
		document.getElementById("r2").src="/images/r_2.jpg";
		document.getElementById("lb").value=1;
	}
	else{
		document.getElementById("r1").src="/images/r_11.jpg";
		document.getElementById("r2").src="/images/r_22.jpg";
		document.getElementById("lb").value=2;
	}
	
}
function T_change(){
	var lb=document.getElementById("lb").value;
	if(lb==1){
		location.href='/reg.php';
	}else{
		location.href='/reg.php?Step=unit';
	}
}
/* 最新应聘简历查看滚动 */
function startmarquee(lh, speed, delay, index)
{
    var t;
    var p = false;
    var o = document.getElementById('marqueebox' + index);

    o.innerHTML += o.innerHTML;
    o.onmouseover = function(){p=true}
    o.onmouseout = function(){p=false}
    o.scrollTop = 0;

    function start()
    {
        t = setInterval(scrolling, speed);
        if(!p) o.scrollTop += 2;
    }

    function scrolling()
    {
        if(o.scrollTop%lh != 0)
        {
            o.scrollTop += 2;

            if (o.scrollTop >= o.scrollHeight/2) o.scrollTop = 0;
        }
        else
        {
            clearInterval(t);
            setTimeout(start, delay);
        }
    }

    setTimeout(start,delay);
}

