function nikPopUp(url,name,w,h) {
    var addscroll = 'no';
    if(screen.availWidth < 1000) {
        w = getWidth() - 25;
        h += 25;
        addscroll = 'yes';
    }
    
    if(screen.availHeight < 830) { 
        h = getHeight() - 25;
        w += 25;
        addscroll = 'yes';
    }
    var winvars = 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars='+ addscroll +', resizable=yes, copyhistory=no, width=' + w + ', height=' + h +', top=0, left=0';
    var nikWindow = window.open(url,name,winvars);
    nikWindow.focus();
}

function getWidth()
{
        var x = 0;
        if (self.innerHeight)
        {
                x = self.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                x = document.documentElement.clientWidth;
        }
        else if (document.body)
        {
                x = document.body.clientWidth;
        }
        return x;
}

function getHeight()
{
        var y = 0;
        if (self.innerHeight)
        {
                y = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                y = document.documentElement.clientHeight;
        }
        else if (document.body)
        {
                y = document.body.clientHeight;
        }
        return y;
}
