function change_faceimg(img_obj,chg_obj) {
    var imgobj=document.getElementById(img_obj);
    imgobj.src=chg_obj.options[chg_obj.selectedIndex].value;
}
function droplist_pageurl(pageurl,chg_obj) {
    parent.location=pageurl + chg_obj.options[chg_obj.selectedIndex].value;
}
function user_login_chk()
{
    var username=document.login_frm.username.value;
    var password=document.login_frm.password.value;
    var valcode=document.login_frm.valcode.value;
    if (username=="" || username==null)
    {
        alert("请填写用户名！");
        document.login_frm.username.focus();
        return false;
    }
    if (password=="" || password==null)
    {
        alert("请填写密码！");
        document.login_frm.password.focus();
        return false;
    }
    if (valcode=="" || valcode==null)
    {
        alert("请填写验证码！");
        document.login_frm.valcode.focus();
        return false;
    }
}
function search_chk()
{
  var keywords=document.search_frm.keywords.value;
  if (keywords=="" || keywords==null || keywords=="请输入关键字")
  {
    alert("请输入搜索关键字！");
    document.search_frm.keywords.focus();
    return false;
  }
}
function agentsearch_chk()
{
  var keywords_1=document.agent_searchfrm.topicword.value;
  var keywords_2=document.agent_searchfrm.lxnameword.value;
  if ((keywords_1=='' || keywords_1==null || keywords_1=='请输入名称') & (keywords_2=='' || keywords_2==null || keywords_2=='请输入联系人'))
  {
    alert("请输入搜索关键字！");
    return false;
  }
}
function open_alinkurl(sel_var,selObj)
{
    if (selObj)
    {
        var selected_val;
        selected_val=selObj.options[selObj.selectedIndex].value;
        if (selected_val!=sel_var)
        {
            window.open(selected_val,"alink_url");
        }
        else
        {
            return;
        }
    }
}
var open_winobj;
function open_newwindow(url_var,win_name)
{
    var win_width=screen.width;
    var win_height=screen.height;
    if (open_winobj)
    {
        open_winobj.close();
        open_winobj=null;
        open_winobj=window.open(url_var,win_name,"width=" + win_width + ",height=" + win_height + ",top=0,left=0,scrollbars=1, resizable=yes");
    }
    else
    {
        open_winobj=window.open(url_var,win_name,"width=" + win_width + ",height=" + win_height + ",top=0,left=0,scrollbars=1, resizable=yes");
    }
}
function open_newwin(url_var,win_name)
{
    var win_width=screen.width/2;
    var win_height=screen.height/2;
    window.open(url_var,win_name,"width=" + win_width + ",height=" + win_height + ",top=0,left=0,scrollbars=1, resizable=yes");
}
function addFavorite(site_url,site_name)
{
    var the_pagetitle=site_name;
    var the_pageurl=site_url;
    if(the_pageurl=="")
    {
        the_pageurl=window.location.href;
    }
    if(the_pagetitle=="")
    {
        the_pagetitle=document.title;
    }
    if (window.sidebar) {
        window.sidebar.addPanel(the_pagetitle,the_pageurl,"");
    } else if(document.all) {
        window.external.addFavorite(the_pageurl,the_pagetitle);
    } else if(window.opera && window.print) {
        return true;
    }
}
function setHomePage(site_url)
{
    var the_pageurl=site_url;
    if(the_pageurl=="")
    {
        the_pageurl=window.location.href;
    }
    if (document.all){
        document.body.style.behavior='url(#default#homepage)';
        document.body.setHomePage(the_pageurl);
    }
    else if(window.sidebar) {
        if(window.netscape){
            try{
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }catch (e){
                alert( "由于浏览器原因，该操作取消！" );
            }
        }
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage',the_pageurl);
    }
}
function get_pagetitle(split_chr,new_pagetit)
{
    var titleitems,return_title;
    var the_pagetitle=document.title;
    titleitems=the_pagetitle.split(split_chr);
    return_title=the_pagetitle;
    if(titleitems[1])
    {
        return_title=the_pagetitle.replace(titleitems[1],new_pagetit)
    }
    else
    {
        if(new_pagetit)
        {
            return_title=the_pagetitle & split_chr & new_pagetit;
        }
    }
    return return_title;
}