function Getdiv(code){
	return document.getElementById(code);
}
function ResumeError() { 
	return true; 
} 
//window.onerror = ResumeError;
function changecolor(str){
  str.style.backgroundColor='#E8E8E8'; 
}
function changecolor1(str){
  str.style.backgroundColor='#FFFFFF'; 
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers1() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers1.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='block')?'block':(v=='none')?'none':v; }
    obj.display=v; }
}
function showMenu (baseID, divID) {
    baseID = $(baseID);
    divID  = $(divID);
    if (showMenu.timer) clearTimeout(showMenu.timer);
	hideCur();
    divID.style.display = 'block';
	showMenu.cur = divID;
    if (! divID.isCreate) {
        divID.isCreate = true;
        divID.onmouseover = function () {
            if (showMenu.timer) clearTimeout(showMenu.timer);
			hideCur();
            divID.style.display = 'block';
        };

        function hide () {
            showMenu.timer = setTimeout(function () {divID.style.display = 'none';}, 1000);
        }

        divID.onmouseout = hide;
        baseID.onmouseout = hide;
    }
	function hideCur () {
		showMenu.cur && (showMenu.cur.style.display = 'none');
	}
}


function chkform(theform) {
if (theform.use1.value==""){
alert("请输入您的姓名！");
theform.use1.focus(); 
return false;  
 }
if (theform.phone.value=="")
{
alert("请输入您的电话号码！");
theform.phone.focus();
return false;
}
if (theform.email.value=="")
{
alert("请输入您的e-mail！");
theform.email.focus();
return false;
}
if (theform.email.value!='') 
{ 
if (!((theform.email.value.indexOf('.') > 0)&& (theform.email.value.indexOf('@') > 0)))
 {
  alert('对不起，您输入的Email地址不正确，请重试。'); 
  return false; 
  }

}
if (theform.title.value=="")
{
alert("请输入您的留言主题！");
theform.title.focus(); 
return false;
}
if (theform.content1.value=="")
{
alert("请输入您的内容！");
theform.content1.focus();
return false; 
}
}
function chkfrm(theform)
{
if(theform.content.value=="")
{
theform.content.focus();
return false;
}
if(theform.txtlink.value=="")
{
theform.txtlink.focus();
return false;
}
}

/*****************************************************************
* 功能：收藏本页
******************************************************************/
function add_favorite(){
	var title = document.title;
	var url = document.URL;
	if (document.all) {
		window.external.AddFavorite(url,title);
	} else if (window.sidebar) {
		window.sidebar.addPanel(title,url,"");
	}
}

/*****************************************************************
* 功能：设为首页
******************************************************************/
function set_first(obj, 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);    
  }
}  
