/**
 * Open an popup with the given page and options
 * 
 * @param {String} page url of the page which will be open in popup
 * @param {Int} width witdh of the popup
 * @param {Int} height height of the popup
 * @param {String} options option for the popup (i.e scrollbars, resizable)
 * @return open an popup
 */
function popupcentree(page,width,height,options) {    
    var top=(screen.height-height)/2;
    var left=(screen.width-width)/2;
    window.open(page,"","top="+top+",left="+left+",width="+width+",height="+height+","+options);
}

/**
 * format a text according to url format
 * 
 * @param {String} text
 * @return format the given text according to url format.
 */
function formaturl(text) {
    temp = text.toLowerCase();
    temp = temp.replace(" ","-");
    temp = temp.replace(/[àâä]/gi,"a");
    temp = temp.replace(/[éèêë]/gi,"e");
    temp = temp.replace(/[îï]/gi,"i");
    temp = temp.replace(/[ôö]/gi,"o");
    temp = temp.replace(/[ùûü]/gi,"u");
    return temp
}

/** Open funradio yacast player **/
function launchPlayerFun() {
	window.open("http://radio.funradio.fr","FUN","width=620,height=320,toolbar=no,menubar=no,resizable=no,location=no,directories=no,status=no,scrollbars=no,copyhistory=no,left=160,top=250");
}

function addEvent(obj, evType, fn){ 
	 if (obj.addEventListener){ 
	   obj.addEventListener(evType, fn, false); 
	   return true; 
	 } else if (obj.attachEvent){ 
	   var r = obj.attachEvent("on"+evType, fn); 
	   return r; 
	 } else { 
	   return false; 
	 } 
	}
