﻿//// JScript File
function ClearAlert(){
    AjaxMethods.ClearAlert(ClearAlert_cb);
}

function ClearAlert_cb(){
    
}

function AddCommas(obj,bIsCurrency){
    var val = obj.value;
    if (val.trim != '') {
        AjaxMethods.AddCommas(val,obj.id,bIsCurrency,AddCommas_cb);
    }
}

function AddCommas_cb(ret){
    if (ret.error == null) {
        var sVal = ret.value.split('|')
        var obj = document.getElementById(sVal[1]);
        
        if (!obj) {
            alert(ret.value);
            alert(sVal[1]);
        } else {
            obj.value = sVal[0];
        }
    }
    else {
        alert(ret.error);
    }
}

function pageLoad(sender, args) {
    $addHandler(document, "keydown", OnKeyPress);
   
    $find("ajxModalPopupExtender").add_showing(onModalShowing);
}

function OnKeyPress(args){
    if(args.keyCode == Sys.UI.Key.esc)
    {
        $find("ajxModalPopupExtender").hide();
    }
} 
/*This is used for the hover extender mouseover*/
function rowMouseover(obj){
    obj.style.backgroundColor = 'gainsboro';
}
function rowMouseout(obj){
    obj.style.backgroundColor = 'white';
}
/*This is used to help toggle the standard row /alt row colors*/
function dataMouseover(obj) {
    obj.style.backgroundColor = '#FFFF80';/*Pinkish -'#FFC0FF'*//*Greenish -'#C0FFC0'/*Pale Yellowish-'#FFFF80';*/
    obj.style.cursor = 'hand';
}
function dataMouseout(obj,index){
    var sColor;
    obj.style.cursor = '';
    
    if (index % 2) {
        sColor = 'cornsilk'
    } 
    else {
        sColor = 'papayawhip'
    }
    
    obj.style.backgroundColor = sColor;
}
