function urlencode(str) {
    str = (str+'').toString();
    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
}

function roundCorners() { 
    	Rico.Corner.round('header');
		if ($('teaserRectangle'))
	   		Rico.Corner.round('teaserRectangle');
		if ($('content'))
	    	Rico.Corner.round($('content'));
   		var divs = document.getElementsByTagName('div');  
   		var rounded_divs = [];
 		for (var i = 0; i < divs.length; i++) {
   			if ((/\bteaserImgLeft\b/.exec(divs[i].className)) || 
   				(/\bteaserImgRight\b/.exec(divs[i].className)) ||
   				(/\bteaserTxtOnly\b/.exec(divs[i].className))) 
	    			rounded_divs[rounded_divs.length] = Rico.Corner.round(divs[i]);
   		}
   	}

   
function recommend() {
	window.open("http://www.harmonyfm.de/recommend.php","recommend","menubar=0,resizable=1,width=720,height=520");
}

function playRadio(station) {  
	if(station=="jazz") {
		file="webradio.harmonyfm.de/index/wController/Webradio/wAction/showstation/wWebradio/jazz-1/wNewquality/hq.html";
	} else if(station=="schlager") {
		file="webradio.harmonyfm.de/index/wController/Webradio/wAction/showstation/wWebradio/schlager-1/wNewquality/hq.html";
	} else {
		file="webradio.harmonyfm.de";
	}
    var radio = window.open("http://"+file,'hywebradio','width=750,height=550,scrollbars=no,status=no,locationbar=no,menubar=no,resizable=no');
    radio.focus();
    return false;
}   

function openPhoto(url,w,h,wind) {
  photo = window.open(url, wind, "width="+w+",height="+h+",scrollbars=no");
  photo.focus();
}

function openGallery(id) {
  gallery = window.open('view_gallery.php?id='+id, 'gallery', "width=650,height=570,scrollbars=no");
  gallery.focus();
}

function openPhotoSelect(func) {
  eval(func);
}

function openWMTicker() {
  var t = window.open('http://www.ffh.de/resource/highsync/ticker/fussballwm-harmony/html_php/index.html', 'ticker', "width=851,height=721,status=no,locationbar=no,scrollbars=no,menubar=no,resizable=no");
  t.focus();
}

function openWebcam() {
	openPopup('/addons/webcamPopup.php', '392', '454', 'Webcam');
}

function enlarge(caller) {
        var popup = window.open('/enlarge.php?image='+caller.href+'&title='+urlencode(caller.title), 'enlarged','width=640,height=480,status=no,locationbar=no,scrollbars=no,menubar=no,resizable=no');
        popup.focus();
        return false;
}

function openPopup(url,w,h,wind) {
  mywindow = window.open(url, wind, "width="+w+",height="+h+",scrollbars=no");
  mywindow.focus();
}

function playMP3(caller) {
    var popup = window.open('/addons/playmp3.php?file='+caller.href+'&title='+urlencode(caller.title), 'playermp3','width=250,height=210,status=no,locationbar=no,scrollbars=no,menubar=no,resizable=no');
    popup.focus();
    return false;
}
function playRTMPMP3(caller) {
    var popup = window.open('/addons/playmp3.php?file='+caller.href+'&title='+urlencode(caller.title)+'&rtmp=true', 'playermp3','width=250,height=210,status=no,locationbar=no,scrollbars=no,menubar=no,resizable=no');
    popup.focus();
    return false;
}
function playRTMPVideo(caller) {
    var popup = window.open('/addons/playRTMPVideo.php?file='+caller.href+'&title='+urlencode(caller.title)+'&rtmp=true', 'playermp3','width=560,height=390,status=no,locationbar=no,scrollbars=no,menubar=no,resizable=no');
    popup.focus(); 
    return false;
}
function playRTMPVideoDirect(url, title) {
    var popup = window.open('/addons/playRTMPVideo.php?file='+url+'&title='+urlencode(title)+'&rtmp=true', 'playermp3','width=560,height=390,status=no,locationbar=no,scrollbars=no,menubar=no,resizable=no');
    popup.focus(); 
}
function sendHoroskop(horoskop) {
  mywindow = window.open('/addons/sendHoroskop.php?horoskop='+horoskop, 'Horoskop', "width=418,height=465,scrollbars=no,status=no,locationbar=no,menubar=no,resizable=no");
  mywindow.focus();
}

function showYouTube(id) {
    var popup = window.open('/youtubePlayer.php?id='+id, 'playerYouTube','width=595,height=378,status=no,locationbar=no,scrollbars=no,menubar=no,resizable=no');
    popup.focus();
}
function playYouTube(caller) {
    var popup = window.open('addons/youtubePlayer.php?file='+caller.href+'&title='+urlencode(caller.title), 'playerYouTube','width=581,height=410,status=no,locationbar=no,scrollbars=no,menubar=no,resizable=no');
    popup.focus();
    return false;
}
function openECard (Adresse) {
	MeinFenster = window.open(Adresse, "ecard", "width=679,height=780,scrollbars=yes");
	MeinFenster.focus();
}

