function iframeHeight(i_headl){
  var agt=navigator.userAgent.toLowerCase();

  if ((agt.indexOf("msie") != -1)||(agt.indexOf("opera") != -1)){
		//ie | opera
	 	h = document.body.offsetHeight;
		//h = h - 165;
		h = h - 140;
	}
	else{
		//mozilla | netscape | firefox
		h = innerHeight;
	}
	//document.getElementById("nav").style.height = h;
  if (document.getElementById("cntt") != null) {
  	document.getElementById("cntt").style.height = h - i_headl + "px";
  }
	//if the "adds" col exist
	if (document.getElementById("adds")!=null){
  	document.getElementById("adds").style.height = h - i_headl;
  }
}

function iframeHeight_developing(i_headl){
	alert("hello");
	
	//alert(self.frames["tpl_iframe"].window.document.documentElement.scrollHeight);

	oDoc = self.frames["tpl_iframe"];
	
	alert (oDoc.name);
	alert(oDoc.innerHTML);
	//oDoc.style.height = 2000px;
	
	
	//alert (oDoc.style.height); 
	
/*	
	var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
*/
}



// Firefox worked fine. Internet Explorer shows scrollbar because of frameborder
function resizeFrame(f) {
  f.style.height = f.contentWindow.document.body.scrollHeight + "px";
}

function print_iframe(){

	//o_pwindow	= open();
	//o_pwindow.document.body.innerHTML="hello";
	//o_pwindow.document.body.innerHTML=window.location.href;
	//o_pwindow.location.href = window.location.href;
	//o_pwindow.location.href = self.frames["tpl_iframe"].location.href;
	//o_pwindow.focus();
	//o_pwindow.print();
	//o_pwindow.close();
	//return;
	
  if (self.frames["cntt"] != null) {
  	self.frames["cntt"].focus();
  	self.frames["cntt"].print();
  }
	if (self.frames["tpl_iframe"] != null) {
    self.frames["tpl_iframe"].focus();
    self.frames["tpl_iframe"].print();
  }
}

function show_newAnnotation(i_oid, s_sid)
{
  var o_cntt = frames["cntt"].location.href="annotation/new_annotation.php?oid="
			+i_oid+"&sid="+s_sid;
}

function show_listAnnotation(i_oid, s_sid)
{
  var o_cntt = frames["cntt"].location.href="annotation/list_annotation.php?oid="
			+i_oid+"&sid="+s_sid;
}

function change_language(i_oid,s_sid){
  s_clg = document.getElementById('clg').value;
  document.location.href="switch.php?oid="+i_oid+"&sid="+s_sid+"&clg="+s_clg;
}

function change_version(o_obj,i_oid,s_sid,s_area,i_odnr){
	i_ndnr = o_obj.value;
	document.location.href="wnf.php?oid="+i_oid+"&sid="+s_sid+"&vs[odnr]="+i_odnr+"&vs[ndnr]="+i_ndnr+"&vs[area]="+s_area;
}

