function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;


function setHome(obj,url){
	try {
		obj.style.behavior = 'url'+'(#default#homepage)';
		obj.setHomePage(url);
	} 
	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',url);
		}
	}
}
function gototelcom(){
var subdir = window.location.href.substring(0,window.location.href.lastIndexOf('surmap.com')+10);
var suburl = window.location.href.substring(subdir.length,window.location.href.length+1);
window.location.href='http://www.surmap.com'+suburl;
}
function gotocdn(){
var subdir = window.location.href.substring(0,window.location.href.lastIndexOf('surmap.com')+10);
var suburl = window.location.href.substring(subdir.length,window.location.href.length+1);
window.location.href='http://cnc.surmap.com'+suburl;
}
