isIE = (document.all ? true : false);
isNS = (document.layers || (document.getElementById && !(document.all)) ? true : false);

function clickIE()
{
	if (isIE)
		return false;
}

function clickNS(e)
{
	if (isNS)
	{
		if (e.which == 2 || e.which == 3)
			return false;
	}
}

if (isNS)
{
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown = clickNS;
}
else
{
	document.onmouseup = clickNS;
}

document.oncontextmenu = new Function("return false");

function openNewsItem(id)
{
	openNewsItem(id, 0);
}

function openNewsItem(id, mode)
{
    url = "newsitem.aspx?id=" + id;
    
    if (mode == 1)
        url = "../" + url;
    
    window.open(url, "", "width=500,height=400,left=" + ((screen.width - 500) / 2) + ',top=' + ((screen.height - 400) / 2) + ',scrollbars=yes');
}

function openCourseWindow(courseURL)
{
    wWidth = 1000;
    wHeight = 609;
    wLeft = ((screen.width - wWidth) / 2);
    wTop = ((screen.height - wHeight) / 2);

    window.open(courseURL, "", "width=" + wWidth + ", height=" + wHeight + ", left=" + wLeft + ", top=" + wTop);
}

function openMS()
{
    window.open("http://www.streamlearn.se/se/", "", "top=40,left=40,width=" + Math.min(1000, screen.width - 80) + ",height=" + Math.min(700, screen.height - 80) + ",status=1,toolbar=1,location=1,menubar=1,resizable=1,scrollbars=1,directories=1");
}