// JavaScript Document



var message="";
/////////////////////////////////// tasto destro disabilitato senza alert
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")


///// funzione disabilita f5 - da inseire richiamo nel body <body onkeydown="nof5()" onkeyup="nof5()">
function nof5() {
if (event.keyCode == 116) {
alert('Funzione disabilitata');
event.keyCode=0;
event.cancelBubble=true;
event.returnValue=false;
}
}

///// funzione per ingrandimento automatico textarea 
function moreWords(id, maxHeight) {
  var txtarea = id && id.style ? id : document.getElementById(id);  
  if (!txtarea) return; 
  var newHeight = txtarea.clientHeight; 
  if (!maxHeight || maxHeight > newHeight) {
    newHeight = Math.max(txtarea.scrollHeight, newHeight);    
    if (maxHeight)
      newHeight = Math.min(maxHeight, newHeight);
    if (newHeight > txtarea.clientHeight) {
      txtarea.style.height = newHeight + "px";
      txtarea.style.overflow = "hidden";
    }
  }
  else if (maxHeight && maxHeight <= newHeight) {
    txtarea.style.overflow = "auto";  
  }   
}



////funzione email cript 
function send (a,b,c,d) {
   var addr = 'mailto:'+b+String.fromCharCode(8 * 8)+a;
   if (c) {addr = addr+'?subject='+c+'&body='+d;}
   return addr;
}


////funzione aggiornamento immagine captcha
function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

