function validate() {
    valid = true;

    if ( document.mailform.title.value == "" )
    {
        alert ( "Proszę podać tytuł wiadomości" );
        valid = false;
        return valid;
    }
    
    if ( document.mailform.body.value == "" )
    {
        alert ( "Proszę wpisać treść wiadomości" );
        valid = false;
        return valid;
    }
    
    if ( document.mailform.author.value == "" )
    {
        alert ( "Proszę podać swoje imię i nazwisko" );
        valid = false;
        return valid; 
    }
    
    if ( document.mailform.email.value == "" )
    {
        alert ( "Proszę podać adres e-mail" );
        valid = false;
        return valid; 
    }

    return valid;
}


function tg(ind,id,max){
	var showdiv = document.getElementById('switch'+ind+'div'+id)

	for (i=1; i<=max; i++) {
		hidediv = document.getElementById('switch'+ind+'div'+ i)
		hidediv.style.display = 'none'
		}

		showdiv.style.display = 'block'
}

function pokaz(ref) {
	if (ref) document.getElementById(ref).style.display = 'block';	
}

function ukryj(ref) {
	if (ref) document.getElementById(ref).style.display = 'none';	
}

function nS(user,domain) {
         locationstring = "mailto:" + user + "@" + domain;
         window.location = locationstring;
} 

function setUserDate(pole, wartosc, slownie) {	
	document.getElementById(pole).value=(wartosc);     
	document.getElementById(pole + '_label').value=(slownie);   
	document.getElementById('calendar_' + pole).style.display = 'none';	
}

function inputFocus(id, action) {
	if (action == true) {
	document.getElementById(id).style.border='1px solid #506c0d';
	}
	
	if (action == false) {
		document.getElementById(id).style.border='1px solid #aaaaaa';
	}
}

function isNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
   
   function bookmark() {

 title = "Komat - Trwałość i styl wokół domu"; 

 url = "http://komat.pl";

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }