﻿function main() { }


function onPointClick(QueryString, hSize, wSide, divId, hideDiv) {

   
    $(divId).html('');

    var position = $(divId).dialog("option", "position");
    var modal = $(divId).dialog("option", "modal");
    var height = $(divId).dialog("option", "height");
    var width = $(divId).dialog("option", "width");

    //Get the window height and width  
    var winH = $(window).height();
    var winW = $(window).width();

    $(divId).load(QueryString).dialog({
        modal: true,
        height: hSize,
        width: wSide,
        close: function (event, ui) { showChartDivRT(hideDiv, divId); }
    });
    //alert(showChartDiv());
    $(divId).siblings(".ui-dialog-titlebar").hide();
    //Set the popup window to center
    $(divId).css('top', winH / 2 - $(divId).height() / 2);
    $(divId).css('left', winW / 2 - $(divId).width() / 2);
    $(divId).addClass('currently-open-dialog');
    if (hideDiv != "") {
        document.getElementById(hideDiv).style.visibility = 'hidden';
    }

    
}

function showChartDivRT(hideDiv, divId) {
    
    if (hideDiv != "") {
       
        document.getElementById(hideDiv).style.visibility = 'visible';
    }
    
    $('.currently-open-dialog').removeClass('currently-open-dialog').dialog('close');
    $(divId).dialog("destroy");
    $(divId).html("");
    openNewWindow(document.location.href);

}


function openNewWindow(obj) {
    window.location = obj;
}

function DoPostBack(control, eventFn) {
    __doPostBack(control, eventFn);
}

function onSearchClick(ctrlName, ctrlValue) {
    
    if (document.getElementById(ctrlName).value == ctrlValue) {
        document.getElementById(ctrlName).value = "";
        document.getElementById(ctrlName).style.textAlign = "left";
        document.getElementById(ctrlName).style.cursor = "hand";
    }
}

function onSearchMouseOut(ctrlName, ctrlValue) {
    if (document.getElementById(ctrlName).value == "") {
        document.getElementById(ctrlName).value = ctrlValue;
        if (ctrlName == "cmdSearch") {
            document.getElementById(ctrlName).style.textAlign = "Center";
        }
        else {
            document.getElementById(ctrlName).style.textAlign = "Left";
        }
    }
}
