function MandatoryField(object, strObject)
{
	if(object.value == "")
	{
		alert(strObject);
		return false;
	}
	else
	{
		return true;
	}
}

function MailField(mail, strMail)
{
	var patternEMAIL = /^[a-zA-Z0-9\-\._]+@[a-zA-Z0-9\-_\.]+\.[a-zA-Z]{2,3}$/;
    if(mail.value.length>0)
    {
		if(patternEMAIL.test(mail.value))
		{
		   return true;
		}
		else
		{
		   alert(strMail);
		   return false;
		}
    }
    else
    {
		return true;
    }
}

function IntegerField(number, strNumber)
{
	var Szablon = /^[0-9]+$/;
	if(Szablon.test(number.value))
	{
		return true;
	}
	else
	{
		alert(strNumber);
		return false;
	}
}

function Equal2Field(field1, field2, strNotEqual)
{
	if(field1.value==field2.value)
	{
		return true;
	}
	else
	{
		alert(strNotEqual);
		return false;
	}
}

//potwierdzenie akcji
function Komunikat(text)
{
	return confirm(text);

}
function s4V(sourceForm, obj1, newValue1, obj2, newValue2,obj3, newValue3,obj4, newValue4, fun)
{
//funkcja do ustawienia odpowiedniego trybu fromularza
	
	obj1.value=newValue1;
	obj2.value=newValue2;
	obj3.value=newValue3;
	obj4.value=newValue4;
	fun(sourceForm);
	
	
}
function s3V(sourceForm, obj1, newValue1, obj2, newValue2,obj3, newValue3, fun)
{
//funkcja do ustawienia odpowiedniego trybu fromularza
	
	obj1.value=newValue1;
	obj2.value=newValue2;
	obj3.value=newValue3;
	fun(sourceForm);
	
	
}
function s2V(sourceForm, obj1, newValue1, obj2, newValue2, fun)
{
//funkcja do ustawienia odpowiedniego trybu fromularza
	
	obj1.value=newValue1;
	obj2.value=newValue2;
	fun(sourceForm);
	
	
}
function sV(sourceForm, obj, newValue,fun)
{
	//funkcja do ustawienia odpowiedniego trybu fromularza
	obj.value=newValue;
	fun(sourceForm);
}

function sendForm(obj)
{
	//alert("test aktualizacji");
	obj.submit();

}


function showGP(url, width,height,name)
{
	var okno = window.open(url,name,"toolbar=no,menubar=no,personalbar=no,Width="+width+",Height="+height+",scrollbars=yes,resizable=yes");
	okno.focus();
	okno.moveTo((screen.availWidth/2)-(width/2),(screen.availHeight/2)-(height/2));	

}

function showPrint(url, width,height,name)
{
	var okno = window.open(url,name,"toolbar=no,menubar=no,personalbar=no,Width="+width+",Height="+height+",scrollbars=yes,resizable=yes");
	okno.focus();
	okno.moveTo((screen.availWidth/2)-(width/2),(screen.availHeight/2)-(height/2));	

}

function openWindow(url, width,height,name)
{
	var okno = window.open(url,name,"toolbar=no,menubar=no,personalbar=no,Width="+width+",Height="+height+",scrollbars=yes,resizable=no");
	okno.focus();
	okno.moveTo((screen.availWidth/2)-(width/2),(screen.availHeight/2)-(height/2));	

}
