function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}
function switchmodTag(modtag,modcontent,modk) {
	for(i=1; i <11; i++) {
	  if (i==modk) {
		document.getElementById(modtag+i).className="menuOn";document.getElementById(modcontent+i).className="slidingList";}
	  else {
		document.getElementById(modtag+i).className="menuNo";document.getElementById(modcontent+i).className="slidingList_none";}
	}
}
function addFav(){
	if (document.all) {
	   window.external.addFavorite(window.location.href, document.title);
	} else if (window.sidebar) {
	   window.sidebar.addPanel(document.title, window.location.href, "");
	}
}

function setHomepage(){
	if (document.all) {
	   document.body.style.behavior = 'url(#default#homepage)';
	   document.body.setHomePage(window.location.href);
	} else if (window.sidebar) {
	   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', window.location.href);
	}
}
function ResetImageSize(e,mWidth)
{
	var image=new Image();
	image.src=e.src;
	var w=image.width;
	var h=image.height;
	if(w>mWidth)
	{
		e.width=mWidth;
		e.height=h*mWidth/w;
	}
}
function addsj(){
	document.f1.action="/user/shujia.php?action=add";
	document.f1.method="post";
	document.f1.submit();
}