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 showhideobject(){
//display - none needed to hide from firefox
	document.getElementById("loader").style.display = 'none';
	document.getElementById("loader").style.width = '0%';
	document.getElementById("loader").style.height = '0%';
	document.getElementById("posLogOn").style.display = 'none';
	document.getElementById("picturePrint").style.display = 'block';
	document.getElementById("infocontent").style.display='none';
	document.getElementById("infocontentprint").style.display='block';

}

function showtip()
{
	var ifitipwindow = window.open('', 'ifitipwindow', 'width=550,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");
	}
}
function sendnotesmail()
{
	if (document.frm.to.value.length > 0 ) {
		document.frm.action = 'sendnotesmail.jsp';
		document.frm.method = 'post';
		document.frm.submit();
	} else {
		alert("Du må skrive inn epost-adressen til mottaker");
	}
}

function addToHuskeListe()
{
urlstr = document.location.href;
//remove previous notesMsg
urlArr = urlstr.split("&");
urlstr="";
for(i=0;i<urlArr.length;i++)
{
	tmpString=urlArr[i];
	if(tmpString.indexOf("notesMsg=")==-1)
	{
		if(i==0)
			urlstr=tmpString;
		else
			urlstr=urlstr+"&"+tmpString;
	}
}

	addstr="notesMsg=";
	for(i=0; i<document.huskeListe.elements.length; i++)
{
if(document.huskeListe.elements[i].type=="checkbox")
{

if(document.huskeListe.elements[i].checked)
{
	
	addstr=addstr+"ADD="+document.huskeListe.elements[i].name
}
}
}
urlstr=urlstr+"&"+addstr;
document.huskeListe.action=urlstr;
document.huskeListe.method='post';
document.huskeListe.submit();
}