function openDisplayWindow(type, param0, param1, param2, param3, param4)
{

	var width;
	var height;
	var vidWin;
	var theURL;

	switch(type.toLowerCase()) {
		case 'video': {
			if(param0 != null && param0.indexOf('/') > -1)
			{
			

				openVideoWindow(param0, param1, param2);
			}
			else
			{
			

				if(param2 == null) {
					width = 450;
				}
				else{
				   width = param2;
				}
				if(param3 == null) {
					height = 422;
				}
				else {
				    height = param3;
				}
				  theURL = 'http://www.avid.com/video/video_window.asp?vidName='+param0+'&videoID='+ param1;
				  vidWin = window.open(theURL,'videoWin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height+'');
				  vidWin.focus();
			}

			break;
		}

		case 'flash': {

		    width = param1;
			height = param2;
			if(param0 != null && param0.indexOf('/') > -1)
			{
  			    openFlashWin(param0, width, height);
			}
			else
			{
			  	openFlashDemo(param0, width, height);
			}
			break;
		}
		case 'flv': {
		      openFLVWin(param0, param1, param2);
			  break;

		}

		case 'browse': {
			  MM_openBrWindow(param0, param1, param2);
			  break;
		}

		default:{
		   if(param0 != null && param1 != null && param2 != null &&  param3 == null &&  param4 == null)
		   {
		      window.open(param0,param1,param2);
		   }
		   else
		   {
			   if(param1 == null && param2 == null &&  param3 == null &&  param4 == null)
			   {
				  openBcastAnim(param0);
			   }
			   else
			   {
				   if(param1 != null && param2 == null &&  param3 == null &&  param4 == null)
				   {
					  openBrWindow(param0, param1);
				   }
				   else
				   {

					window.open(param0,"Avid");
					}
				}
			}
			break;
		}
   }
}

function openVideoWin(token,videoID) {
  var vidWin;
  winWidth='450';
  winHeight='422';
  theURL = 'http://www.avid.com/video/video_window.asp?vidName='+token+'&videoID='+videoID;
  vidWin = window.open(theURL,'videoWin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+winWidth+',height='+winHeight+'');
  vidWin.focus();
}

//this one passes in different data
//openVideoWindow('/video/video_window.asp?vidName=mca_overview&videoID=89', 422, 450)
function openVideoWindow(theURL,wW, wH) {
  var vidWin;
  winWidth=wW;
  winHeight=wH;
  vidWin = window.open(theURL,'videoWin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+winWidth+',height='+winHeight+'');
  vidWin.focus();
}

function openFlashWin(flash,fWidth,fHeight) {
	var flashWin;
	var winWidth;
	var winHeight;
	winWidth = fWidth;
	winHeight = fHeight;
	flashWin = window.open(flash,'flashWin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+winWidth+',height='+winHeight+'');
	flashWin.focus();
}


function openFLVWin(flash,fWidth,fHeight) {
	var flashWin;
	var winWidth;
	var winHeight;
	winWidth = fWidth + 250;
	winHeight = fHeight + 250;
	flashWin = window.open('http://www.avid.com/video/FLVOnlyPlayer.asp?video='+flash+'&width='+fWidth+'&height='+fHeight,'flashWin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+winWidth+',height='+winHeight+'');
	flashWin.focus();
}



//opens up a flash piece in a new window; pass in flash piece url (swf only), width and height
function openFlashDemo(flash,fWidth,fHeight) {
	var flashWin;
	flashWin = window.open('http://www.avid.com/flash/flashWindow.asp?flash='+flash+'&width='+fWidth+'&height='+fHeight,'flashWin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+fWidth+',height='+fHeight);
	flashWin.focus();
}

//opens content in new window
function openBrWindow(theURL,winName) {
  brWidth=900;
  brHeight=680;
  features = 'scrollbars=yes,resizable=yes,width='+brWidth+',height='+brHeight;
  newWin = window.open(theURL,winName,features);
}
function openBcastAnim(theURL) {
  bcastWidth=1010;
  bcastHeight=740;
  features = 'toolbar=0,location=0,directories=0,menubar=0,scrollbars=0,status=0,width='+bcastWidth+',height='+bcastHeight;
  newWin = window.open(theURL,'BcastAnim',features);
}

//share function to open new windws
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
// BEGIN Main Navigation - DO NOT REMOVE //
var numSubNavs=6;
var sectionName='SecNav_';
var subMenuOffset=0;
var subNavTop='160px';
function ShowNav(id) {
}
function hideThis(id) {
}
function hideElements(){
}
// END Main Navigation - DO NOT REMOVE //
// BEGIN Show tabs //
function showTab(sTab,nTabs) {
    //var x;
    //var t;
    //x=0;
    //do {
        //x++;
        //t='tab'+x;
        //document.getElementById(t).style.display='none';
    //}
    //while (x < nTabs);
    //document.getElementById(sTab).style.display='block';
    //document.getElementById(sTab).className='selected';
    
}
// END Show tabs //
// BEGIN Country Selector
function countrySelector() {
	document.getElementById('cs_sitelist').style.display='block';

}
function closeSelector() {
	document.getElementById('cs_sitelist').style.display='none';
}
// END Country Selector

// allows for a jumplist dropdown
function jumpMenu(url){
	url = url.value;
	location.href = url;
}




// ~~~~~~~~ test area ~~~~~~~~ \\
function navHoverStyle(navID) {
}
var d = document;
//var sidebar_original_height = 0; // var used for fix: client-side script expanded content flows over footer
function evenColumns() {
	if (d.getElementById) { // determine if browser uses DOM
		var main_panel = d.getElementById('main_panel');
		var sidebar = d.getElementById('sidebar');
		if (sidebar != null) {
			if (main_panel.offsetHeight >= sidebar.offsetHeight) {
				sidebar.style.height = (main_panel.offsetHeight) + 'px';
				main_panel.style.height = (main_panel.offsetHeight) + 'px';
			} else if (sidebar.offsetHeight >= main_panel.offsetHeight) {
				main_panel.style.height = (sidebar.offsetHeight) + 'px';
				sidebar.style.height = (sidebar.offsetHeight) + 'px';
			}
		    sidebar_original_height = sidebar.style.height; // var added for fix: client-side script expanded content flows over footer
		}
	}
}
//window.onload = function() {
	//evenColumns();
//}

// ~~~~~~~~ end test area ~~~~~~~~ \\

// ~~~~~~~~functions used for fix: client-side script expanded content flows over footer ~~~~~~~~ \\
 function evenColumnsAgain() {
    // the columns' heights may have been changed after load by client-side script,
    // so adjust them again here.
    if (d.getElementById) { // determine if browser uses DOM
        var main_panel = d.getElementById('main_panel');
        var sidebar = d.getElementById('sidebar');
        //alert('sidebar_original_height=' + sidebar_original_height); 
        if (sidebar != null) { 
            if (main_panel.offsetHeight >= sidebar_original_height) {
	            sidebar.style.height = (main_panel.offsetHeight) + 'px';
	            main_panel.style.height = (main_panel.offsetHeight) + 'px';
            } else if (sidebar_original_height >= main_panel.offsetHeight) {
	            main_panel.style.height = (sidebar_original_height) + 'px';
	            sidebar.style.height = (sidebar_original_height) + 'px';
            }
       } 
    }
}

function resizePanelHeight(divId, expand) {
    // adjust the height of the main content panel to reflect any client-side expanding or collapsing of divs, so that the content does not flow over the footer.
    // params:
    // divId: id of div that will be expanded or collapsed - so that we can get the height of it.
    // expand: 'true/false' - true if div will be expanded.
    if (d.getElementById) { // determine if browser uses DOM
        var main_panel = d.getElementById('main_panel');
        var div = d.getElementById(divId); 
        if (div != null) { 
            var height = 0; 
            // now increase/decrease height of content area
            if (expand == true){
                // get the height of the div AFTER expanding it.
                div.style.display='block'; 
                height = div.offsetHeight
                main_panel.style.height = (main_panel.offsetHeight + height) + 'px';
            }
            else{
                // get the height of the div BEFORE collapsing it.
                height = div.offsetHeight
                div.style.display='none';
                main_panel.style.height = (main_panel.offsetHeight - height) + 'px';
            } 
       } 
    }
    // now readjust all columns
    evenColumnsAgain();
}

// ~~~~~~~~end - functions used for fix: client-side script expanded content flows over footer ~~~~~~~~ \\

