function menu_attivo() {
	var anchors = document.getElementsByTagName('a');
	
	for (var i=0; i<anchors.length; i++){
		
		var ancora = anchors[i];
		if (ancora.href == nomepagina()){
			ancora.style.color = "#ffff00";
			Element.setStyle(ancora,"text-decoration:underline");
			//ancora.setAttribute("rel","portfolio_vuota");
		}
	}
}

function nomepagina() {
	var x = location.href.split("?");
	y = x[0];
	y = y.replace(/_dettaglio/,"");
	return y;
}
	
	
function validateEmail(strValue) {
if (!strValue.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})$/)){return false;
}
else {return true}
}


function validateNotEmpty( strValue ) {
/************************************************
DESCRIPTION: Validates that a string is not all
  blank (whitespace) characters.

PARAMETERS:
   strValue - String to be tested for validity

RETURNS:
   True if valid, otherwise false.
*************************************************/
var strTemp = strValue;
strTemp = trimAll(strTemp);
if(strTemp.length > 0){return true;}
	return false;
}

function trimAll( strValue ) {
/************************************************
DESCRIPTION: Removes leading and trailing spaces.

PARAMETERS: Source string from which spaces will
  be removed;

RETURNS: Source string with whitespaces removed.
*************************************************/
 var objRegExp = /^(\s*)$/;

    //check for all spaces
    if(objRegExp.test(strValue)) {
       strValue = strValue.replace(objRegExp, '');
       if( strValue.length == 0)
          return strValue;
    }

   //check for leading & trailing spaces
   objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
   if(objRegExp.test(strValue)) {
       //remove leading and trailing whitespace characters
       strValue = strValue.replace(objRegExp, '$2');
    }
  return strValue;
}

