//Detta dokument är copyrightskyddat!
//Upphovsman: Robin Kochauf
//För: Gordito
var ie=document.all
var ns6=document.getElementById&&!document.all
var n=document.layers


function checkSearch() {
	
	if(document.getElementById("sok_kontor").value == ""){
		alert('Du måste välja ett kontor');
		return false;
	}
	if(document.getElementById("sok_special").value == ""){
		alert('Du måste välja ett specialområde');
		return false;
	}
	return true;
}

function mainTbl() {
	
	if(ie) {
		document.all["main_table"].height = (document.body.parentNode.clientHeight-150);
	} else {
		document.getElementById("main_table").height = (window.innerHeight-150);
	}
	
}
function fileSelect(dir,name) {
	window.open( "file.php?dir=" + dir,name,"width=400,height=460,toolbar=no,location=no,directories=no,status=no,menubar=no,adress=no");
}


function loadUpload(query){
	if (ie) {
		var so = new SWFObject("upload.swf?path=" + query, "upload", "400", "120", "8", "#666666");
		so.addParam("menu", "false");
		so.addParam("quality", "high");
		so.write("flashcontent");
	} else {
		document.write("<embed src='upload.swf?path="+ query +"' menu='false' quality='high' scale='noscale' width='400' height='120' name='upload' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	}
}

function unCheckRights() {
	for (var i = 0; i < document.user_edit.cbox_user.length; i++) {
		if (document.user_edit.cbox_user[i].checked) document.user_edit.cbox_user[i].checked=false;
	}	
	
}

function openIFrame(IFrameID, URL){
ifId=gmobj(IFrameID)
ifId.location.href=URL // Opera Bug Fix. ifId.src=URL
}

function printWindow() { // (c) Robin Kochauf
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}



//------------------------------------------------- DROP DOWN MENY


function meny_show_aux(parent, child)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  c.style.position   = "absolute";
  c.style.visibility = "visible";
  

}

function meny_show()
{
  p = document.getElementById(this["meny_parent"]);
  c = document.getElementById(this["meny_child" ]);

  meny_show_aux(p.id, c.id);

  clearTimeout(c["meny_timeout"]);

  
}

function meny_hide()
{
  c = document.getElementById(this["meny_child"]);
  
  c["meny_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 20);

}

function meny_attach(parent, child)
{
  p = document.getElementById(parent);
  c = document.getElementById(child);

  p["meny_parent"]     = p.id;
  c["meny_parent"]     = p.id;
  p["meny_child"]      = c.id;
  c["meny_child"]      = c.id;

  c.style.position   = "absolute";
  c.style.visibility = "hidden";
  
  p.onmouseover = meny_show;
  p.onmouseout  = meny_hide;
  c.onmouseover = meny_show;
  c.onmouseout  = meny_hide;	  

}
