﻿

function InitializeModalWin() {

  $.fx.speeds._default = 1500;
  $("#InfoModal").dialog({ autoOpen: false });
  $("#InfoModal").dialog({ width: 580 });
  $("#InfoModal").dialog({ height: 330 });
  $("#InfoModal").dialog({ title: "" });
  $("#InfoModal").dialog("option", "zIndex", 10000001);
  //  $("#InfoModal").dialog({ show: "slide", hide: "explode" });
  $("#InfoModal").dialog({ position: "center" });
  //  $("#InfoModal").dialog({ buttons: { "Close": function () { $(this).dialog("close"); } } });
  $("#InfoModal").dialog({ modal: true });
  $("#InfoModal").dialog({ resizable: false });
  $("#InfoModal").dialog({ draggable: false });
  $("#InfoModal").dialog("option", $("#InfoModal").dialog("option", "position"));
  $("a.ui-dialog-titlebar-close").remove();
}


function InfoClicked() {
  $(document).ready(
  function (sender) {

      InitializeModalWin();
      $("#InfoModal").dialog("open");

  });
}



function DisableOpenDialog() {
  $("#btnModelSelection").focus();
}

function DialogCloseClicked() {
  $(document).ready(
  function () {
    $("#InfoModal").dialog("close");
  });
}



function HybridDialogCloseClicked() {
  $(document).ready(
  function () {
    $(activeHybridDiv).dialog("close");
    });
  }

  function HybridWarningClose() {
    alert('Closed noo');
  }

      var activeHybridDiv;
      

    function HybridWarning() {

      $(document).ready(function () {
        var browserType = $.browser;
        if (browserType != null) {
          if (browserType.msie) {
            activeHybridDiv = "#HybridDiv"
            var activeIframe = $("#HybridIFrame").ready(function () {
              //var contenet = GetPagecontent(activeHybridDiv);
            });
          }
          else {
            activeHybridDiv = "#HybridDivFF"
            var activeIframe = $("#HybridIFrameFF").ready(function () {
              //var contenet = GetPagecontent(activeHybridDiv);
            });
          }
        }
      });
      //debugger;
        
        
        $(document).ready(function () {
          $("a.ui-dialog-titlebar-close").remove();
          $.fx.speeds._default = 1500;
          $(activeHybridDiv).dialog({ autoOpen: false });
          $(activeHybridDiv).dialog({ width: 800 });
          $(activeHybridDiv).dialog({ height: 595 });
          $(activeHybridDiv).dialog({ title: "" });
          $(activeHybridDiv).dialog("option", "zIndex", 10000001);
          //  $("#InfoModal").dialog({ show: "slide", hide: "explode" });
          $(activeHybridDiv).dialog({ position: "center" });
          //  $("#InfoModal").dialog({ buttons: { "Close": function () { $(this).dialog("close"); } } });
          $(activeHybridDiv).dialog({ modal: true });
          $(activeHybridDiv).dialog({ resizable: true });
          $(activeHybridDiv).dialog({ draggable: false });
          $(activeHybridDiv).dialog("option", $(activeHybridDiv).dialog("option", "position"));
          $(activeHybridDiv).dialog("open");
        });
      }

      function OpenRedirectDialog() {
        $.fx.speeds._default = 1500;
        $("#RedirectDiv").dialog({ autoOpen: false });
        $("#RedirectDiv").dialog({ width: 750 });
        $("#RedirectDiv").dialog({ height: 'auto' }); // Jim A  5  Dec 2011   TCII-1820  changed to auto from 330
        $("#RedirectDiv").dialog({ title: "" });
        // $("#RedirectDiv").dialog("option", "zIndex", 10000001);  Jim A  5 Dec 2011 TCII-1820  commented out to make sure link works in fiefox
        //  $("#InfoModal").dialog({ show: "slide", hide: "explode" });
        $("#RedirectDiv").dialog({ position: "center" });
        //  $("#InfoModal").dialog({ buttons: { "Close": function () { $(this).dialog("close"); } } });
        $("#RedirectDiv").dialog({ modal: true });
        $("#RedirectDiv").dialog({ resizable: false });
        $("#RedirectDiv").dialog({ draggable: false });
        $("#RedirectDiv").dialog("option", $("#RedirectDiv").dialog("option", "position"));
        $("a.ui-dialog-titlebar-close").remove();
        $("#RedirectDiv").dialog({ closeOnEscape: false });
        $("#RedirectDiv").dialog("open");
      }

    function OpenRedirectDialog() {
        $.fx.speeds._default = 1500;
        $("#RedirectDiv").dialog({ autoOpen: false });
        $("#RedirectDiv").dialog({ width: 750 });
        $("#RedirectDiv").dialog({ height: 'auto' }); // Jim A  5  Dec 2011   TCII-1820  changed to auto from 330
        $("#RedirectDiv").dialog({ title: "" });
        // $("#RedirectDiv").dialog("option", "zIndex", 10000001);  Jim A  5 Dec 2011 TCII-1820  commented out to make sure link works in fiefox
        //  $("#InfoModal").dialog({ show: "slide", hide: "explode" });
        $("#RedirectDiv").dialog({ position: "center" });
        //  $("#InfoModal").dialog({ buttons: { "Close": function () { $(this).dialog("close"); } } });
        $("#RedirectDiv").dialog({ modal: true });
        $("#RedirectDiv").dialog({ resizable: false });
        $("#RedirectDiv").dialog({ draggable: false });
        $("#RedirectDiv").dialog("option", $("#RedirectDiv").dialog("option", "position"));
        $("a.ui-dialog-titlebar-close").remove();
        $("#RedirectDiv").dialog({ closeOnEscape: false });
        $("#RedirectDiv").dialog("open");
    }

//    var hybridContent;
//    var cssContent;
//    function GetPagecontent(activeHybridDiv) {
//      var req = new XMLHttpRequest();
//      req.onreadystatechange = function () {
//        if (req.readyState == 4) {
//          return hybridContent = req.responseText;
//          //hybridContent = hybridContent.toString().replace("</head>", "<style type='Text/css'>" + cssContent + "</style></head>");
//          //$("#HybridAnnouncementContainer").html(hybridContent);

//          // Replace </head> with styling information from the stylesheet
//          //$("#HybridDiv").dialog("open");
//        }
//      }
//      req.open("GET", $("#HybridIFrame"), true);
//      //alert($("#HybridIFrame"));
//      req.send('');
//    }

//    function GetPageCSS() {
//      var req = new XMLHttpRequest();
//      req.onreadystatechange = function () {
//        if (req.readyState == 4) {
//          cssContent = req.responseText;
//        }
//      }
//      req.open("GET", "http://localhost/ThinClientFiles/Hybrid/ENG/styles.css", true);
//      req.send('');
//    }





  




