﻿$(function() {
    $('a[rel*=facebox]').facebox()
});
function openLogin() {

    $("div.topbar").slideUp(100);
    $("div.cerceve").slideDown(200);
    return false;
}
function loginClose() {
    $("div.cerceve").slideUp(200);
    $("div.topbar").slideDown(100);
    return false;
}

function loginpanel1() {

    var un = jQuery("#koinputUser").val();
    var up = jQuery("#koinputPass").val();
    $.ajax({
        type: "POST",
        url: "widget/XHR/onApps.aspx/login",
        data: "{unm:'" + un + "',p:'" + up + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        cache: false,
        beforeSend: function(xhr) {

            jQuery("#loginwait").removeClass("wait2");
            jQuery("#loginwait").addClass("wait2");


        },
        success: function(msg) {

            jQuery("#loginwait").removeClass("wait2");
            if (msg.d != "ok")
                alert(msg.d);
            else {
                location.href = 'default.aspx?login=0k';
            }



        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            jQuery("#loginwait").removeClass("wait2");



        }
    });
    return false;
}

$().ready(function() {

    $("#txtMainbhgsearxh").autocomplete("search.ashx", {
        width: 400,
        selectFirst: false,
        max: 20,
        highlight: false,
        scroll: false,
        minChars: 3,
        multiple: false,
        mustMatch: false,
        autoFill: false
    }).result(function(event, data, formatted) {
        if (data) {
            location.href = 'gate.aspx?did=' + data[1];
            $("#hdselected").val(data[1]);
            $("#selctType").val("id");
        }
    });

});
function searchresult() {
    if ($("#txtMainbhgsearxh").val() != "")
        location.href = "dara.aspx?k=" + $("#txtMainbhgsearxh").val();
}
