﻿function showPopup(url,width,height)
{   
    var pheight,pwidth;
    pheight = parseInt(height);
    pwidth = parseInt(width);

    if(pheight != 0 && pwidth !=0)
    {
	Modalbox.show(url,{title: 'Event Details', width: width, height: height});
    }
    else if(pheight == 0 && pwidth !=0)
    {
	Modalbox.show(url,{title: 'Event Details', width: width});
    }
    else if(pheight != 0 && pwidth ==0)
    {
	Modalbox.show(url,{title: 'Event Details',height: height});
    }
    else
    {
    	Modalbox.show(url,{title: 'Event Details'});
    }
}

function ClosePopup()
{
    Modalbox.hide();
}

function Redirect(url)
{
    window.location =url;
}

function GetContentHeight()
{
  var byHeight = GetHeight();
  Modalbox.resize(-1,byHeight);
}

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;
}