function g(o){return document.getElementById(o);}
var url = "http://www.adx.hk";
var title = "爱迪星科技";
function sethome(){
	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 addfav(){
	if(document.all){
		 window.external.addFavorite(url,title);
	}else if(window.sidebar){
		window.sidebar.addPanel(title,url, "");
	}
}
//首页产品标题MOV
function mov(a,b,c,d){
	for(i = 1;i <= b; i++){
		g(a+i).className = d+'ot';
	}
	g(a+c).className = d+'ov';
}

function reintxt(n){
	if(n==1){
		if(g("htnum").value==""){
			g("htnum").value="请输入合同编号"
		}
	}
	if(n==2){
		if(g("ygnum").value==""){
			g("ygnum").value="请输入员工编号"
		}
	}
}
function cleartxt(n){
	if(n==1){
		if(g("htnum").value=="请输入合同编号"){
			g("htnum").value=""
		}
	}
	if(n==2){
		if(g("ygnum").value=="请输入员工编号"){
			g("ygnum").value=""
		}
	}
}
function sameheight(diva,divb,wt){
	if(g(diva).scrollHeight>g(divb).scrollHeight){
		g(divb).style.height=g(diva).scrollHeight+wt+'px'
	}else{
		g(diva).style.height=g(divb).scrollHeight+wt+'px'
	}
}
function indexsameheight(){
	if(g("indexld").scrollHeight > (g("rightrda").scrollHeight + g("rightrdb").scrollHeight + 2)){
		g("rightrdb").style.height = g("indexld").scrollHeight - g("rightrda").scrollHeight - 17 + "px"
	}else{
		g("indexld").style.height = g("rightrda").scrollHeight + g("rightrdb").scrollHeight - 13 + "px"
	}
}
function changeh(pic){
	if(pic.scrollHeight < 220){
		pic.style.marginTop = (200-pic.scrollHeight)/2+'px';
	}
}
