﻿// CREATE BLANK.HTML - No content required just match project doctype
// COPY POPOVER.ASPX - creates first pop over then create pages as required and match the msg= of the function to the div id of the popover required

// ADD THIS TO CSS - change colours where required
// /*==============  standard popover classes ==============*/
// .fadedbg {opacity:0.6; position:fixed; top:0px; left:0px; right:0px; bottom:0px; background-color:#e8edf0; display:none;}
// .popup {position:absolute; border:1px solid #d7d7d7; display:none;}
// .po_close {position:absolute;right:10px;top:10px; z-index:100;}
// .po_header {position:absolute; top:10px; left:10px; right:10px; height:35px; z-index:99; border-bottom:1px solid #ec008c;}
//    .po_content {position:absolute; top:55px; left:10px; right:10px; height:165px; padding:10px;}
//          CREATE CSS STYLES INSIDE .PO_CONTENT AS REQUIRED
// <!--[if IE]>
//      <link href="ie.css" rel="stylesheet" type="text/css" />
//    <![endif]-->
//.fadedbg {filter:alpha(opacity=40); position:fixed; top:0px; left:0px; right:0px; bottom:0px; background-color:#e8edf0; display:none;}

// ADD THIS TO HTML HEAD TAG
// <script language="javascript" type="text/javascript" src="js/Popup.js"></script>
// <script language="javascript" type="text/javascript">
//      var flashvars = {};
//        flashvars.wmode = "transparent";
//        var params = {};
//        params.wmode = "transparent";
//        function PopOver() {
//          fcnShowPopupBySize('ifPopup', 330, 250, 'popover.aspx?PopupName=ifPopup&Msg=hello'); //('iframe id', width, height, page to call and id of page section to display)
//      }
// </script>

// ADD THIS TO HTML DIRECTLY AFTER BODY TAG
// <div id="divPageCover" class="fadedbg" style="z-index:9998;">&nbsp;</div>
// <iframe id="ifPopup" class="popup" allowtransparency="true" scrolling="no" frameborder="0" src="Blank.html" style="z-index:9999;"></iframe>


function OpenTSRWindow(NewWay) {
    if (NewWay) {
        fcnShowPopup('TSRIframe', 20);
    } else {
        openTechSupport();
    }
}

function fcnResizePopups() {
    if (document.getElementById("TSRIframe").style.display == "block") {
        fcnReducePopup("TSRIframe");
    }
}

function fcnFocusOnPopup(PopupID) {
    var fr = document.getElementById(PopupID);
    fr.document.getElementById("hiddentext").value = "alex";
}

function fcnShowPopupBySize(PopupID, Wid, Hei, strURL) {
    document.getElementById(PopupID).src = strURL;
    setPopupBySize(PopupID, Wid, Hei);
    document.getElementById(PopupID).style.display = "block";
    document.getElementById("divPageCover").style.display = "block";
}

function fcnClosePopup(PopupID, strRedirectURL) {
    if (strRedirectURL != "") { document.getElementById(PopupID).src = strRedirectURL }
    document.getElementById(PopupID).style.display = "none";
    document.getElementById("divPageCover").style.display = "none";
 }

 function setPopupBySize(PopupID, Wid, Hei) {
    var Height = fcnGetHeight();
    var Width = fcnGetWidth();
    var intPopUpHeight = Hei;
    var intPopUpWidth = Wid;
    //var intTop = (Height - intPopUpHeight) / 2;
    var intTop = (fcnGetHeight() - ((fcnGetHeight() / 2)) - intPopUpHeight);
    var intCenter = (Width - intPopUpWidth) / 2;
    //var intCenter = (fcnGetWidth() - ((fcnGetWidth() / 2)) - intPopUpWidth);

    document.getElementById(PopupID).style.height = intPopUpHeight + "px";
    document.getElementById(PopupID).style.top = intTop + "px";
    document.getElementById(PopupID).style.width = intPopUpWidth + "px";
    document.getElementById(PopupID).style.right = intCenter + "px";
    document.getElementById(PopupID).src = document.getElementById(PopupID).src;
}

function fcnGetHeight() {
    return window.screen.height
}

function fcnGetWidth() {
    return window.screen.width
}
