/*
* RBB RadioBerlin
* standard.js
* 
* Author: Tino Urbiks, Holger M. Stangl
* Date: August 2007
*/


// PopUp
function fenster(wohin,url,name,breit,hoch,scrollbars) {
  var breit;
  var hoch;
  var wohin;
    
	if (wohin=='oben') {
    var x=(screen.width - screen.width);
   	var y=(screen.height - screen.height);
  } 
  else if (wohin=='center') {
    var x=((screen.width - breit) / 2);
    var y=((screen.height - hoch) /2);
  }
    
	window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=no,width='+breit+',height='+hoch+',left='+x+',top='+y);
}


function mediaPopUp(wohin,url,handle,name,breit,hoch) {
  var breit;
  var hoch;
  var wohin;
  
  //url = url+'.videohandle.'+encodeURIComponent(handle)+'.html';
  url = url+'.html';
    
	if (wohin=='oben') {
    var x=(screen.width - screen.width);
   	var y=(screen.height - screen.height);
  } 
  else if (wohin=='center') {
    var x=((screen.width - breit) / 2);
    var y=((screen.height - hoch) /2);
  }
    
	window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+breit+',height='+hoch+',left='+x+',top='+y);
}

function openWindowFromNav(handle,name,width,height,scrollbar)
{
	var url = externalize(handle) + '.html';
    
   	var x=((screen.width - width) / 2);
   	var y=((screen.height - height) /2);
    
	var popupWindow = window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + (scrollbar ? 'yes' : 'no') +',resizable=no,width='+width+',height='+height+',left='+x+',top='+y);
	popupWindow.focus();
}

function toggleText(element,labelText){
  var theElement = document.getElementById(element);
  if (theElement.value == labelText){
    theElement.value = '';
  }
  else if (theElement.value == ''){
    theElement.value = labelText;
  }
}

function openmediabox(handle) {
	
	mediaPopUp('center', externalize(handle), '', 'mediabox', 596, 600);
	return false;
}
