// JavaScript Document
 function readPelnaNazwa(xmlDoc)
 {
  var  theNode
  theNode = findNode(xmlDoc.documentElement, "Nazwa","","")
  return readTextinLang(theNode, getLang() )
 } 
function readLogo(xmlDoc)
 {
  var  theNode
  var code = ""
  theNode = findNode(xmlDoc.documentElement, "Logo","","")
  if( theNode == null) return code
  return readObrazekType(theNode, 0, 0, 0, 0)
 } 
function readLokalizacja(xmlDoc)
 {
  var  theNode, childNode
  var theName = new String("Obrazek")
  var code = ""
  theNode = findNode(xmlDoc.documentElement, "Lokalizacja","","")
  if( theNode == null) return code
  childNode = theNode.firstChild
  if( childNode == null) return code  
  do{
    //alert(childNode.nodeName)
    if (theName == childNode.nodeName)
    { 
    	code += "<center>" + readObrazekType(childNode, 0,0, 0, 0) + "</center><br><br>"
    }
    childNode = childNode.nextSibling
  } while(childNode != null) 
  //alert(code)
  return code
 } 
function readHistoria(xmlDoc)
{
var  theNode, childNode
var theName = new String("Sekcja")
var  code = ""
theNode = findNode(xmlDoc.documentElement, "Historia","","")
return code
}
function readDyrekcja(xmlDoc)
 {
  var  theNode,childNode, funText, funNode, tytNode, imNode,nazNode,telNode,emailNode
  var theName = new String("Dyrektor")
  var  code = ""
  var  funk = new String("")
  theNode = findNode(xmlDoc.documentElement, "Dyrekcja","","")
  if( theNode == null) return code
  childNode = theNode.firstChild
  if( childNode == null) return code  
  code += "<table border='0'><tr><td></td></tr>"
  do{
    
    if (theName == childNode.nodeName) 
    {
      funNode = findNode(childNode, "Funkcja","","")
      funText = readTextinLang(funNode, getLang() )
      
      if (funk.localeCompare(funText) != 0)
       { 
         funk = new String(funText)
         code += "</table><table >"
         code += '<tr><td class="subsubtitle"><center>' + funText + "</center></td></tr>"
              + '<tr><td>&nbsp;</td></tr>'
       }  
       
       tytNode = findNode(childNode, "tytul","","")
       imNode = findNode(childNode, "Imie","","")
       nazNode = findNode(childNode, "Nazwisko","","")
       telNode = findNode(childNode, "telefon","","")
       emailNode = findNode(childNode, "Email","","")

       code += "<tr><td><center>" 
          + '<span class="persbf">' + readTyt(tytNode) + "&nbsp;" 
          + readText(imNode) + "&nbsp;" + readText(nazNode)
          + "</span>" + "<br>" + '<span class="pers">' 
          + readTelefon(telNode)
          + readEmail(emailNode)+ "</span>" + "<br><br>"
          + "</center></td></tr>"        

    } 
    childNode = childNode.nextSibling    
  }
  while(childNode != null) 
  code += "</table>"
return code
}

function readRadaNaukowa(xmlDoc)
 {
  var  theNode,childNode, funText, funNode, tytNode, imNode,nazNode,telNode,emailNode
  var  code = ""
  var  funk = new String("")
  var theName = new String("CzlonekRN")
  theNode = findNode(xmlDoc.documentElement, "RadaNaukowa","","")
  if( theNode == null) return code  
  childNode = theNode.firstChild
  if( childNode == null) return code  
  code += '<table border="0"><tr><td></td></tr>'
  do{
    if (theName == childNode.nodeName) 
    {
       funNode = findNode(childNode, "Funkcja","","")
       funText = readTextinLang(funNode, getLang() )
       
       if (funk.localeCompare(funText) != 0)
       { 
         funk = new String(funText)
         code += '</table><table border="0">'
         code += '<tr><td class="subsubtitle"><center>' + funText + "</center></td></tr>"
              + '<tr><td>&nbsp;</td></tr>'
       }    
       tytNode = findNode(childNode, "tytul","","")
       imNode = findNode(childNode, "Imie","","")
       nazNode = findNode(childNode, "Nazwisko","","")
       telNode = findNode(childNode, "telefon","","")
       emailNode = findNode(childNode, "Email","","")

       code += "<tr><td><center>" 
          + '<span class="persbf">' + readTyt(tytNode) + "&nbsp;" 
          + readText(imNode) + "&nbsp;" + readText(nazNode)
          + "</span>" + "<br>" + '<span class="pers">' 
          + readTelefon(telNode)
          + readEmail(emailNode)+ "</span>" + "<br><br>"
          + "</center></td></tr>" 

    }
    childNode = childNode.nextSibling
  } while(childNode != null) 
  code += "</table>"
  
  return code
 }
function readSekretTel(xmlDoc)
 {
  var  theNode,childNode
  var theName = new String("telefon")
  var  code = ""
 
  theNode = findNode(xmlDoc.documentElement, "Sekretariat","","")
  if( theNode == null) return code
  childNode = findNode(theNode, "telefon","typ","2")
  code += readTelefon(childNode)
  return code	
 }
