function GE(a){return document.getElementById(a);}
function myAddPanel(title,url,desc) { 
	if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function')){ 
		window.sidebar.addPanel(title,url,desc); 
	}else{ 
		window.external.addFavorite(url,title); 
	} 
} 

function setHomepage(url){
	if(document.all){
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(url);
	}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',url);
	}
}

function Search_act(){
	if(document.formS.keywords.value.replace(/(^\s*)/g,"")==''||document.formS.keywords.value=='请输入关键词后按回车'){
		alert ("请输入关键词");
		document.formS.keywords.focus();
		return false;
	}
}

var al1 = "请输入你嘅称谓";
var al2 = "係唔係都写啲嘢 唔好求其乱咁嘢";
function inp_on(a){
	if(a.value==al1) a.value="";
	GE("chatI").className = "inp_on";
}
function inp_off(a){
	if(a.value=="") a.value=al1;
	GE("chatI").className = "inp_off";
}
function tea_on(a){
	if(a.value==al2) a.value="";
	GE("chatR").className = "tea_on";
}
function tea_off(a){
	if(a.value=="") a.value=al2;
	GE("chatR").className = "tea_off";
}
function inp2_on(a){
	GE("chatV").className = "inp2_on";
}
function inp2_off(a){
	GE("chatV").className = "inp2_off";
}
function chat_act(){
	if(document.chatS.nam.value.replace(/(^\s*)/g,"")==''||document.chatS.nam.value==al1){
		alert (al1);
		document.chatS.nam.focus();
		return false;
	}
	if(document.chatS.nam.value.replace(/(^\s*)/g,"").toLowerCase()=='eaming'||document.chatS.nam.value.replace(/(^\s*)/g,"").toLowerCase()=='eam'){
		alert ("你宜家係唔係玩嘢？");
		document.chatS.nam.focus();
		return false;
	}
	if(document.chatS.tex.value.replace(/(^\s*)/g,"")==''||document.chatS.tex.value==al2){
		alert (al2);
		document.chatS.tex.focus();
		return false;
	}
	if(document.chatS.verify.value.replace(/(^\s*)/g,"")==''){
		alert ("请输入右边嘅数字");
		document.chatS.verify.focus();
		return false;
	}
}

function onload_fun(){
	var tex = "<div id=\"bc1\">";
	tex += "<a href=\"http://validator.w3.org/check?uri=referer\" target=\"_blank\"><img src=\"http://validator.w3.org/images/valid_icons/valid-xhtml10\" alt=\"Valid XHTML 1.0 Transitional\" height=\"31\" width=\"88\" /></a>";
	tex += "<a href=\"http://jigsaw.w3.org/css-validator/check/referer\" target=\"_blank\"><img src=\"http://jigsaw.w3.org/css-validator/images/vcss-blue\" alt=\"Valid CSS!\" height=\"31\" width=\"88\" /></a>";
	tex += "</div>";
	tex += "<div id=\"bc2\"><div class=\"f_l\">剪不断 理还乱</div><div class=\"f_r\">剪断咗 仲加乱</div></div>";
	GE("bc").innerHTML = tex;
}


