function boxs(v){
 window.scrollTo(0,0);
 var bo = document.getElementsByTagName('body')[0];
 var ht = document.getElementsByTagName('html')[0];
 var boht = document.getElementById('boxs');    
 var city="";
 boht.innerHTML = '';
 bo.style.height='auto';
 bo.style.overflow='auto';
 ht.style.height='auto'; 
 if(v == 1 || v==2){   
  if(v==1){
	city= "上海";
  }else if(v==2){
  	city="北京";
  }
  bo.style.height='100%';
  bo.style.overflow='hidden';
  ht.style.height='100%';  
  boht.innerHTML = '<div id="bg"></div><div id="info"><div id="center"><strong><a href="javascript:boxs(0);">关闭</a></strong><div class="infor"><ul><li class="rowL">你确认下次访问时直接进入<span style="color:#ff0000;font-weight:blod;">'+city+'</span>站吗？</li><li class="rowC"><input type="button" value="我确认" onclick="javascript:boxs('+v+'2);"> <input type="button" onclick="javascript:boxs(0);" value="取 消"> <input type="button" value="先去逛逛" onclick="javascript:boxs('+v+'3);"></li></ul></div></div></div>';   
 }
 if(v == 12){
 	window.location.href="http://bj.article.jiehun.com.cn/gocity.php?city=sh";
 }
 if(v == 13){
 	window.location.href="http://sh.jiehun.com.cn";
 }
 if(v == 22){
 	window.location.href="http://bj.article.jiehun.com.cn/gocity.php?city=bj";
 }
 if(v == 23){
 	window.location.href="http://bj.jiehun.com.cn";
 }
} 

function addToFavorites(sTitle, sURL)  {
	  try
	  {
	  	window.external.addFavorite(sURL, sTitle);
	  }
	  catch (e)
	  {
		  try
		  {
		  	window.sidebar.addPanel(sTitle, sURL, "");
		  }
		  catch (e)
		  {
		  	alert("加入收藏失败，麻烦您手动添加!");
		  }
	  }
  }

function SetHome(obj,vrl){
        try{
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
        }
        catch(e){
                if(window.netscape) {
                       try {	
                        	if(confirm('是否将\"'+location.hostname+'\"设为主页？')){
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                        	}
                        }catch (e) {	
                        		var s="此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。";
                                window.alertLay ?alertLay.show({title:'提示',content:s}) : alert(s);
                        }
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',vrl);
                 }
        }
}
