/****************************************************
     Author: Pete Mulder
     Url: http://www.hitmedia.nl
     Copyright 2004/2005 - HITmedia 
	 Last update: August 2005
	 Project: Universal Mediaplayer, Publieke omroep
	 
	 Popupscript
****************************************************/

/* popup vars */

var popupW = 725;
var popupH = 515;
var pos = 'right';
/* Open popup. Based on script by  Eric King
  Url: http://redrival.com/eak/index.shtml */
var win=null;
function NewWindow(mypage,myname,w,h,scroll){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
if(pos=="right"){LeftPosition=(screen.width-popupW-25);TopPosition=10;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}


 
/* this function only allows url of the popup page */
  function openPlayer(which)	{
	NewWindow(which,'po_tv',popupW,popupH,'no','center');
 }

/* this function only allows url of the popup page */
  function openBigPlayer(which)	{
	NewWindow(which,'po_bigtv',popupDblW,popupDblH,'no','center');
 }

function openEmbeddedPlayer()
{
   var features = "width=720,height=512,left=100,top=100";
   var then, now;

open('','embeddedplayer','noresize,noscroll,status=no,menubar=no,toolbar=no,'
+ features);

   then = new Date().getTime();
   now = then;
   while((now - then) < 250)
   {
     now = new Date().getTime();
   }

   return true;
}