﻿var SuccessIco="<img src='../images/accept.gif' />";
var ErrorIco="<img src='../images/exclamation.gif' />";
var LoadingIco="<img src='../images/loading.gif' />";

function IframeResize(targObj)
{
 var targWin = targObj.parent.document.all[targObj.name];
 if(targWin != null) {
  var HeightValue = targObj.document.body.scrollHeight;
  if(HeightValue <500){HeightValue =500};
  if (targWin.style.pixelHeight < HeightValue) {
  targWin.style.pixelHeight = HeightValue;
  }
 }
}

function AjaxDo(param,CallBack)
{
   $.getJSON("../inc/AjaxAgent.ashx",param,CallBack);
}

function AjaxDoPost(param,CallBack)
{
   $.post("../inc/AjaxAgent.ashx",param,CallBack);
}

function OnlyNumber()
{
if ( !(((window.event.keyCode >= 48) && (window.event.keyCode <= 57)) || (window.event.keyCode == 13) || (window.event.keyCode == 46)|| (window.event.keyCode == 45)))
{
window.event.keyCode = 0 ;
}
} 

function popwin(strTitle,urlstr, nWidth, nHeight,fnAction) {
   if (nWidth < 10 || nWidth > 1000)
      nWidth = 300;
   if (nHeight < 10 || nHeight > 1000)
      nHeight = 300;

  //popClose();
//  $("#dlgCon").attr("width", nWidth.toString());
//   $("#dlgCon").attr("height", nHeight.toString());
//   $('#dlgCon').attr("src", urlstr);
//  $("#dlgDiv").dialog("enable");
$("#dlgShow").html("<div id='dlgDiv' style='padding:0'><div id='dlgCon' style='padding:0'><iframe id='dlgCon' scrolling='auto' src='" + urlstr + "' frameborder='0' width='" + nWidth.toString() + "' height='" + nHeight.toString() + "'></iframe></div><input id='hdPopState' name='hdPopState' type='hidden' value='0' /><input id='hdPopVal' name='hdPopVal' type='hidden' value='' /></div>");
  //$("#dlgCon").html("<iframe id='dlgCon' scrolling='auto' src='" + urlstr + "' frameborder='0' width='" + nWidth.toString() + "' height='" + nHeight.toString() + "'></iframe>");
  if (fnAction)
       $('#dlgDiv').dialog({ modal: true, title: strTitle, bgiframe: true, resizable: false, height: nHeight, width: nWidth, overlay: { opacity: 0.5, background: 'black' }, close: fnAction });
   else
       $('#dlgDiv').dialog({ modal: true, title: strTitle, bgiframe: true, resizable: false, height: nHeight, width: nWidth, overlay: { opacity: 0.5, background: 'black'} });
}
function emuClick(objT)
{
   if ( $.browser.msie )
       objT.click();          
   else  
   {  
      var   evt   =   document.createEvent("MouseEvents");  
      evt.initEvent("click",true,true);  
      objT.dispatchEvent(evt);  
   }   
}

function popClose() {
//    $('#dlgCon').html("");
    $("#dlgDiv").dialog("destroy").remove();
    //$("#dlgShow").html("<div id='dlgDiv' style='padding:0'><div id='dlgCon' style='padding:0'></div><input id='hdPopState' name='hdPopState' type='hidden' value='0' /><input id='hdPopVal' name='hdPopVal' type='hidden' value='' /></div>");
//    $('#dlgDiv').html("");
//    $('#dlgDiv').html("<div id='dlgCon' style='padding:0'></div><input id='hdPopState' name='hdPopState' type='hidden' value='0' /><input id='hdPopVal' name='hdPopVal' type='hidden' value='' />");
    //$("#dlgDiv").dialog("close");
}
