/*Date: 2009-03-11
**Author:caojing
**Description:IsIE hide company_loading
**Where To Use:company页面
*/
function IsIE_hide_company_loading(id)
{
    if (window.navigator.userAgent.indexOf("MSIE")>=1)
    {
        $(id).style.margin='0px -860px';
        $(id).style.display='';
        $(id).style.visibility='visible';
    }
    else //如果浏览器为Firefox
    {
        $(id).style.display='';
    }
}
/*Date: 2009-03-11
**Author:caojing
**Description:hide loding
**Where To Use:company页面
*/
function hide_loding(id){
    if (window.navigator.userAgent.indexOf("MSIE")>=1)
    {
        $(id).style.visibility='hidden';
        $(id).style.display='none';
    }
    else //如果浏览器为Firefox
    {
        $(id).style.display='none';
    }
}
/*Date: 2009-03-11
**Author:caojing
**Description:check the  edit_company
**Where To Use:company页面
*/
function uplode_clear(id){
    var up = (typeof id=="string")?document.getElementById(id):id;
    if (typeof up != "object") return null;
    var tt = document.createElement("span");
    tt.id = "__tt__";
    up.parentNode.insertBefore(tt,up);
    var tf = document.createElement("form");
    tf.appendChild(up);
    document.getElementsByTagName("body")[0].appendChild(tf);
    tf.reset();
    tt.parentNode.insertBefore(up,tt);
    tt.parentNode.removeChild(tt);
    tt = null;
    tf.parentNode.removeChild(tf);
}
/*Date: 2009-03-11
**Author:caojing
**Description:check the  edit_company
**Where To Use:company页面
*/
function check_edit_company_info(){
    var a = true
    $('company_address_isNull').className="hidden";
    $('country_isNull').className="hidden";
    $('error_info_by_country_code').className="hidden";
    $('error_info_by_area_code').className="hidden";
    $('phone_error_info').className="hidden";
    $('error_top_notice').className="hidden";
    $('error_info_for_fax').className="hidden";
    if(isNull($F('company_country'))==true){
        $('country_isNull').className="display";
        $('error_top_notice').className="top_notice";
        a = false;
    }
    if(check_established_on_calendar_date($F('company_established_on')) == false){
        a = false;
        return false;
    }
    if(isNumber($F('phone_country_code'))==false){
        $('phone_error_info').className="display";
        $('error_top_notice').className="top_notice";
        country_code_onblur();
        a = false;
    }
    if(isNumber($F('phone_area_code'))==false){
        $('phone_error_info').className="display";
        $('error_top_notice').className="top_notice";
        area_code_onblur();
        a = false;
    }
    if(isNumber($F('phone_telephone'))==false){
        $('phone_error_info').className="display";
        $('error_top_notice').className="top_notice";
        phone_number_onblur();
        a = false;
    }
    if( isNumber($F('fax_country_code')) == false){
        $('error_info_for_fax').className="display";
        $('error_top_notice').className="top_notice";
        fax_onblur_country()
        a =false;
    }
    if(isNumber($F('fax_area_code')) == false){
        $('error_info_for_fax').className="display";
        $('error_top_notice').className="top_notice";
        fax_onblur_area()
        a =false;
    }
    if(isNumber($F('fax_telephone')) == false){
        $('error_info_for_fax').className="display";
        $('error_top_notice').className="top_notice";
        fax_onblur_register()
        a= false;
    }
    check_error_info();
    return a ;
}