function blured()
{
    for (a in document.links) document.links[a].onfocus = document.links[a].blur;
    {
    if (document.all) document.onmousedown = blured;
    }
}

function email(name, text)
{
   var mailaddress = name;
   mailaddress.replace("@", "\u0040");
   
   var url = "mailto:" + mailaddress;

   if(!text) text = mailaddress;

   document.write("<a href=\"" + url + "\">" + text + "</a>");
}

function popupX(url)
{
    window.open(url,"Popup","scrollbars=no,toolbar=no,menuBar=no,resizable=no,width=640,height=480,left=20,top=20");
}

function popup(url)
{
    window.open(url,"Sida","scrollbars=yes,toolbar=no,menuBar=no,resizable=yes,width=800,height=600,left=15,top=15");
}

function trailer(movieid) 
{
	settings = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,left=15,top=15,width=800,height=600"
	window.open("http://www.fanbay.se/buy/index.asp?company_id=20&movie_id=" + movieid, "Trailer", settings).focus();
}

function lyssna(movieid) 
{
	settings = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,left=15,top=15,width=800,height=600"
	window.open("http://www.musicbay.se/buy/index.asp?company_id=40&movie_id=" + movieid, "Provlyssna", settings).focus();
}

function preview(url, bredd, hojd)
{	
	bredd = bredd + 22
	hojd = hojd + 30
	settings = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left=15,top=15"
	window.open(url, "Bildvisare", settings + ",width=" + bredd + ",height=" + hojd).focus();
}

function disableTextSelection(target)
{
    if (typeof target.onselectstart != "undefined") // IE
	    target.onselectstart = function() { return false }
    else if (typeof target.style.MozUserSelect != "undefined" ) // Firefox
	    target.style.MozUserSelect = "none"
    else // Others
	    target.onmousedown = function() { return false }
        target.style.cursor = "default"
}

