var newWindow;
var intspacerstrheight;
var strwidth;
var strheight;
var stringurl;
var intadjust;
var intspacerheight;
//we need to default the popup to a min strheight
agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("win")!=-1) {
    intadjust= "0"
} else {
    intadjust= "16"
    }
    
function popUp(strurl,strname,strcolumn,strresize) {
    var appendChar = '?';
    if(strurl.indexOf('?') != -1)
    {
        appendChar = '&';
    }

    if (newWindow) {
        if (newWindow.closed == false) {
            newWindow.close();
        }
    }
    if (strcolumn == "6") {
        strwidth = "800";
        strheight = "550";
        intspacerheight = (parseInt(intadjust) + 488);
    }
    if (strcolumn == "5") {
        strwidth = "680";
        strheight = "450";
        intspacerheight = (parseInt(intadjust) + 387);
    }
    if (strcolumn == "4") {
        strwidth = "550";
        strheight = "450";
        intspacerheight = (parseInt(intadjust) + 387);
    }
    if (strcolumn == "3") {
        strwidth = "420";
        strheight = "350";
        intspacerheight = (parseInt(intadjust) + 287);
    }
    if (strcolumn == "2") {
        strwidth = "290";
        strheight = "300";
        intspacerheight = (parseInt(intadjust) + 237);
    }
    stringurl = strurl+appendChar+"h="+intspacerheight;
    
    if ( (stringurl.substring(0,2)).toLowerCase()=="ww" )
    {
        stringurl =  "http://" + stringurl ;
    }
    
    newWindow = window.open(stringurl,strname,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable='+strresize+',width='+strwidth+',height='+strheight+',left=50,top=200');
}

<!--    /** Added for Deep linking javascript. **/ -->

function buildcontext(link)
{
    prevUrl=link.href;
    parameters=prevUrl.slice(prevUrl.indexOf("?"));
    prevPathname=link.pathname;
    actualUrl=contextRoot+"/"+prevPathname+parameters;
    link.href=actualUrl;
}

<!--    /** Change for Deep linking javascript ends. **/ -->

<!--    /** Added for Deep linking javascript for popups. **/ -->

function popup(link, windowSize)
{
    prevUrl=link.href;
    parameters=prevUrl.slice(prevUrl.indexOf("?"));
    prevPathname=link.pathname;
    actualUrl=contextRoot+"/"+prevPathname+parameters;
    //link.href=actualUrl;
    if(windowSize == '')
    {
    	windowSize = '3';
    }
    popUp(actualUrl,'DeepLink',windowSize,'0');
    
}

<!--    /** Change for popup Deep linking javascript ends. **/ -->
