
	var domain = "http://www.vrt.be";
	var expDays = 30;
	var exp = new Date(); 
	var expired = new Date(exp.getTime() - 48 * 60 * 60 * 1000); 
	exp.setTime(exp.getTime() + (expDays*24*60*60*1000));


	function getCookieVal(offset) 
	{  
		var endstr = document.cookie.indexOf (";", offset);  
		if (endstr == -1)    
		endstr = document.cookie.length;  
		return unescape(document.cookie.substring(offset, endstr));
	}

	function getCookie(name) 
	{  
		var arg = name + "=";  
		var alen = arg.length;  
		var clen = document.cookie.length;  
		var i = 0;  
		while (i < clen) 
		{    
			var j = i + alen;    
			if (document.cookie.substring(i, j) == arg)      
			return getCookieVal (j);    
			i = document.cookie.indexOf(" ", i) + 1;    
			if (i == 0) break;   
		}  
		return '';
	}

	function setCookie(name, value){  	
		document.cookie = name + "=" + escape (value) + "; expires=" + exp.toGMTString() + "; path=/"
	}

	function setSessionCookie(name, value){  	
		document.cookie = name + "=" + escape (value) + "; path=/"
	}

	function deleteCookie(name){
		var cookieValue = getCookie(name);
		if (cookieValue!='') { 
			document.cookie = name + "=; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}		
	}
	

	function swapImg(id, imgsrc){
		temp_topic =  id.substring(8,id.length)
		if(topic != temp_topic){
			document.getElementById(id).src= imgsrc;
		}
	}
	

function set_Tag(keyword){
	//max. length: 123456789012345678901234
	var extra="nl";
	var url = location.href;
	var splitted = url.split('/');
	var filename = splitted[splitted.length-2];
	var filename_parts = filename.split('_');
	var start_pos = 2;
	if (filename_parts[0] == 'A') { 
			filename = '';
	}
	else{
		if (filename_parts.length > 2) {
			filename = filename_parts[start_pos];
			for (i = start_pos + 1; i < filename_parts.length; i++) {
				filename += '_' + filename_parts[i];	
			}
		}
	} 

	var result = keyword + filename;
	//alert(result.substr(0, 23));
	metriwebTag ("vrt", result.substr(0, 23), extra);
	}
	


//function openPlayer(URL) {
//	day = new Date();
//	id = day.getTime();
//	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=787,height=433,left = 301,top = 232');");
//	}
function openPlayer(temp_URL) {
	strsplit = temp_URL.split('?');
    URL = 'http://internetradio.vrt.be/popups/klara/radioplayer.html?' + strsplit[1];
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,width=787,height=433,left = 301,top = 232');");
	}
	