<!--
// funkcja tworzca tablic�
  function makeArray(len) {
    for (var i = 0 ; i < len; i++) this[i] = null;
    this.length = len;
  }

// tblica dni
  var dayNames = new makeArray(7);
  dayNames[0] = "Niedziela";
  dayNames[1] = "Poniedziaek";
  dayNames[2] = "Wtorek";
  dayNames[3] = "roda";
  dayNames[4] = "Czwartek";
  dayNames[5] = "Pitek";
  dayNames[6] = "Sobota";

// tablica nazw miesic�
  var monthNames = new makeArray(12);
  monthNames[0] = "I";
  monthNames[1] = "II";
  monthNames[2] = "III";
  monthNames[3] = "|V";
  monthNames[4] = "V";
  monthNames[5] = "VI";
  monthNames[6] = "VII";
  monthNames[7] = "VIII";
  monthNames[8] = "IX";
  monthNames[9] = "X";
  monthNames[10] = "XI";
  monthNames[11] = "XII";

// elementy obiektu Date przypisane zmiennym
  var now = new Date();
  var day = now.getDay();
  var month = now.getMonth();
  var year = now.getYear();
  if (year == 99)
    year = 1999;
  else if (year > 99 && year < 2000)
    year = 1900 + year;
  var date = now.getDate();
  

function data()
{
	document.write(dayNames[day] + " - " +  " " + date + " " + monthNames[month]  + " " + year);
}


 function displayWindow(url, width, height) 
{
	var Win = window.open(url,"displayWindow",'resizable=1,scrollbars=1,menubar=0' );
}
function max() {

  window.moveTo(0,0)
  
  if(document.all)
    window.resizeTo(screen.availWidth, screen.availHeight);
  
  else if(document.layers)
  {
    window.outerWidth = screen.availWidth
    window.outerHeight = screen.availHeight
  }
}

function gotoURL(a,b){
strURL = document.forms[a].elements[b].options[document.forms[a].elements[b].selectedIndex].value;
if (strURL != 0){location.href = strURL;}
}
function checkForm(){
	test = true;
	error = "Formularz nie został wypełniony poprawnie!\n\n";
	fr = document.getElementById("form1")
	imie_nazwisko = fr.imie_nazwisko.value;
	email = fr.email.value;
	temat = fr.temat.value;
	tekst = fr.tekst.value;
	
	// validacja imienia i nazwiska
	if(imie_nazwisko.length!=0){
		if(imie_nazwisko.indexOf(" ")==-1){
			test = false;
			error += "- Musisz podać imię i nazwisko!\n";
		}
	}else{
		test = false;
		error += "- Pole z imieniem i nazwiskiem nie może być puste!\n";
	}
	
	
	// validacja adresu email
	if(email.length>0){
		reg = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!reg.test (email) ){
			test = false;
			error += "- Podaj prawidłowy adres e-mail lub niepodawaj go wcale!\n";
		}
	}
	// validacja tematu
	if(temat.length==0){
		test = false;
		error += "- Pole tematu nie może być puste!\n";
	}
	
	// validacja tekstu
	if(tekst.length==0){
		test = false;
		error += "- Pole z wiadomością nie może być puste!\n";
	}

	if(test){
		ok = confirm("FORMULARZ został wypełniony poprawnie:\n\nimie i nazwisko: "+imie_nazwisko+"\nemail: "+email+"\ntemat: "+temat+"\n"+tekst+"\n\nCzy jesteś pewien, że dane są poprawne?");
		if(ok){
			fr.submit();
		}else{
			alert("Popraw dane i kliknij Wyślij jeszcze raz.");
		}
	}else{
		alert(error);
	}
}
function start(){
	//this.style.behavior='url(#default#homepage)';
	this.setHomePage('http://www.powiat-belchatowski.pl/');
}
/*
tinyMCE.init({
				mode : "exact",
				elements : "tekst",
				theme : "advanced"
});
*/
 //-->
 function make_appoint( ibasproduct )
	{
		windowprops = "width=520,height=500,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no";
		theurl = "http://qmatic.powiat-belchatowski.pl/appoint?appoint_product="+ ibasproduct;
		window.open(theurl, "Appoint", windowprops);
		return (true);    
	}