
function popup(URL, width, height)
{
	if (width == null)
	{
		width = 517;
	}
	if (height == null)
	{
		height = 400;
	}
	
	popupWin = window.open(URL, 'PW', 'scrollbars,resizable=no,width=' + width + ',height=' + height + ',left=25,top=25');
}

function videosPopUp(videoName)
{
	window.open("/Multimedia/Videos/VideoShell.htm?videoName=" + videoName + "&trackingCode=" + videoName,"mywindow","width=300,height=300,scrollbars=1,resizable=1");
}

function goToURL(url, Target)
{
	if (Target == '_blank')
	{
		window.open(url)
	}
	else
	{
		window.location = url;
	}
}

/* used in footer; copied from microsite */
function PopWin(URL) 
{
    popupWin = window.open(URL, 'vivilogue', 'height=440,width=670,scrollbars=yes,status=no,resizable=yes');    
    window.top.name = 'opener';
}


function hideContentPopup(contentDiv)
{
    var theBox = document.getElementById(contentDiv);
    theBox.style.display = "none";
}
function showContentPopup(oLink,contentDiv)
{
 /* get X Y coordinates of link which initiated the BPU (Beverage Pop Up) */
 var x = oLink.offsetLeft;
 var y = oLink.offsetTop;
 
 /* get reference to "position:relative" container */
 var theParent = document.getElementById("content");
 var nParentWidth  = theParent.offsetWidth;
 var nParentHeight = theParent.offsetHeight;
 
 /* choose orientation for popup */
 var sVpointType = (y > nParentHeight/2) ? "bot"   : "top";
 var sHpointType = (x > nParentWidth/2 ) ? "Right" : "Left";
 
 /* get reference to holder div */

 var theBox = document.getElementById(contentDiv);
 
 
 /*  Set Left and Top */
 /*theBox.style.top   = y + (sVpointType=='top'  ? 15 : -210) + "px";*/
 /*theBox.style.left  = x + (sHpointType=='Left' ? 0  : -10) + "px";
 theBox.style.width = 320;*/
 
 
 /* Show Hidden Layer */
 theBox.style.display = "block";
}
 
/*********************************************************************************************
	Access Query String Parameters
*********************************************************************************************/

function PageQuery(pageQuery) {
    if(pageQuery.length > 1) this.pageQuery = pageQuery.substring(1, pageQuery.length);
    else this.pageQuery = null;
    this.keyValuePairs = new Array();
    if(pageQuery) 
    {
        for(var i=0; i < this.pageQuery.split("&").length; i++) {
            this.keyValuePairs[i] = this.pageQuery.split("&")[i];
        }
    }
    this.getKeyValuePairs = function() { return this.keyValuePairs; }
    this.getValue = function(s) {
        for(var j=0; j < this.keyValuePairs.length; j++) {
            if(this.keyValuePairs[j].split("=")[0] == s)
                return this.keyValuePairs[j].split("=")[1];
        }
    return false;
    }
    this.getParameters = function() {
        var a = new Array(this.getLength());
        for(var j=0; j < this.keyValuePairs.length; j++) {
            a[j] = this.keyValuePairs[j].split("=")[0];
        }
        return a;
    }
    this.getLength = function() { return this.keyValuePairs.length; }
}

function queryString(key){
    var page = new PageQuery(window.location.search);
    return unescape(page.getValue(key));
}