﻿// AJAX 
function beginPaging(args) {
    // Animate
    $('#divGrid').fadeOut('normal');
}

function successPaging() {
    // Animate
    $('#divGrid').fadeIn('normal');
}

function failurePaging() {
    alert("Could not retrieve contacts.");
}

$(document).ready(function() {

    $('.numeric').ready(function() {
        $('.numeric').numeric();
    });

    $('.qty').ready(function() {
        $('.qty').numeric();
    });
    $('.number').ready(function() {
        $('.number').numeric();
    });
});

$(document).ready(function() {
    $('.number').blur(function() {
        if ($(this).val().trim()== '') {
            $(this).val(0);
        }
    });
});

$(document).ready(function() {
    $('.qty').blur(function() {
        if ($(this).val().trim() == '') {
            $(this).val(1);
        }
    });
});

$(document).ready(function() {
$(".tablesorter tr").hover(function() {
    // mouseover            
    $(this).addClass('highlight');
}
    , function() {
        // mouseout
        $(this).removeClass('highlight');
    });
});
    $(document).ready(function() {
    $(".tableHighlight tr").hover(function() {
            // mouseover            
            $(this).addClass('highlight');
        }
        , function() {
            // mouseout
            $(this).removeClass('highlight');
        });
    });

function alertconfrimDialog(msg) {
    if (confirm(msg))
        return true;
    return false;
}

function previewWin(id, objid, evt) {

    if (evt) {
        var url = evt.target;
    }
    else {
        evt = window.event;
    }
    var xPos = evt.clientX;
    var yPos = evt.clientY;

    var preview = document.getElementById(objid);
    preview.style.visibility = "visible";
    preview.style.display = "block";
    preview.style.top = (yPos + 20) + "px";

    id.onmouseout = function() {
        preview.style.visibility = "hidden";
        preview.style.display = "none";
    }
}


               
    

