function resizeCurrentWindow()
{
  if (window.screen) 
  {
    window.moveTo(0, 0);
    window.resizeTo(screen.availWidth, screen.availHeight);
  }
}

function open_media(file_name, width, height) {
	var re = new RegExp ('&', 'gi') ;
	vids = window.open("/live/video_popup.php?filename=" + file_name.replace(re,'%26') + "&width=" + width+ "&height=" + height, "_blank", "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=no,toolbar=no,titlebar=no,location=no,locationbar=no,directories=no,status=no,menubar=no,personalbar=no,left=20,top=20")
}

function open_listen(id, listen) {
	lis = window.open("listen_popup.php?listen=" + listen + "&id=" + id, "_blank", "width=230,height=242,resizable=yes,scrollbars=no,toolbar=no,titlebar=no,location=no,locationbar=no,directories=no,status=no,menubar=no,personalbar=no,left=20,top=20")
}

function open_directions(id) {
	var ieMac = (navigator.platform.indexOf("Mac") != -1 && document.all) ? true : false
	if(ieMac)
		dirs = window.open("/live/directions.php?id=" + id + "", "_blank", "width=329,height=148,resizable=yes,scrollbars=yes,toolbar=no,location=no,locationbar=no,directories=no,status=no,titlebar=no,menubar=no,personalbar=no,left=20,top=20")
	else
		dirs = window.open("/live/directions.php?id=" + id + "", "_blank", "width=330,height=148,resizable=yes,scrollbars=no,toolbar=no,location=no,locationbar=no,directories=no,status=no,titlebar=no,menubar=no,personalbar=no,left=20,top=20")
}

function resize(elementID)
{
	myElement = document.getElementById(elementID);
	theWidth = Number(myElement.offsetWidth);
	theHeight = Number(myElement.offsetHeight);
	window.resizeTo(340, theHeight);
}

function comingSoon()
{
	alert("This item will be updated soon");
}

function resize_window(width, height)
{
	var nn = (navigator.appName == "Netscape" || document.layers) ? true : false
	var ie = document.all ? true : false
	var ieMac = (navigator.platform.indexOf("Mac") != -1 && document.all) ? true : false
	var xp = (navigator.userAgent.indexOf("NT 5.1") != -1) ? true : false;
	
	window.resizeTo(width, height);
	
	if(ieMac)
	{
		newHeight = Number(height);
		newHeight -= Number(document.body.clientHeight);
		newHeight += Number(height);
		
		newWidth = Number(width);
		newWidth -= Number(document.body.clientWidth);
		newWidth += Number(width);
	}
	else if(xp)
	{
		newHeight = Number(height);
		newHeight += 41;
		
		newWidth = Number(width);
		newWidth += 12;
	}
	else if(ie)
	{
		newHeight = Number(height);
		newHeight += 35;

		newWidth = Number(width);
		newWidth += 12;
	}
	else
	{
		newHeight = Number(height);
		newHeight -= Number(window.innerHeight);
		newHeight += Number(height);
		
		newWidth = Number(width);
		newWidth -= Number(window.innerWidth);
		newWidth += Number(width);

	}

	window.resizeTo(newWidth, newHeight);
	moveWindow();
}

function moveWindow()
{
	var nn = (navigator.appName == "Netscape" || document.layers) ? true : false
	var ie = document.all ? true : false

  if (window.screen) 
  {
	if(ie)
	{
		moveToW = (Number(window.opener.document.body.clientWidth) - Number(document.body.clientWidth)) / 2
		moveToH = (Number(window.opener.document.body.clientHeight) - Number(document.body.clientHeight)) / 2
	}
	else
	{
		moveToW = (Number(window.opener.outerWidth) - Number(window.outerWidth)) / 2
		moveToH = (Number(window.opener.outerHeight) - Number(window.outerHeight)) / 2
	}
    window.moveTo(moveToW, moveToH);
  }
}