/*				pop up window function  
				which also brings the window to front if its still open							*/

	var PlayerWin = {"closed":true};
	// THIS variable makes it posible to use the boolean expression connected to the closed javascript proporty
	// This is specified in the javascript reference http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/window.html#1201877
	// The closed property is a boolean value that specifies whether a window has been closed. When a window closes, the window object that represents it continues to exist, and its closed property is set to true. 
	var PlayerWindowProporties = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=380,height=200,left=50,top=50';
	var OldPlayerNumber = 0;
	
	function OpenPlayer(URL,Name,PlayerNumber)  {
	if (OldPlayerNumber == PlayerNumber && !PlayerWin.closed) { 
	//alert("the Player window" + "\n" + "is already open" + "\n" + "lets bring it to front!?");
	if ( PlayerWin.focus ) PlayerWin.focus();
	}
	else
	{
	//alert("the Player window" + "\n" + "is not open" + "\n" + "lets open it to and bring it front!?");
	PlayerWin = window.open(URL,Name,PlayerWindowProporties);
	if ( PlayerWin.focus ) PlayerWin.focus();
	OldPlayerNumber = PlayerNumber;
	}
	} //end OpenDownload() 



/*				pop up window function placed to the right at the screen   
				which also brings the window to front if its still open							*/

	var DownloadWin = {"closed":true};
	// THIS variable makes it posible to use the boolean expression connected to the closed javascript proporty
	// This is specified in the javascript reference http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/window.html#1201877
	// The closed property is a boolean value that specifies whether a window has been closed. When a window closes, the window object that represents it continues to exist, and its closed property is set to true. 
	var myLeft = (screen.availWidth - 400); // De 370 er vinduets bredde 
	var myTop = (screen.availHeight - screen.availHeight) - 420; // De 420 er vinduets hoejde
	var DownloadWindowProporties = "width=340,height=420,left="+myLeft+",top=50,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no";
	
	function OpenDownload(URL,Name)  {
	if (!DownloadWin.closed) { 
	//alert("the Download window" + "\n" + "is already open" + "\n" + "lets bring it to front!?");
	if ( DownloadWin.focus ) DownloadWin.focus();
	}
	else
	{
	//alert("the Download window" + "\n" + "is not open" + "\n" + "lets open it to and bring it front!?");
	DownloadWin = window.open(URL,Name,DownloadWindowProporties);
	if ( DownloadWin.focus ) DownloadWin.focus();
	}
	} //end OpenDownload()



/*				the function is used in a pop up window which consists a single html document
				the function brings opener window to front if its still open
				if not it opens the url again and brings the window to front						*/

	// following variables have to placed outside the function declaration because the variables are used in multiple functions
	var DatamusikUrl = 'http://www.datamusik.dk';
	var DatamusikName = 'datamusik';
	var DatamusikWindowProporties = 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes';
				
	function BackToDataMusik(){// for example used in the player pop up
	var DatamusikDK = window.opener; // this variable has to be placed inside the function

	
	if (DatamusikDK && !DatamusikDK.closed) {
	//alert("the DatamusikDK window is still open" + "\n" + "lets bring it to front!?");
	if ( DatamusikDK.focus ) DatamusikDK.focus();
	//DatamusikDK.close(); this closes the window from which the pop op window is born
	// window.close(); this closes the pop op window
	}
	else {
	//alert("the DatamusikDK window was closed" + "\n" + "lets open it again!?");
	window.open(DatamusikUrl, DatamusikName, DatamusikWindowProporties);
	if ( DatamusikDK.focus ) DatamusikDK.focus();
	}
	} //end BackToDataMusik()




/*				the function is used in a pop up window which consists of frames
				the function brings opener window to front if its still open
				if not it opens the url again and brings the window to front						*/


	function BackToDataMusik2(){ // for example used in the download pop up
	var DatamusikDK = parent.window.opener; // this variable has to be placed inside the function - the parent.opener.parent was used in an example which this line is based on	
	
	if (DatamusikDK && !DatamusikDK.closed) {
	//alert("the DatamusikDK window is still open" + "\n" + "lets bring it to front!?");
	if ( DatamusikDK.focus ) DatamusikDK.focus();
	//DatamusikDK.close(); this closes the window from which the pop op window is born
	// window.close(); this closes the pop op window
	}
	else {
	//alert("the DatamusikDK window was closed" + "\n" + "lets open it again!?");
	window.open(DatamusikUrl, DatamusikName, DatamusikWindowProporties);
	if ( DatamusikDK.focus ) DatamusikDK.focus();
	}
	} //end BackToDataMusik2()





/*				venstrestillet pop up vindue til terms of payment faciliteten				*/

		<!--Hide
		
	function OpenTerms() {
		window.open('download/terms_purchase.html', 'terms', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=330,height=520,left=50,top=50');
		return;
	}

	function openTerms() {
		window.open('../terms_purchase.html', 'terms', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=330,height=520,left=50,top=50');
		return;
	}


		// End hide -->


/*				hÀjrestillet pop up vindue				*/




<!-- 
function MinPopHelp(MinURL,MinName) { 
var myLeft = (screen.availWidth - 370); // De 370 er vinduets bredde 
var myTop = (screen.availHeight - screen.availHeight) - 570; // De 570 er vinduets hÀjde 
window.open(MinURL,MinName,"width=400,height=520,left="+myLeft+",top=50,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no"); 
} 







/*			following scripts is only  used in the download pop up section				*/


/*			mouseover function with effective preload of the pictures				*/

<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


/*			frameset navigation scripts			*/

function ChangeFrames(header, content)
{
parent.header.location.href=header
parent.content.location.href=content
}

function ChangeHeaderFrame(header)
{
parent.header.location.href=header
}



	
/*				the function is used in a pop up window which consists of frames
				the function refreshs the content area											*/	
	
	function RefreshContentFrame() 
	{
	
	parent.content.location.reload()
	
	}//end RefreshContentFrame()