$(document).ready(
    function(){
            var list = $('.lnav a');
           // var list = document.getElementById('lnav').getElementsByTagName('a');
             //   list = list + document.getElementById('catnav').getElementsByTagName('a');
            var newList = [];
            
        
            for(i=0;i<list.length;i++){
                if(list[i].parentNode.getElementsByTagName('ul').length){
                    newList.push(list[i]);
                }
            }
           
            $(newList).click(function(){
                if($(this).next('ul').is('.closed')){
                    $(this).next('ul').removeClass('closed').addClass('opened');
                    }
                else {
                    $(this).next('ul').removeClass('opened').addClass('closed');
                    
                    }
                return false;
             });
            $('#catnav .selected:first').parent().parent().addClass('opened').removeClass('closed').parent().parent().addClass('opened').removeClass('closed');
         
    }
)

function PrintWindow(url){
 window.open(url,'print','location=0,menubar=0,resizable=yes,status=0,menubar=no,width=600,height=500,scrollbars=yes');
}

var browser     = '';
var version     = '';
var entrance    = '';
var cond        = '';
// BROWSER?
if (browser == ''){
if (navigator.appName.indexOf('Microsoft') != -1)
    {
        browser = 'IE'
    }
else if (navigator.appName.indexOf('Netscape') != -1)
    {
        browser = 'Netscape'
    }
else if (navigator.appName.indexOf('Opera') != -1) {
        browser = 'Opera'
    }
else
    {
        browser = 'IE';
    }
}

if (version == ''){
version= navigator.appVersion;
paren = version.indexOf('(');
whole_version = navigator.appVersion.substring(0,paren-1);
version         = parseInt(whole_version);
}


                function fileWindow(filestorage,file,wdth,hght)  {
                     if(file.substr(0,1)=="/"){
                         file = file.substr(1,file.length);
                     }
                     if (file.length!=0) {
                          vmrl = window.open('','fileview','location=0,menubar=0,resizable=yes,status=0,menubar=no,width='+wdth+',height='+hght+',scrollbars=no');
                          vmrl.document.open();
                          vmrl.document.write('<html><head><title></title></head><body bgcolor="#ffffff" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">');
                          vmrl.document.write('<table border="0" cellpadding="15" cellspacing="7" width="100%" height="100%" align="center" bgcolor="#CECECE"><tr><td bgcolor="#FFFFFF" valign="middle" align="center">');
                          vmrl.document.write('<a href="javascript: window.close()" title="Click to close"><img src="'+filestorage+file+'" border=0></a>');
                          vmrl.document.write('</td></tr></table>');
                          vmrl.document.write('</body></html>');
                          vmrl.document.close();
                          vmrl.focus();
                     }
                }


function OpenPopup(img, name) {
    title=name;
    w=open("",'image','width=1,height=1,toolbar=no,scrollbars=yes,resizable=yes');
    w.document.write("<HTML><HEAD><TITLE>"+title+"</TITLE></HEAD>\n");

//    w.document.write("<link href='css/style.css' rel='stylesheet' type='text/css'>\n");
    w.document.write("<SCRIPT language=javascript>var clientHeight=" + window.document.body.clientHeight + "</" + "SCRIPT>\n");

    w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) { window.resizeTo(document.images[0].width+50,(document.images[0].height > clientHeight ? clientHeight : document.images[0].height+70)); window.focus();} else { setTimeout('checksize()',250) } }</"+"SCRIPT>\n");
    w.document.write("<BODY onload=\"checksize()\" BGCOLOR='#FFFFFF' leftMargin='10' topMargin='10' marginwidth='10' marginheight='10'>\n");

    w.document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" align="center" bgcolor="#CECECE"><tr><td bgcolor="#FFFFFF" valign="middle" align="center">');
    w.document.write('<a href="javascript: window.close()" title="Click to close">');
    w.document.write("<img id='main' src='" + img + "' border=\"0\">\n");
    w.document.write('</a>');
    w.document.write('</td></tr></table>');


    w.document.write("</BODY></HTML>");
    w.document.close();
}



                        Timer = false;
                        function clearTimer()
                          {
                           if(Timer)
                             {
                              clearTimeout (Timer);
                              Timer = null;
                             }
                          }
                        
                        function setTimer(id)
                          {
                          Timer = window.setTimeout("HideIcons('"+id+"')", 250);
                          }
                        
                        
                        function ShowIconsBlock(id)
                        {
                            obj=document.getElementById(id);
                            if (obj)
                            {
                                obj.style.visibility="visible";
                                obj.style.display="block";
                            }
                        }
                        
                        function HideIcons(id) {
                            obj=document.getElementById(id);
                            if (obj)
                            {
                                obj.style.visibility="hidden";
                                obj.style.display="none";
                            }
                        }
                    

                

