﻿// ADD THIS TO CSS - change colours where required

// /*==============  standard popover classes ==============*/
// .po_body {color:#ffffff;}
// .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;}
//        .ok_link {position:absolute; top:56px; left:0px; right:0px; height:52px; border-top:1px solid #e79778;}
//            .ok_btn {position:absolute; top:13px; left:129px; height:20px; width:52px; padding-top:4px; text-align:center; cursor:pointer; background-color:red}
// <!-- if ie CSS OPTION
//.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> - - - This is linked in Includes/headtag.html
// <script language="javascript" type="text/javascript">
//      function UploadPopOver() {
//          fcnShowPopupBySize('ifPopup', 330, 250, 'Upload.aspx?PopupName=ifPopup&Msg=upload'); ('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
}
