// JavaScript Document
function  addCookie() {   //  加入收藏夹
   if  (document.all) {
	  window.external.addFavorite('http://www.organtransplantation.cn','中山大学器官移植研究所');
  }
   else   if  (window.sidebar) {
  window.sidebar.addPanel('中山大学器官移植研究所','http://www.organtransplantation.cn',"");
  }
}

function  setHomepage() {   //  设置首页
   if  (document.all) {
	  document.body.style.behavior='url(#default#homepage)';
	  document.body.setHomePage('http://www.organtransplantation.cn');

  }
   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','http://www.organtransplantation.cn');
  }
}


  
function Forward2Log(){
 var indexUrl = "login.jsp?url="+getUri();                
  window.location.href =indexUrl;
}

function Forward2reg(){
 var indexUrl = "register.jsp?url="+getUri();                
  window.location.href =indexUrl;
}

function getUri(){
	var u = window.location.pathname;
	return IsRootContextPath?u:u.substring(u.indexOf('/html'),u.length);
}

function logout(){
      if (window.confirm("您 真 的 要 退 出 吗?")){
        var logoutUrl = buildServUrl('doLoginAction')+'?Action=doLogout';  //buildServUrl('doLoginAction')+'?Action=doLogout';
        $.ajax({
          url : logoutUrl,cache :false,
          success : function(sRtn){
            if (sRtn=='1') {
              location=location;
            }
          }
        }); 
     }  
}