function blockSpam() {
	noSpamMailtos();
	if (navigator.userAgent.indexOf("Gecko")!=-1) {checkRemoteCover();}
}
function noSpamMailtos() {
	var SPAM=/REMOVE_THIS\./,i=0,l;
	while (l=document.links.item(i++)) {
		if (l.href.match(/^mailto:/)) {
			l.href=l.href.replace(SPAM,'');
		}
	}
}
function popup(url,wid,hei) {
	newwin = window.open(url,'tvPopup','resizable=yes,toolbar=no,status=no,'
	+ 'scrollbars=yes,location=no,menubar=no,directories=no,width='+wid+',height='+hei
	+ ',top=100,left=100');
	newwin.focus();
}
function checkRemoteCover() {
    MAX_SIZE = 250;
    RESIZE_TO = 175;
    ci = document.images['coverImage'];
    if (ci==undefined || ci.width == undefined || ci.height == undefined) {
        return;
    }
    if (ci.width > MAX_SIZE || ci.height > MAX_SIZE) {
        ratio = ci.width / ci.height;
        if (ci.width > ci.height) {
            newWidth = RESIZE_TO;
            newHeight = parseInt(newWidth * (1 / ratio));
        } else {
            newHeight = RESIZE_TO;
            newWidth = parseInt(newHeight * ratio);
        }
        coverIMG = document.getElementById('coverIMG');
        coverIMG.style.width = newWidth + "px";
        coverIMG.style.height = newHeight + "px";
    }
}


