/****Blogg bilde*****/
	 function settbilde(){
	 	var bildehoyde=$(".bloggimg img").height();
		if (bildehoyde != null){
			 $("#omblogger").css("margin-bottom",bildehoyde);
		 }
	 }
	 setInterval(settbilde,1000);
var path = "symfoniweb/cms.nsf";
function setReloadTime(time)
{
	setTimeout ("location.reload()" , time);
}
function deleteDocument(id)
{
	if(confirm( "Er du sikker på at du vil slette dette dokumentet?" ))
	{
		if(navigator.appName == "Microsoft Internet Explorer")
		{
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
		 	http_request =new XMLHttpRequest();
		}
		http_request.onreadystatechange = alertDeleteContents;
		var szurl =  "/" + path + "/webProcessInputForms?openagent&login&action=del&id=" + id;
		http_request.open('GET',szurl, true);
		http_request.setRequestHeader("Connection", "close");
		http_request.send(null);
	}
}
function alertDeleteContents()
{
	if (http_request.readyState == 4)
	{
		if (http_request.status == 200)
		{
			alert("Dokumentet er slettet")
			location.reload();
		}
	}
}
function createDocument(parent, user)
{
	if(user != "Anonymous")
	{
openWindow(520,520,'/'+ path +'/dc?readform&parent='+parent+'&form=frmDocument&create=1&db='+ path +'&edit=1&login&qnfl=none');
	}
}
function openWindow( w,h ,szurl)
{
	window.open(szurl, "", "width=" + w + "," + "height=" + h + ","+ "menubar=no,modal=yes,left="+ ((screen.availWidth-w) / 2 )+ ",top="+ ((screen.availHeight-h) / 2 )+",location=no,resizable=no,scrollbars=yes,status=yes");
}
function editDocument(id)
{
	openWindow(520,520,'/'+ path +'/dc?readform&id='+id+'&db='+ path +'&edit=1&qnfl=none');
}
function showtext(docid, event){
x=event.clientX;
y=event.clientY;
h = $(window).height();
w = $(window).width();
a = $("#"+docid).width();
b = $("#"+docid).height();
// $(".x").text(-(y-h) +" h:"+h+", y:"+ y+", x:"+x + ", a:"+a + ", b:" + b);
if(y+b>h) y = h-b-20;
$("#"+docid).css("top",y);
$("#"+docid).css("right",w-x);
$("#" + docid).show();
}
$(document).ready(function(){
$(".blogText").click(function(){
$(this).hide('slow');
});
});
/*****************KOMMENTAR******************/
var path = "symfoniweb/cms.nsf";
function setReloadTime(time)
{
setTimeout ("location.reload()" , time);
}
function deleteDocument(id)
{
if(confirm( "Er du sikker på at du vil slette dette dokumentet?" ))
{
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		http_request = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		 http_request =new XMLHttpRequest();
	}
	http_request.onreadystatechange = alertDeleteContents;
var szurl =  "/" + path + "/webProcessInputForms?openagent&login&action=del&id=" + id;
	http_request.open('GET',szurl, true);
	http_request.setRequestHeader("Connection", "close");
	http_request.send(null);
}
}
function alertDeleteContents()
{
	if (http_request.readyState == 4)
	{
		if (http_request.status == 200)
		{
			alert("Dokumentet er slettet")
			location.reload();
		}
	}
}
/*
function createcomment()
{
$.post("/"+path+"/frmCommentsToContentDocWeb?CreateDocument&reload=1", $("#_frmCommentsToContentDocWeb").serialize(), function(){
$("h3").text("Ny kommentar er lagt til");
$("h3").css("color","#FF9148");
$("h3").animate({fontSize:"2em"},"slow");
$("h3").animate({fontSize:"1em"},"slow", function(){
location.reload();
});
});
}
*/
function createcomment()
{
$("#sendkomm").hide();
$.post("/"+path+"/frmCommentsToContentDocWeb?CreateDocument&reload=1", $("#_frmCommentsToContentDocWeb").serialize(), function(){
location.reload();
});
}


