var divs="";
var verwait="";
function cdiv(n){
	var h=gh(n);
	var h2="";
	if (h!=0) h2=" height:"+h+"px;";
	var w=gw(n);
	var w2="";
	if (w!=0) w2=" width:"+w+"px;";
	document.write("<div id=\""+n+"\" class=\""+n+"\" style=\""+h2+w2+"overflow:"+go(n)+";\">");
		
		
	if (divs!="") divs=divs+",";
	divs=divs+n;
}
function ediv(){
	document.write("</div>");
}
function rdiv(){
	var n = divs.split(",");
	for (i=0; i<n.length; i++){
		var x=gh(n[i]);
		if (x!=0) document.getElementById(n[i]).style.height=x+"px";
		x=gw(n[i]);
		if (x!=0) document.getElementById(n[i]).style.width=x+"px";
		document.getElementById(n[i]).style.overflow=go(n[i]);
	}
}
function go(n){
	if(n=="menu" | n=="head" | n=="list") return("auto");
	return("hidden");
}
function gw(n){
	if(n=="sesion") return(0);
	var ws=document.getElementById("sesion").offsetWidth;
	if(n=="title") return(ws);
	if(n=="data") return(ws);
	if(n=="menu") return(ws);
	var w=0;
	w=document.documentElement.clientWidth;
 	if(n=="screen") w=w-ws;
	if(n=="list") w=w-ws;
	if(n=="head") w=w-ws;
	if (w<0) w=0;
	return(w);
}
function gh(n){
	if(n=="title") return(0);
	if(n=="data") return(0);
	if(n=="head") return(0);
 	var h=0;
	h=document.documentElement.clientHeight;
  	if(n=="menu") h=h-document.getElementById("title").offsetHeight-document.getElementById("data").offsetHeight;
	if(n=="list") h=h-document.getElementById("head").offsetHeight;
	if (h<0) h=0;
	return(h);
}
function printsesion(wa){
    var h = document.getElementById("head");
    var l = document.getElementById("list");
    var p = window.open("","_blank");
    p.document.write("<!doctype html><html><head><title>printsesion</title><link rel=\"stylesheet\" href=\"/system/default.css\" type=\"text/css\">");
    if (wa!="") p.document.write("<link rel=\"stylesheet\" href=\"/"+wa+"/default.css\" type=\"text/css\">");
    p.document.write("</head><body style=\"overflow:auto\">");
    p.document.write("<div id=\"head\" class=\"head\"></div>");
    p.document.write("<div id=\"list\" class=\"list\"></div>");
    p.document.write("</body></html>");
    p.document.close();

    p.document.getElementById("head").innerHTML=h.innerHTML;
    p.document.getElementById("list").innerHTML=l.innerHTML;

    p.focus();
 
    if (navigator.userAgent.indexOf("Chrome")==-1&&navigator.userAgent.indexOf("Safari")==-1) {
	p.print(); 	
	p.close();
    		
	}



} 

