
function showHideMenu(obj)
{
  blockMenu = document.getElementById(obj).style.display;

  
  if(blockMenu == 'none')
  {
   document.getElementById(obj).style.display = 'block';
  }
  else
  {
    document.getElementById(obj).style.display = 'none'
  } 
}

// Removes leading whitespaces
function lTrim( value ) {
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function rTrim( value ) {
	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
	
}

// Removes leading and ending whitespaces
function trim( value ) {
	
	return lTrim(rTrim(value));
	
}

// Scroll banner orizontal


var marginLeft = 5;
var widthImages = marginLeft + 120;
var mustScroll = 1;
var curPosInit = 0; 
var curPos = 0;


function divScroller(numberimages_scroll) {   
   var theDiv = document.getElementById("boxImgs");   
   if (mustScroll == 1)
   {
     curPos++;		      
       
     	 if(curPos > (widthImages * numberImages) +10){      	  
     	 	curPos = curPosInit;
     	 }
     	 theDiv.scrollLeft = Math.abs(curPos);     	      	 
   }          
   
   
 
  if (mustScroll == 0){
   
    } 
//document.getElementById("controllo").value = curPos + " di  "  + (widthImages * numberImages) + 30  ;
tScroll = window.setTimeout("divScroller();", 10);
}

function stopScroll(){
	mustScroll=0;
}

function startScroll(){
	mustScroll=1;
}
















function openDocContent(content, isProductNews){
  var leftPosition = (screen.width) ? (screen.width - 800)/2 : 0;
  var topPosition = (screen.height) ? (screen.height - 600)/2 : 0;
  url = "DocContentViewer.aspx?docCode=" + content;
  if( isProductNews == "true" )
    url += "&isProductNews=true";
  popUp = window.open(url, 'popup', 'width=600, height=450, toolbar = no, scrollbars = yes, status = no, left=' + leftPosition + ', top=' + topPosition);
  popUp.focus()
}

function openPopUp(url){
  var leftPosition = (screen.width) ? (screen.width - 800)/2 : 0;
  var topPosition = (screen.height) ? (screen.height - 600)/2 : 0;
  popUpWindow = window.open(url, 'popup', 'width=400, height=200, toolbar = no, scrollbars = no, status = no, left=' + leftPosition + ', top=' + topPosition);
  popUpWindow.focus()
}


function loginResArea(idPsw, idUser)
{
  myPsw = document.getElementById(idPsw).value;
  myUser = document.getElementById(idUser).value;
  myForm = document.forms['login'];
  
  myForm.authPassword.value = myPsw;
  myForm.authUsername.value = myUser;
  
  document.forms['login'].submit();
}



