function getObj(id){
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;
}

function getForm(id){
  	return document.forms[id];
}

var langas;
function printDocument(id){
    var narsykle = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ) || ( window.ScriptEngine && ScriptEngine() == 'JScript' && navigator.platform == 'Win32' && window.ActiveXObject && !navigator.__ice_version );
	var width=700;
	var height=window.screen.height/2;
    var left=window.screen.width/2-width/2;
    var top=window.screen.height/2-height/2;
    langas = window.open( ( narsykle ? '' : 'about:blank' ), 'printdocument', "height="+(height+2)+",width="+width+",left="+left+",top="+top+',location=0,menubar=0,scrollbars=1,status=0,toolbar=0' );
    html='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
    html+='<html xmlns="http://www.w3.org/1999/xhtml" lang="lt" xml:lang="lt">';
    html+='<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />';
    html+='<title>'+document.title+'<\/title>';
    html+='<link rel="stylesheet" href="/css/style.css" type="text/css" />';
    html+='<\/head>';
    html+='<body>';
    html+=getObj(id).innerHTML;
    html+='<\/body>';
    html+='<\/html>';
    langas.document.open();
    langas.document.write(html);
    langas.document.close();
    langas.focus();
	setTimeout("langas.print()",200);
}