/* MAIN FORM FUNCTIONS*/

function zmien_rodzaj()
	{
		var z = document.getElementById("rrrr").selectedIndex;
		
		if(z < 3)
			{
				document.getElementById("ustne1").style.display = "";
				document.getElementById("ustne2").style.display = "";
				document.getElementById("pisemne1").style.display = "none";
				document.getElementById("pisemne2").style.display = "none";
				document.getElementById("pisemne3").style.display = "none";

			}
		else
			{
				document.getElementById("ustne1").style.display = "none";
				document.getElementById("ustne2").style.display = "none";
				document.getElementById("pisemne1").style.display = "";
				document.getElementById("pisemne2").style.display = "";
				document.getElementById("pisemne3").style.display = "";
			}		
	}



function IsCreateValid()

{

	return true;	

}



function IsUpdateValid()

{

	return true;	

}



function Create()

{

/*

	if(document.bForm.docInput.value == "") 

	{

		alert('Proszę wyszukać plik Ľródłowy...');

		document.bForm.act.value = "modify";

		return false;

 //	}

 //	else

 //	{

 */

		if(IsCreateValid != false) 

		{

			if (document.bForm.SPAW_index_toolbar_bottom_html)

				SPAW_UpdateFields();

			document.bForm.act.value = "create";

			return true;

		}

		else

		{

			return false;	

		}

//	}

}



function Update()

{



		if(IsUpdateValid != false) 

		{

			if (document.bForm.SPAW_index_toolbar_bottom_html)

				SPAW_UpdateFields();

			document.bForm.act.value = "update";

			return true;

		}

		else

		{

			return false;	

		}

}



function Delete(i_id)

{

	if (confirm('Czy na pewno chcesz usun±ć wybrany wpis?'))

	{

		document.bForm.act.value = "delete";

		document.bForm.id.value = i_id;

		document.bForm.submit();

	}

}

function Modify(i_id)

{

	document.bForm.act.value = "modify";

	document.bForm.id.value = i_id;

	document.bForm.submit();

}



function UploadPhoto()

{

	if(document.bForm.photo.value == "") 

	{

		alert('Proszę wyszukać plik fotografii');

	}

	else

	{

		if (document.bForm.SPAW_index_toolbar_bottom_html)

			SPAW_UpdateFields();

		document.bForm.act.value = "upload_photo";

		document.bForm.submit();

	}

}



function UploadFile()

{

	if(document.bForm.file.value == "") 

	{

		alert('Proszę wyszukać plik');

	}

	else

	{

		if (document.bForm.SPAW_index_toolbar_bottom_html)

			SPAW_UpdateFields();

		document.bForm.act.value = "upload_file";

		document.bForm.submit();

	}

}



/*POPUP FUNCTIONS*/



function popup(doc, name, width, height) {

    

    window.open(doc, name, 'scrollbars=1, width=' + width + ', height=' + height);

}

function popitup2(content)

{

newwindow2=window.open('','name','height=200,width=150');

var tmp = newwindow2.document;

tmp.write(content);

tmp.close();

}






