/** 
* Wysłanie formularza o danym ID
*/
function FormSubmit(formname)
{
  try {
     document.getElementById('worker').style.display='block';
     document.getElementById(formname).submit();
  } catch(err) {
     window.alert("There is no form on name: "+formname);
  }   
}

/** 
* Obsluga klawiszy
*/
function doKey(event) {
  var Key = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
  if (Key==27) {
     DivUnload('popupwindow')
     //alert("You pressed key p" + $key);
  }
}

/** 
* Wyszukanie z podpowiedzi
*/
function findset(slowo)
{
 document.getElementById('worker').style.display='block';
 key = document.getElementById('searchtxt');
 keyform = document.getElementById('search'); 
 key.value=slowo;
 keyform.submit();
}

/** 
* Email antyspamowy
*/
function nospamemail(user, domain, suffix, image, txt) {
   if (image=='') {
      link = user + '@' + domain + '.' + suffix;
   } else {
      link = '<img src="'+image+'" alt="'+txt+'" />';
   }
   document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + link + '</a>');
}

/** 
* Zmiana class dla id
*/
function divstyleswitch(id, switch1, switch2)
{
   var div = document.getElementById(id);
	if (div==null) { 
	   return false; 
   }
   if (div.className==switch1) {
      div.className=switch2;
	} else {
      div.className=switch1;
   }   
}

/** 
* Unload popup div
*/
function DivUnload(div) 
{
 document.getElementById(div).style.display = 'none';
 document.getElementById('dimmed').style.display = 'none';  
}