function init() {
if (document.getElementById) 
{
 var menu_images= document.getElementById('menutable').getElementsByTagName('img');
 for (i=0;i<6;i++) 
 {
  menu_images[i].tag= i;
  menu_images[i].imageOn= new Image();
  menu_images[i].imageOff= new Image();
  menu_images[i].imageOn.src= "images/menu0"+(i+1)+"_.jpg";
  menu_images[i].imageOff.src= "images/menu0"+(i+1)+".jpg";
  menu_images[i].onmouseover = mover;
  menu_images[i].onmouseout= mout;
 }
}
}

function mover() {
 this.src= this.imageOn.src;
}
function mout() {
 this.src= this.imageOff.src;
}

function mouseover() {
document.getElementById('mainpage').src="images/mainpage_.jpg"
}

function mouseback() {
document.getElementById('mainpage').src="images/mainpage.jpg"
}

function showinfo() {
 if (document.getElementById)
  if (document.getElementById('moreinfo').style.display!='none')
   document.getElementById('moreinfo').style.display='none';
    else document.getElementById('moreinfo').style.display='block';
}
function TrimLeft( napis )
// obcina spacje z lewej strony napisu
{
 while (napis.charAt(0)==" ")
 {
  napis=napis.substr(1,napis.length);
 }
 return napis;
}
function TrimRight( napis )
// obcina spacje z prawej strony napisu
{
 while (napis.charAt(napis.length-1)==" ")
 {
  napis=napis.substr(0,napis.length-1);
 }
 return napis;
}
function IsEmpty( napis )
// obcina spacje w napisie z lewej i prawej i sprawdza, czy jest pusty
{
 if ( TrimRight(TrimLeft(napis)) == "") return true; else return false;
}

function checkForm()
{
 if (document.getElementById)
 with (document) {
  if (IsEmpty(getElementById('temat').value)) { alert("Temat musi być wypełniony."); return false; }
  if (IsEmpty(getElementById('tresc').value)) { alert("Treść wiadomości musi być wypełniona."); return false; }
  if (IsEmpty(getElementById('osoba').value)) { alert("Imię i nazwisko musi być wypełnione."); return false; }
  if (IsEmpty(getElementById('telefon').value)) { alert("Telefon kontaktowy musi być wypełniony."); return false; }
  //if (IsEmpty(getElementById('mail').value)) { alert("E-mail musi być wypełniony."); return false; }
 }
  return true;
}

function showPic(url, width, height) {
width += 14;
height += 14;
window.open(url, "", "width=" + width + ", height=" + height + ", left=0, top=0, menubar=no, status=no, location=no, toolbar=no, scrollbars=no, resizable=no");
}

