﻿/// <reference path="jquery-1.4.1.js" />
var www = {
    SetHomePage: function (obj) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                prefs.setCharPref('browser.startup.homepage', location.href.toString());
            }
            catch (e) { alert("此操作被Firefox拒绝！\r\n请在浏览器地址栏输入“about:config”并回车\r\n然后将[signed.applets.codebase_principal_support]设置为'true'"); }
        }
        else { obj.style.behavior = 'url(#default#homepage)'; obj.setHomePage(location.href.toString()); }
    },
    AddFav: function () {
        var title = document.title.toString();
        var url = window.location.href.toString();
        if (document.all)
            window.external.AddFavorite(url, title);
        else if (window.sidebar)
            window.sidebar.addPanel(title, url, "")
    },
    showzixun: function (url) {
        window.open(url, 'zx', 'status=yes,width=600,height=400');
    },
    showorder: function (url) {
        window.open(url, 'order', 'status=yes,width=600,height=400');
    }
}

function showAnn(a) {
    if (a == '1') {
        document.getElementById('ann1').style.display = '';
        document.getElementById('ann2').style.display = 'none';
        $('#h_ann1').addClass('current');
        $('#h_ann2').removeClass('current');
    }
    else {
        document.getElementById('ann1').style.display = 'none';
        document.getElementById('ann2').style.display = '';
        $('#h_ann2').addClass('current');
        $('#h_ann1').removeClass('current');
    }
}

function showmenu(obj) {
//    $('.topnav a').removeClass('current');
//    $(obj).addClass('current');
//    for (var i = 1; i <= 10; i++) {
//        $('#n' + i).hide();
//    }
//    $('#n' + obj.lang).show();
}

function chkJY()
{
    if(document.getElementById('orderid').value=='' || document.getElementById('wunit')=='' || document.getElementById('stime').value=='' || document.getElementById('etime').value=='')
    {
    alert('请核准填写的信息!');
        return false;
    }
}

function chkZS()
{
   if(document.getElementById('zs_sn').value=='' && document.getElementById('zs_unit').value=='')
   {
   alert('请核准填写的信息!');
   return false;
   }
   else
   {
   var isgo=true;
        var url='zhengshu.aspx?act=check'
        var data=$('#zsform').serialize();
        $.ajax({
        type: 'GET',
        url: url,
        data: data,
        async: false,
        success: function (html) {
                if (html == '0') {
                    isgo=false;
                }
            }
        });

        if(!isgo)
        {
            alert('请核准填写的信息!')
            return false;
        }
   }
}

