// --------- opis funkcji
// WI, HE - szerokość (WI) i wysokość (HE) PREZENTACJI FLASH
// COL - kolor tła prezentacji FLASH
// FLASH - nazwa pliku (wraz ze scieżką) z prezentacją (*.SWF)
// Q - jakość prezentacji (HIGH, MEDIUM, LOW)
// WMOD - ustawienia specjalne prezentacji (none, transparent, opaque)
// UWAGA! Opera nie obsługuje przezroczystości w przentacjach!!!

function DodajBaner(WI,HE,COL,FLASH,Q,WMOD) {

tresc = '<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+WI+'" HEIGHT="'+HE+'" id="mypage" ALIGN=""> <PARAM NAME=movie VALUE="'+FLASH+'"> <PARAM NAME=quality VALUE='+Q+'> <PARAM NAME=bgcolor VALUE='+COL+'> <PARAM NAME="wmode" VALUE="'+WMOD+'"> <EMBED src="'+FLASH+'" quality='+Q+' wmode='+WMOD+' bgcolor='+COL+' WIDTH="'+WI+'" HEIGHT="'+HE+'" NAME="mypage" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>';
document.write(tresc);
}

function doSection (secNum)
	{
	el = document.getElementById(secNum);	
	//doSection odpowiada za rozwijanie obszaru
	if (el.style.display=="none")
		{
		el.style.display="";
		}
	else
		{
		el.style.display="none";
		}
	}

function cleardata( obj )
{		
	obj.value = '';
}

function show_field( field_id )
{
	el = document.getElementById(field_id);
	el.style.display = 'block';
}

function hide_field( field_id )
{
	el = document.getElementById(field_id);
	el.style.display = 'none';
}

function formUserCheck(formobj){
	var error = false;
	
	el = document.getElementById('kopia');
	if(el.checked == true)
	{
	// Enter name of mandatory fields
	var fieldRequired = Array("miejscewylotu", "miejscedocelowe", "datawylotu", "datapowrotu", "imienazwisko", "email");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Miejsce wylotu", "Miejsce docelowe", "Data wylotu", "Data powrotu", "Imie i Nazwiako", "e-mail");
	}
	
	if(el.checked == false)
	{
	// Enter name of mandatory fields
	var fieldRequired = Array("miejscewylotu", "miejscedocelowe", "datawylotu", "datapowrotu", "imienazwisko");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Miejsce wylotu", "Miejsce docelowe", "Data wylotu", "Data powrotu", "Imie i Nazwiako");
	}
	// dialog message
	var alertMsg = "Proszę uzupełnić brakuj±ce dane:\n\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "password":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		error = true;
	}
	if (error)
	{
	hide_field('loading');
	return false;
	}
}