function getColor(color)
{
	var colorName = new Array("默认风格","淡蓝永恒","蓝色理想","粉红回忆","紫色梦幻","绿色生机");
	var colorValue = new Array("default","skin_5","skin_2","skin_3","skin_4","skin_1");
	for(var i = 0;i < colorName.length;i++)
	{
		if(colorName[i] == color){
			return "http://wh.xafdc.net/web2008/"+colorValue[i]+".css";
		} 
	} 
	 return "http://wh.xafdc.net/web2008/default.css";
}
function setColor(color)
{ 
	var v =getColor(color);
	if(color != ""){
		document.getElementById("setcolor").href=v;
		SetCookie("NTES_TheColor",color,365);
	}
	
}
function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue) +";expires="+expire.toGMTString();
}


      function addBookmark(title) {
                     var url=parent.location.href;
                     if (window.sidebar) { 
                            window.sidebar.addPanel(title, url,""); 
                     } else if( document.all ) {
                     window.external.AddFavorite( url, title);
                     } else if( window.opera && window.print ) {
                     return true;
                     }
       }
function SetHome(obj,vrl){
        try{
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
        }
        catch(e){
                if(window.netscape) {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
                        }  
                        catch (e) 
 { 
                                alert("抱歉！您的浏览器不支持直接设为首页。请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为“true”，点击“加入收藏”后忽略安全提示，即可设置成功。");  
                        }
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',vrl);
                 }
        }
}



timePopup=40;
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
adCount=0;
function initPopup()
{if(!ns && !ie && !w3) return;if(ie) adDiv=eval('document.all.TopAd.style');
else if(ns) 
adDiv=eval('document.layers["TopAd"]');
else if(w3) 
adDiv=eval('document.getElementById("TopAd").style');
if (ie||w3) adDiv.visibility="visible";
else 
adDiv.visibility ="show";
showPopup();
}
function showPopup()
{if(adCount<timePopup*10)
{adCount+=1;
if (ie)
{
	documentWidth  =document.body.offsetWidth/2+document.body.scrollLeft-20;
	documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;
	} else if (ns)
	{
		documentWidth=window.innerWidth/2+window.pageXOffset-20;
		documentHeight=window.innerHeight/2+window.pageYOffset-20;
	} else if (w3)
		{
			documentWidth=self.innerWidth/2+window.pageXOffset-20;
			documentHeight=self.innerHeight/2+window.pageYOffset-20;
		} 
			adDiv.left=documentWidth-250;
			adDiv.top =documentHeight-150; 
			setTimeout("showPopup()",30);
			}else 
			closePopup();
			}
function closePopup()
{
	if (ie||w3)
	{
	adDiv.display="none"; 
	document.all.TopAdNone.style.display="block"
	}
	else adDiv.visibility ="hide";
	}


function SubShow(num){
		for(i=0;i<100;i++){
			if(document.getElementById('topadsblk01menu_t'+i)){
			document.getElementById('topadsblk01menu_t'+i).className='off';
			document.getElementById('topadsblk01_c'+i).style.display='none';
		}
		}
			document.getElementById('topadsblk01menu_t'+num).className='on';
			document.getElementById('topadsblk01_c'+num).style.display='block';
		}
function Today(num){
		for(i=0;i<100;i++){
			if(document.getElementById('tas'+i)){
			document.getElementById('tas'+i).className='PartTab1A';
			document.getElementById('ta'+i).style.display='none';
		}
		}
			document.getElementById('tas'+num).className='PartTab1B';
			document.getElementById('ta'+num).style.display='block';
		}

function tab2(num){
		for(i=0;i<100;i++){
			if(document.getElementById('tbs'+i)){
			document.getElementById('tbs'+i).className='PartTab1A';
			document.getElementById('tb'+i).style.display='none';
		}
		}
			document.getElementById('tbs'+num).className='PartTab1B';
			document.getElementById('tb'+num).style.display='block';
		}

