// Checks if a field is empty, and if so, resets the input's content to the default value
function checkField( obj, value )
{
	// Match any amount of white spaces
	if( obj.value.match( " " ) || obj.value == "" )
	{
		obj.value = value;
	}
	
	return false;
}

// Clears an input's content
function clearField( obj, value )
{
	if( obj.value == value )
	{
		obj.value = "";
	}
	
	return false;
}

function changePic(current)
{
	for (i=1;i<=4;i++)
	{
		if (document.getElementById('poza'+i)) document.getElementById('poza'+i).style.display='none';
	}
	if (document.getElementById('poza'+current)) document.getElementById('poza'+current).style.display='block';
}

function stripPath(loc)
{
	return loc.replace(/^(((.+)\/)+)?(([\w\-_]+\.)+\w{3})$/, '$4');
}