function showprint()
{
	
	
	urlstr = document.location.href;
	
	urlstr = urlstr.replace(/main.jsp/i, "contents.jsp");
	
	urlArr = urlstr.split("#");
	urlstr = urlArr[0];
	//add contents.jsp to urlstr if not found
	if(urlstr.indexOf("contents.jsp")==-1){
		urlstr = urlstr.concat("contents.jsp?");
	}
	var ifiprintwindow = window.open(urlstr + '&method=print', 'ifiprintwindow');
	//ifiprintwindow.print(); //Open print dialog automatically

//	document.frm.url.value = urlstr;
	//document.frm.title.value = "";		//not needed
	//document.frm.summary.value = "";	//not needed
	//document.frm.target = 'ifiprintwindow';
	//document.frm.action = 'displayprint.jsp';
	//document.frm.method = 'get';
	//document.frm.submit();
}

function showtip()
{
	var ifitipwindow = window.open('', 'ifitipwindow', 'width=470,height=520,toolbar=1,location=0,directories=0,status=1,menubar=1,scrollbars=0,copyhistory=1,resizable=1');
	document.frm.url.value = parent.document.location.href;
	document.frm.target = 'ifitipwindow';
	document.frm.action = 'tip.jsp';
	document.frm.method = 'post';
	document.frm.submit();
}

function sendmail()
{
	if (document.frm.to.value.length > 0 && document.frm.from.value.length > 0 ) {
		document.frm.action = 'sendmail.jsp';
		document.frm.method = 'post';
		document.frm.submit();
	} else {
		alert("Du må skrive inn både avsender og epost-adressen til mottaker");
	}
}