function readInforOgol(xmlDoc)
 {
  var  theNode
  var  code = ""
  
  theNode = findNode(xmlDoc.documentElement, "InforOgol","","")
  if( theNode == null) return code 
  return readParagraphs(theNode, getLang() )  
}
function readAktualnosci(xmlDoc, ile)
 {
  var  theNode,childNode, dataNode, sekNode
  var tytNode, opisNode, listaNode, obrazNode
  var theName = new String("Pozycja")
  var  code = ""
  var labdata 
  
  theNode = xmlDoc.documentElement
  // alert(theNode.nodeName)
  if( theNode == null) return code
  childNode = theNode.lastChild
  
  if( childNode == null) return code 
  n = 0
  do {
    if (theName == childNode.nodeName) 
    { 
    dataNode = findNode(childNode, "Data","","")
    labdata = readData(dataNode)
    code += '<h6 class="label">' + labdata + "</h6>" 
    labdata = labdata.replace(/-/gi,"")    
    code += '<a name="' + labdata + '"></a>'
    sekNode =  findNode(childNode, "Sekcja","","")
    do{
    if(sekNode.nodeName == "Sekcja")   code += readSekcja(sekNode, 0)    
    sekNode = sekNode.nextSibling 
    }
    while(sekNode != null) 
    }
    n = n + 1
    childNode = childNode.previousSibling
    
  }while((childNode != null) && (n <= ile))
  return code  
}
function readPrzetargi(xmlDoc)
 {
  var  theNode,childNode, dataNode, sekNode
  var tytNode, opisNode, listaNode, obrazNode
  var theName = new String("Pozycja")
  var  code = ""
  theNode = xmlDoc.documentElement
  // alert(theNode.nodeName)
  if( theNode == null) return code
  childNode = theNode.lastChild
  if( childNode == null) return code 
  do {
    if (theName == childNode.nodeName) 
    { 
    dataNode = findNode(childNode, "Data","","")
    sekNode =  findNode(childNode, "Sekcja","","")
    code += '<h6 class="label">' + readData(dataNode) + "</h6>" 
          + readSekcja(sekNode, 0)   
    }
    childNode = childNode.previousSibling
  }while(childNode != null) 
  return code  
}
function readRealizacje(xmlDoc)
 {
  var  theNode,childNode, dataNode, sekNode
  var tytNode, opisNode, listaNode, obrazNode
  var theName = new String("Realizacja")
  var  code = ""
  theNode = xmlDoc.documentElement
  // alert(theNode.nodeName)
  if( theNode == null) return code
  childNode = theNode.firstChild
  if( childNode == null) return code 
  do {
    
    if (theName == childNode.nodeName) 
    { 
    sekNode =  findNode(childNode, "Sekcja","","")
    code += readSekcja(sekNode, getLang() )
    // alert(code)
    }
    childNode = childNode.nextSibling
  }while(childNode != null) 
  return code  
}
function readUslugi(xmlDoc)
 {
  var  theNode,childNode, dataNode, sekNode
  var tytNode, opisNode, listaNode, obrazNode
  var theName = new String("Usluga")
  var  code = ""
  theNode = xmlDoc.documentElement
  // alert(theNode.nodeName)
  if( theNode == null) return code
  childNode = theNode.firstChild
  if( childNode == null) return code 
  do {
    if (theName == childNode.nodeName) 
    { 
    sekNode =  findNode(childNode, "Sekcja","","")
    code += readSekcja(sekNode, getLang() )
   
    }
    childNode = childNode.nextSibling
  }while(childNode != null) 
  return code  
}
function readProdukty(xmlDoc)
 {
  var  theNode,childNode, dataNode, sekNode
  var tytNode, opisNode, listaNode, obrazNode
  var theName = new String("Produkt")
  var  code = ""
  theNode = xmlDoc.documentElement
  // alert(theNode.nodeName)
  if( theNode == null) return code
  childNode = theNode.firstChild
  if( childNode == null) return code 
  do {
    if (theName == childNode.nodeName) 
    { 
    sekNode =  findNode(childNode, "Sekcja","","")
    code += readSekcja(sekNode, getLang() )
    // alert(code)
    }
    childNode = childNode.nextSibling
  }while(childNode != null) 
  return code  
}
function readProjekty(xmlDoc)
 {
  var  theNode,childNode, tytNode, sekNode
  var theName = new String("Projekt")
  var sekName = new String("Sekcja")
  var  code = ""
  theNode = xmlDoc.documentElement
  if( theNode == null) return code
  childNode = theNode.lastChild
  if( childNode == null) return code 
  do {
    if (theName == childNode.nodeName) 
    { 
    tytNode =  findNode(childNode, "Tytul","","")
    code += '<h5 class="sectiontitle">' + readTextinLang(tytNode, getLang()) + "</h5>"    
    sekNode =  childNode.lastChild
    do{   
  	    if (sekName == sekNode.nodeName) 
          {            
	      code += '<span class="publik">' + readSekcja(sekNode, getLang()) + "</span>"	      
          }  
          sekNode = sekNode.previousSibling 
      } while( sekNode != null)        
    }
    childNode = childNode.previousSibling
  }while(childNode != null) 
  return code  
}








