﻿
var oPopup = window.createPopup();

function Iris_Popup(w,h,t) 
{
    var oPopBody = oPopup.document.body;
    oPopBody.style.backgroundColor = "lightyellow";
    oPopBody.style.border = "solid black 1px";
    oPopBody.innerHTML    = t;
    oPopup.show(100, 100, w, h, document.body);
}

function Iris_WindowOpen(w,h,u)
{
   var arg = "height="+h+",width="+w+",status=yes,toolbar=no,menubar=no,location=no";
   window.open(u,null,arg);
}

function Iris_TrapKD(btn, event){

    if (document.all)
    {
        if (event.keyCode == 13){
            event.returnValue=false;
            event.cancel = true;
            btn.click();
        }
    }

    else if (document.getElementById)
    {
        if (event.which == 13)
        {
            event.returnValue=false;
            event.cancel = true;
            btn.click();
        }
    }

    else if(document.layers)
    {
        if(event.which == 13)
        {
            event.returnValue=false;
            event.cancel = true;
            btn.click();
        }
    }
}
// Call the function below to change "ReturnUrl" parameter to "Source"
var qStr = querySt("ReturnUrl");
window.location = window.location.pathname + "?" + newQStr + qStr;

function querySt(qStrToCheck) {

    destUrl = window.location.search.substring(1);
    qStrSplit = destUrl.split("=");
    if (qStrSplit[0] == qStrToCheck) {
        newQStr = "Source=";
    }
    querySplit = destUrl.split("&");
    for (i = 0; i < querySplit.length; i++) {
        qStrToSplit = querySplit[i].split("=");
        if (qStrToSplit[0] == qStrToCheck) {
            return qStrToSplit[1];
        }
    }
}