
if(document.getElementById||document.all){//minimumdhtmlsupportrequired
document.write("<"+"style type='text/css'>#footer{visibility:hidden;}<"+"/style>");
window.onload=winOnLoad;
}
function winOnLoad()
{
var ele=xGetElementById('texlayer2');
if(ele&&xDef(ele.style,ele.offsetHeight)){//anothercompatibilitycheck
adjustLayout();

//setTimeout(adjustLayout,1000);
//xAddEventListener(window, 'resize', winOnResize, false);
  }
}
function winOnResize()
{
  adjustLayout();
}
function adjustLayout()
{
var documentheight=xClientHeight();
  var cHeight = xHeight('texlayer2')+xHeight('imagelayertop')+40;
  var lHeight = xHeight('left_menu')+xHeight('bannertopleft')+xHeight('tapeten');
//  var maxHeight = Math.max(lHeight, cHeight);
//  maxHeight = Math.max(maxHeight,documentheight);
var maxHeight = documentheight;
  xHeight('texlayer2', maxHeight);
  xHeight('rightcolumn', maxHeight);
  xHeight('leftline', maxHeight); 
  xHeight('rightline', maxHeight); 
  xHeight('bgplatta', maxHeight-65);
  xHeight('lowerhalf',maxHeight-245);
//  xGetElementById('footer').style.top =-20; 
  xShow('footer');
  fixGreyLineHeight();
}

//Added 090331 by GM to fix height of grey lines
function fixGreyLineHeight()
{	
	//Set the right menu lower box
	var LeftLine = document.getElementById("rightline");
	var RightLine = document.getElementById("leftline");	
	var XForm = document.getElementById("id_matrix");
	var TextLayer2 = document.getElementById("texlayer2");
	
	var formHeight  = 0;
	var layerHeight = 0;
	
	if (XForm != null)
	{
		formHeight = XForm.offsetHeight;				
	}
	if (TextLayer2 != null)
	{
		layerHeight = TextLayer2.offsetHeight;		
	}
	
	var Height = Math.max(formHeight, layerHeight);
	Height = Height + 100;	
	
	if (LeftLine != null && RightLine != null && XForm != null && Height != null)
	{		
		LeftLine.style.height = Height + 'px';		
		RightLine.style.height = Height + 'px';		
	}	
}

function printPage() 
{
    var da = (document.all) ? 1 : 0;
    var pr = (window.print) ? 1 : 0;
    
    if(!pr)
    {
        window.status = "No print";
        return;
    }
    
    var printArea = document.getElementById("texlayer2");
    
    if(printArea == null && da) 
        printArea = document.all.PrintArea;
    
    if(printArea) 
    {
        var sStart = "<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"/styles/printstyle.css\">\n";
        sStart += "<title>OTGS - Open Trade Gate Sweden</title>\n";
        sStart += "</head><body>";
        sStop = "</body></html>";

        var w = window.open('about:blank','printWin','width=650,height=440,scrollbars=yes');
        wdoc = w.document;
        wdoc.open();
        wdoc.write( sStart + printArea.innerHTML ) ;
        wdoc.writeln( sStop );
        wdoc.close();
        w.print();
    }
}

function printTerm(termID) 
{
    var da = (document.all) ? 1 : 0;
    var pr = (window.print) ? 1 : 0;
    
    if(!pr)
    {
        window.status = "No print";
        return;
    }
    
    var printArea = document.getElementById(termID);
    
    if(printArea == null && da) 
        printArea = document.all.PrintArea;
    
    if(printArea) 
    {
        var sStart = "<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"/styles/mainstyle.css\">\n";
        sStart += "<title>OTGS - Open Trade Gate Sweden</title>\n";
        sStart += "</head><body>";
        sStop = "</body></html>";

        var w = window.open('about:blank','printWin','width=650,height=440,scrollbars=yes');
        wdoc = w.document;
        wdoc.open();
        wdoc.write( sStart + printArea.innerHTML ) ;
        wdoc.writeln( sStop );
        wdoc.close();
        w.print();
    }
}