<!--

// SETS DEFAULT IMAGES
function setimage() {
	if ((currentpage == "dla_adwokatow_zmien") || (currentpage == "dla_adwokatow_dodaj")) { document.images[currentpage].src = "/images/" + currentpage + "_on.gif"; }
}


function rollon(x) {
	if (x != currentpage) {
		document.images[x].src = "/images/" + x + "_on.gif"; 
	}
}

function rolloff(x) {
	if (x != currentpage) {
		document.images[x].src = "/images/" + x + "_off.gif"; 
	}
}


function submitform(obj) {
	// reset allparms variable each time the submit is ran
	var allparms = "";
	
	// check for required fields in reqfields ARRAY
	if (reqfields[0] != "none") {
	for (arraynum in reqfields) {
		//handle selects differently (known by the way they are named "_sel")
		if (reqfields[arraynum].indexOf("_sel") != -1) { 
			if (obj.elements[reqfields[arraynum]].selectedIndex == -1) {
				//alert("sel " + reqfields[arraynum]);
				allparms = "notpresent";
				break;	
			}
		}
		else if (reqfields[arraynum].indexOf("_check") != -1) { 
			if (!obj.elements[reqfields[arraynum]].checked) {
			//	alert("check " + reqfields[arraynum]);
				allparms = "notpresent";
				break;	
			}
		}
		else {
			//alert(obj.elements[reqfields[arraynum]].value);
			if (obj.elements[reqfields[arraynum]].value == "") {
				//alert(reqfields[arraynum]);
				allparms = "notpresent";
				break;
			}	
		 }
	
	}
	}

	
	// submit only if allparms are present	
	if (allparms != "notpresent") {
		obj.submit();	
	}
	else {
		alert('Prosze wypelnic wszystkie pola zaznaczone *');
	}
}



// -->


