// Dont change it with out intimating to me.
function getPopup()
{
    newPopIframe = document.createElement("IFRAME");
	newPopIframe.className = "PopupContainer";
	newPopIframe.id = "PopupContainer";
	newPopIframe.name = "PopupContainer";
    newPopIframe.frameBorder = 0;
    newPopIframe.scrolling = "no";
    newPopIframe.src = _geApplicationRoot + "/images/shim.gif";
    window.document.body.appendChild(newPopIframe);
    return newPopIframe;
}

//Opens an alert box to display some informative message to the user
function AlertUser(message)
{
    loginPopIframe = document.getElementById('PopupContainer');
    if(loginPopIframe == null)
    {
        loginPopIframe =  getPopup();
    }    
    loginPopIframe.src = _geApplicationRoot + '/PopUps/PopUpWindow.aspx?popUpType=alert&msgVal=' + message;
    loginPopIframe.style.visibility = "visible";    
}


//invokes AlertUser after the set timeout period
function ThrowAlert(message, redirectUrl)
{   
    if (document.getElementById("RedirectionPath")!= null) 
    {
        document.getElementById("RedirectionPath").value = redirectUrl;
    }
    setTimeout("AlertUser('" + message + "')", 2000);
}

function ClosePopBox()
{    
    parent.document.getElementById('PopupContainer').style.visibility = "hidden";
    parent.document.getElementById('PopupContainer').src = "about:blank";
    if(parent.document.getElementById("RedirectionPath").value  != "")
    {
        parent.document.location = _geApplicationRoot + parent.document.getElementById("RedirectionPath").value ; // '/Users/Registration.aspx';
    }
}

function PopDelete()
{
    parent.document.getElementById('PopupContainer').style.visibility = "hidden";
    parent.document.getElementById('PopupContainer').src = "about:blank";    
}