function showPopup(URL, width, height)
{
	if(width == undefined || height == undefined)
	{
		var width		= "400";
		var height		= "175";
	}
	
	var target		= "_blank";
	var features	= "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no";

	if(window.screen)
	{
		var left = (screen.width-width)/2;
		var top = (screen.height-height)/2;
		features+=',left='+left+',top='+top;
	}
	
	window.open(URL,target,features+((features!='')?',':'')+'width='+width+',height='+height);
}

/*
obre una nova finestra si el target del form es diu "popUp"
*/
function showThePopup(width, height)
{
	var target		= "popUp";
	var features	= "menubar=no,location=no,resizable=no,scrollbars=yes,status=no";
	

	if(window.screen)
	{
		var left = (screen.width-width)/2;
		var top = (screen.height-height)/2;
		features+=',left='+left+',top='+top;
	}
	
	window.open("",target, features+((features!='')?',':'')+'width='+width+',height='+height);
}

function closePopup()
{
	window.opener.location = window.opener.location; // refresh
	window.close();
}

function closePopup(URL)
{
	window.opener.location.href = URL;
	window.close();
}

function refreshLlistat(URL)
{
	window.location.href = URL;	
}

function getURLParam (name)
{
	var regexS = "[\?&]"+name+"=([^&#]*)";
	var regex = new RegExp ( regexS );
	var tmpURL = window.location.href;
	var results = regex.exec( tmpURL );
	if( results == null )
		return"";
	else
		return results[1];
}