
function checkPagesCount()
{
	var regExp = /[0-9]+/;
	var re = new RegExp(regExp);

	pf = dBi('pages_from').value;
	pt = dBi('pages_to').value;

	if ((pf && !pf.match(re)) || (pt && !pt.match(re)))
	{
		alert(fromOrToIntMsg);
		return false;
	}
	else if (pf && pt && (pt - pf) < 0)
	{
		alert(fromGTToMsg);
		return false;
	}
	else return true;
}

function resetCreatedDays()
{
	dBi('created_days').value = '';
}

function hideFaculties()
{
	dBi('faculty_div').style.display = 'none';
	dBi('faculty_id')[0].selected = true;
	dBi('faculty_id').disabled = true;
}

//check if numeric value is in given array
Array.prototype.inArray = function(value){
	var i;
	for(i=0; i < this.length; i++){
	if(this[i] == value) return true;
	}
	return false;
};