function apri(pagina,nome,proprieta){window.open(pagina,nome,proprieta)};
function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
return false
}
else
return true
}

focus();

function allarga() { 
top.window.moveTo(0,0);
if (document.all) { top.window.resizeTo(screen.availWidth,screen.availHeight); }
else if (document.layers||document.getElementById) { if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight; top.window.outerWidth = screen.availWidth; } } }


function overlayclose(subobj){
document.getElementById(subobj).style.display="none"
}
var loadedobjects=""
var rootdomain="http://"+window.location.hostname

function ajaxpage(url, containerid,reload){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid, reload)
}
var r = Math.random();
page_request.open('GET', url+"&rand="+r, true)
page_request.send(null)
}

function loadpage(page_request, containerid, reload){
if (reload > 0) { document.getElementById(containerid).innerHTML=''; }
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) {
document.getElementById(containerid).innerHTML=page_request.responseText;
}
}


var myRequest = null;

function CreateXmlHttpReq(handler) {
  var xmlhttp = null;
  try {
    xmlhttp = new XMLHttpRequest();
  } catch(e) {
    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  xmlhttp.onreadystatechange = handler;
  return xmlhttp;
}

function myHandler(divdacambiare) {
    if (myRequest.readyState == 4 && myRequest.status == 200) {
        e = document.getElementById(divdacambiare);
        e.innerHTML = myRequest.responseText;
    }
}


// ==========================================================================			 
// @function		Complete AHAH function
// @author		Daniele Florio
// @site		www.gizax.it
// @version		1.1.3 experimental
// @thanksTo		Andrea Paiola,Walter Wlodarski,Scott Chapman
// @updated 1.1.3 ( execJS function ) @thanks to Giovanni Zona
// (c) 2006 Daniele Florio <daniele@gizax.it>
// ==========================================================================

var completeAHAH = {
//	loading : 'loading data...',
	ahah : function (url, target, delay, method, parameters) {
	  if ( ( method == undefined ) || ( method == "GET" ) || ( method == "get" ) ){
	//		this.creaDIV(target, this.loading);
			if (window.XMLHttpRequest) {
				req = new XMLHttpRequest();
			} 
			else if (window.ActiveXObject) {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			if (req) {
				req.onreadystatechange = function() {
					completeAHAH.ahahDone(url, target, delay, method, parameters);
				};
				req.open(method, url, true);
				req.send("");
			}
		}
		if ( (method == "POST") || (method == "post") ){
			//this.creaDIV(target, this.loading);
			if (window.XMLHttpRequest) {
				req = new XMLHttpRequest();
			} 
			else if (window.ActiveXObject) {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			if (req) {
				req.onreadystatechange = function() {
					completeAHAH.ahahDone(url, target, delay, method, parameters);
				};
				req.open(method, url, true);
				req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				req.send(parameters);
			 }
		}
	},
	creaDIV : function (target, html){
	   if (document.body.innerHTML){
			   document.getElementById(target).innerHTML = html;
	   }
	   else if (document.getElementById){
			   var element = document.getElementById(target);
			   var range = document.createRange();

			   range.selectNodeContents(element);
			   range.deleteContents();
			   element.appendChild(range.createContextualFragment(html));

	   }
	},

	execJS : function (node) {

		var st = node.getElementsByTagName('SCRIPT');
		var strExec;

		var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
		var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
		var bMoz = (navigator.appName == 'Netscape');

		for(var i=0;i<st.length; i++) {     
			if (bSaf) {
			  strExec = st[i].innerHTML;
			}
			else if (bOpera) {
			  strExec = st[i].text;
			}
			else if (bMoz) {
			  strExec = st[i].textContent;
			}
			else {
			  strExec = st[i].text;
			}
			try {
			  eval(strExec);
			} catch(e) {
			  alert(e);
			}
		}

	},	

	ahahDone : function (url, target, delay, method, parameters) {		
		if (req.readyState == 4) { 
			element = document.getElementById(target);
			if (req.status == 200) {

				//this.creaDIV(target, req.responseText);
				output = req.responseText;
				document.getElementById(target).innerHTML = output;
				var j = document.createElement("div");
				j.innerHTML = "_" + output + "_";
				this.execJS(j);

			} 		
			else {
				this.creaDIV(target, "ahah error:\n"+req.statusText);
			}
		}
	},

	likeSubmit : function ( file, method, formName, target ) {

		var the_form = document.getElementById(formName);
		var num = the_form.elements.length;
		var url = "";
		var radio_buttons = new Array();
		var nome_buttons = new Array();
		var check_buttons = new Array();
		var nome_buttons = new Array();


		// submit radio values
		var j = 0;
		var a = 0;
		for(var i=0; i<the_form.length; i++){
			var temp = the_form.elements[i].type;
			if ( (temp == "radio") && ( the_form.elements[i].checked) ) { 
				nome_buttons[a] = the_form.elements[i].name;
				radio_buttons[j] = the_form.elements[i].value; 
				j++; 
				a++;
			}
		}
		for(var k = 0; k < radio_buttons.length; k++) {
			url += nome_buttons[k] + "=" + radio_buttons[k] + "&";
		}

		// submit checkbox values
		var j = 0;
		var a = 0;
		for(var i=0; i<the_form.length; i++){
			var temp = the_form.elements[i].type;
			if ( (temp == "checkbox") && ( the_form.elements[i].checked) ) { 
				nome_buttons[a] = the_form.elements[i].name;
				check_buttons[j] = the_form.elements[i].value; 
				j++; 
				a++;
			}
		}
		for(var k = 0; k < check_buttons.length; k++) {
			url += nome_buttons[k] + "=" + check_buttons[k] + "&";
		}

		// submit all kind of input		
		for (var i = 0; i < num; i++){	
			var chiave = the_form.elements[i].name;
			var valore = encodeURIComponent(the_form.elements[i].value);

			var tipo = the_form.elements[i].type;

			if ( (tipo == "submit") || (tipo == "radio") || (tipo == "checkbox") ){}
			else {
				url += chiave + "=" + valore + "&";
			}
		}

		var parameters = url;
		var r = Math.random();
		url = file + "?" + url + "&R=" + r;

		if (method == undefined) { 
			method = "GET"; 	
		}
		if (method == "GET") { 
			this.ahah(url, target, '', method, ''); 
		}
		else { 
			this.ahah(file, target, '', method, parameters); 
		}
	}

};

// FINE AHAHTEXT // 


var myRequest = null;

function CreateXmlHttpReq(handler) {
  var xmlhttp = null;
  try {
    xmlhttp = new XMLHttpRequest();
  } catch(e) {
    try {
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  xmlhttp.onreadystatechange = handler;
  return xmlhttp;
}

function myHandler(divdacambiare) {
    if (myRequest.readyState == 4 && myRequest.status == 200) {
        e = document.getElementById(divdacambiare);
        e.innerHTML = myRequest.responseText;
    }
}






// -------------------------------------------------------------------
// DHTML Window Widget- By Dynamic Drive, available at: http://www.dynamicdrive.com
// v1.0: Script created Feb 15th, 07'
// v1.01: Feb 21th, 07' (see changelog.txt)
// v1.02: March 26th, 07' (see changelog.txt)
// v1.03: May 5th, 07' (see changelog.txt)
// v1.1:  Oct 29th, 07' (see changelog.txt)
// -------------------------------------------------------------------

var dhtmlwindow={
imagefiles:['/resources/images/icone/min.png', '/resources/images/icone/max.png',  '/resources/images/icone/close.png',  '/resources/images/icone/restore.png','/resources/images/icone/dimensioni.png'], //Path to 4 images used by script, in that order

ajaxbustcache: true, //Bust caching when fetching a file via Ajax?
ajaxloadinghtml: '<b>Loading Page. Please wait...</b>', //HTML to show while window fetches Ajax Content?

minimizeorder: 0,
zIndexvalue:100,
tobjects: [], //object to contain references to dhtml window divs, for cleanup purposes
lastactivet: {}, //reference to last active DHTML window

init:function(t){
	var domwindow=document.createElement("div") //create dhtml window div
	domwindow.id=t
		domwindow.className="dhtmlwindow"
	var domwindowdata=''
	domwindowdata+='<div class="cornersxtop"></div><div class="centrotop"></div><div class="cornerdxtop"></div><div class="drag-handle">'
	domwindowdata+='DHTML Window <div class="drag-controls"><img src="'+this.imagefiles[0]+'" class="drag-min" title="Minimize" /><img src="'+this.imagefiles[1]+'"  class="drag-max" title="Maximize" /><img src="'+this.imagefiles[2]+'" title="Close" /></div>'
	domwindowdata+='</div>'
	domwindowdata+='<div class="latosx"></div><div class="drag-contentarea"></div><div class="latodx"></div>'
	domwindowdata+='<div class="drag-statusarea"><div class="borderbot"><div class="cornersxbot"></div><div class="centrobot"></div><div class="cornerdxbot"><div class="drag-resizearea" style="background: transparent url('+this.imagefiles[4]+') top right no-repeat;">&nbsp;</div></div></div></div>'
	domwindowdata+='</div>'
	domwindow.innerHTML=domwindowdata
	document.getElementById("dhtmlwindowholder").appendChild(domwindow)
	//this.zIndexvalue=(this.zIndexvalue)? this.zIndexvalue+1 : 100 //z-index value for DHTML window: starts at 0, increments whenever a window has focus
	var t=document.getElementById(t)
	var divs=t.getElementsByTagName("div")
	for (var i=0; i<divs.length; i++){ //go through divs inside dhtml window and extract all those with class="drag-" prefix
		if (/drag-/.test(divs[i].className))
			t[divs[i].className.replace(/drag-/, "")]=divs[i] //take out the "drag-" prefix for shorter access by name
	}
	var icos=t.getElementsByTagName("img")
	for (var i=0; i<icos.length; i++){ //go through divs inside dhtml window and extract all those with class="drag-" prefix
		if (/drag-/.test(icos[i].className))
			t[icos[i].className.replace(/drag-/, "")]=icos[i] //take out the "drag-" prefix for shorter access by name
	}
	//t.style.zIndex=this.zIndexvalue //set z-index of this dhtml window
	t.handle._parent=t //store back reference to dhtml window
	t.min.style.display="inline-block"
	t.max.style.display="inline-block"
	t.resizearea._parent=t //same
	t.controls._parent=t //same
	t.onclose=function(){return true} //custom event handler "onclose"
	t.onmousedown=function(){dhtmlwindow.setfocus(this)} //Increase z-index of window when focus is on it
	t.handle.onmousedown=dhtmlwindow.setupdrag //set up drag behavior when mouse down on handle div
	t.resizearea.onmousedown=dhtmlwindow.setupdrag //set up drag behavior when mouse down on resize div
	t.controls.onclick=dhtmlwindow.enablecontrols
	t.show=function(){dhtmlwindow.show(this)} //public function for showing dhtml window
	t.hide=function(){dhtmlwindow.hide(this)} //public function for hiding dhtml window
	t.close=function(){dhtmlwindow.close(this)} //public function for closing dhtml window (also empties DHTML window content)
	t.setSize=function(w, h){dhtmlwindow.setSize(this, w, h)} //public function for setting window dimensions
	t.moveTo=function(x, y){dhtmlwindow.moveTo(this, x, y)} //public function for moving dhtml window (relative to viewpoint)
	t.isResize=function(bol){dhtmlwindow.isResize(this, bol)} //public function for specifying if window is resizable
	t.isScrolling=function(bol){dhtmlwindow.isScrolling(this, bol)} //public function for specifying if window content contains scrollbars
	t.load=function(contenttype, contentsource, title){dhtmlwindow.load(this, contenttype, contentsource, title)} //public function for loading content into window
	this.tobjects[this.tobjects.length]=t
	return t //return reference to dhtml window div
},

open:function(t, contenttype, contentsource, title, attr, recalonload){
	var d=dhtmlwindow //reference dhtml window object
	function getValue(Name){
		var config=new RegExp(Name+"=([^,]+)", "i") //get name/value config pair (ie: width=400px,)
		return (config.test(attr))? parseInt(RegExp.$1) : 0 //return value portion (int), or 0 (false) if none found
	}
	if (document.getElementById(t)==null) //if window doesn't exist yet, create it
		t=this.init(t) //return reference to dhtml window div
	else
		t=document.getElementById(t)
	this.setfocus(t)
	t.setSize(getValue(("width")), (getValue("height"))) //Set dimensions of window
	var xpos=getValue("center")? "middle" : getValue("left") //Get x coord of window
	var ypos=getValue("center")? "middle" : getValue("top") //Get y coord of window
	//t.moveTo(xpos, ypos) //Position window
	if (typeof recalonload!="undefined" && recalonload=="recal" && this.scroll_top==0){ //reposition window when page fully loads with updated window viewpoints?
		if (window.attachEvent && !window.opera) //In IE, add another 400 milisecs on page load (viewpoint properties may return 0 b4 then)
			this.addEvent(window, function(){setTimeout(function(){t.moveTo(xpos, ypos)}, 400)}, "load")
		else
			this.addEvent(window, function(){t.moveTo(xpos, ypos)}, "load")
	}
	t.isResize(getValue("resize")) //Set whether window is resizable
	t.isScrolling(getValue("scrolling")) //Set whether window should contain scrollbars
	t.style.visibility="visible"
	t.className="dhtmlwindow box_"+getValue("classe")+"";
	t.style.display="block"
	t.contentarea.style.display="block"
	t.min.style.display="inline-block"
	t.max.style.display="inline-block"
	t.statusarea.style.display="block"
	t.moveTo(xpos, ypos) //Position window
	t.load(contenttype, contentsource, title)
	if (t.state=="minimized" && t.controls.firstChild.title=="Restore"){ //If window exists and is currently minimized?
		t.controls.firstChild.setAttribute("src", dhtmlwindow.imagefiles[0]) //Change "restore" icon within window interface to "minimize" icon
		t.controls.firstChild.setAttribute("title", "Minimize")
		t.state="fullview" //indicate the state of the window as being "fullview"
	}
	return t
},

setSize:function(t, w, h){ //set window size (min is 150px wide by 100px tall)
	t.style.width=Math.max(parseInt(w), 150)+"px"
	t.contentarea.style.height=Math.max(parseInt(h), 100)+"px"
},

moveTo:function(t, x, y){ //move window. Position includes current viewpoint of document
	this.getviewpoint() //Get current viewpoint numbers
	t.style.left=(x=="middle")? this.scroll_left+(this.docwidth-t.offsetWidth)/2+"px" : this.scroll_left+parseInt(x)+"px"
	t.style.top=(y=="middle")? this.scroll_top+(this.docheight-t.offsetHeight+60)/2+"px" : this.scroll_top+parseInt(y)+"px"
},

isResize:function(t, bol){ //show or hide resize inteface (part of the status bar)
	t.resizearea.style.display=(bol)? "block" : "none"
	t.resizeBool=(bol)? 1 : 0
},

isScrolling:function(t, bol){ //set whether loaded content contains scrollbars
	t.contentarea.style.overflow=(bol)? "auto" : "hidden"
},

load:function(t, contenttype, contentsource, title){ //loads content into window plus set its title (3 content types: "inline", "iframe", or "ajax")
	if (t.isClosed){
		alert("DHTML Window has been closed, so no window to load contents into. Open/Create the window again.")
		return
	}
	var contenttype=contenttype.toLowerCase() //convert string to lower case
	if (typeof title!="undefined")
		t.handle.firstChild.nodeValue=title
	if (contenttype=="inline")
		t.contentarea.innerHTML=contentsource
	else if (contenttype=="div"){
		var inlinedivref=document.getElementById(contentsource)
		t.contentarea.innerHTML=(inlinedivref.defaultHTML || inlinedivref.innerHTML) //Populate window with contents of inline div on page
		if (!inlinedivref.defaultHTML)
			inlinedivref.defaultHTML=inlinedivref.innerHTML //save HTML within inline DIV
		inlinedivref.innerHTML="" //then, remove HTML within inline DIV (to prevent duplicate IDs, NAME attributes etc in contents of DHTML window
		inlinedivref.style.display="none" //hide that div
	}
	else if (contenttype=="iframe"){
		t.contentarea.style.overflow="hidden" //disable window scrollbars, as iframe already contains scrollbars
		if (!t.contentarea.firstChild || t.contentarea.firstChild.tagName!="IFRAME") //If iframe tag doesn't exist already, create it first
			t.contentarea.innerHTML='<iframe FRAMEBORDER="0"  src="" style="margin:0; background:none transparent;padding:0; width:100%; height: 100%" name="_iframe-'+t.id+'"></iframe>'
		window.frames["_iframe-"+t.id].location.replace(contentsource) //set location of iframe window to specified URL
		}
	else if (contenttype=="ajax"){
		this.ajax_connect(contentsource, t) //populate window with external contents fetched via Ajax
	}
	t.contentarea.datatype=contenttype //store contenttype of current window for future reference
},

setupdrag:function(e){
	var d=dhtmlwindow //reference dhtml window object
	var t=this._parent //reference dhtml window div
	d.etarget=this //remember div mouse is currently held down on ("handle" or "resize" div)
	var e=window.event || e
	d.initmousex=e.clientX //store x position of mouse onmousedown
	d.initmousey=e.clientY
	d.initx=parseInt(t.offsetLeft) //store offset x of window div onmousedown
	d.inity=parseInt(t.offsetTop)
	d.width=parseInt(t.offsetWidth) //store width of window div
	d.contentheight=parseInt(t.contentarea.offsetHeight) //store height of window div's content div
	t.style.opacity = 1.0;
	t.style.filter = 'alpha(opacity=100)';

	//if (t.contentarea.datatype=="iframe"){ //if content of this window div is "iframe"
	//	t.style.backgroundColor="#1e266e" //colorize and hide content div (while window is being dragged)
	//	t.contentarea.style.visibility="hidden"
	// }
	document.onmousemove=d.getdistance //get distance travelled by mouse as it moves
	document.onmouseup=function(){
		//if (t.contentarea.datatype=="iframe"){ //restore color and visibility of content div onmouseup
		//	t.contentarea.style.backgroundColor="#1e266e"
		//	t.contentarea.style.visibility="visible"
		// }	
		t.style.opacity = 1;
	t.style.filter = 'alpha(opacity=100)';
		d.stop()
	}
	return false
},

getdistance:function(e){
	var d=dhtmlwindow
	var etarget=d.etarget
	var e=window.event || e
	d.distancex=e.clientX-d.initmousex //horizontal distance travelled relative to starting point
	d.distancey=e.clientY-d.initmousey
	if (etarget.className=="drag-handle") //if target element is "handle" div
		d.move(etarget._parent, e)
	else if (etarget.className=="drag-resizearea") //if target element is "resize" div
		d.resize(etarget._parent, e)
	return false //cancel default dragging behavior
},

getviewpoint:function(){ //get window viewpoint numbers
	var ie=document.all && !window.opera
	var domclientWidth=document.documentElement && parseInt(document.documentElement.clientWidth) || 100000 //Preliminary doc width in non IE browsers
	this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	this.scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
	this.scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
	this.docwidth=(ie)? this.standardbody.clientWidth : (/Safari/i.test(navigator.userAgent))? window.innerWidth : Math.min(domclientWidth, window.innerWidth-16)
	this.docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
},

rememberattrs:function(t){ //remember certain attributes of the window when it's minimized or closed, such as dimensions, position on page
	this.getviewpoint() //Get current window viewpoint numbers
	t.lastx=parseInt((t.style.left || t.offsetLeft))-dhtmlwindow.scroll_left //store last known x coord of window just before minimizing
	t.lasty=parseInt((t.style.top || t.offsetTop))-dhtmlwindow.scroll_top
	t.lastwidth=parseInt(t.style.width) //store last known width of window just before minimizing/ closing
	t.lastheight=parseInt(t.contentarea.style.height) //store last known height of window just before minimizing/ closing
},

move:function(t, e){
	t.style.left=dhtmlwindow.distancex+dhtmlwindow.initx+"px"
	t.style.top=dhtmlwindow.distancey+dhtmlwindow.inity+"px"
},

resize:function(t, e){
	t.style.width=Math.max(dhtmlwindow.width+dhtmlwindow.distancex, 150)+"px"
	t.contentarea.style.height=Math.max(dhtmlwindow.contentheight+dhtmlwindow.distancey, 100)+"px"
},

enablecontrols:function(e){
	var d=dhtmlwindow
	var sourceobj=window.event? window.event.srcElement : e.target //Get element within "handle" div mouse is currently on (the controls)
	if (/Minimize/i.test(sourceobj.getAttribute("title"))) //if this is the "minimize" control
		d.minimize(sourceobj, this._parent)
	else if (/Maximize/i.test(sourceobj.getAttribute("title"))) //if this is the "maximize" control
		d.maximize(sourceobj, this._parent)
	else if (/Restore/i.test(sourceobj.getAttribute("title"))) //if this is the "restore" control
		d.restore(sourceobj, this._parent)
	else if (/Close/i.test(sourceobj.getAttribute("title"))) //if this is the "close" control
		d.close(this._parent)
	return false
},

minimize:function(button, t){
    if(t.state!="maximized"){
	dhtmlwindow.rememberattrs(t)
	button.setAttribute("src", dhtmlwindow.imagefiles[3])
	button.setAttribute("title", "Restore")
	t.state="minimized"
	t.contentarea.style.display="none"
	t.statusarea.style.display="block"

	t.max.style.display="none"
	if (typeof t.minimizeorder=="undefined"){
	dhtmlwindow.minimizeorder++
	t.minimizeorder=dhtmlwindow.minimizeorder
	}
	t.handle.style.cursor="arrow"
	t.controls.style.visibility="visible"
	t.style.left="10px" //left coord of minmized window
	t.style.width="300px"
	var windowspacing=(t.minimizeorder*10)+20 //spacing (gap) between each minmized window(s)
	t.style.top=dhtmlwindow.scroll_top+dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-windowspacing+"px"
	}	
},

maximize:function(button, t){
   if(t.state!="minimized"){
	dhtmlwindow.rememberattrs(t)
	button.setAttribute("src", dhtmlwindow.imagefiles[3])
	button.setAttribute("title", "Restore")
	t.state="maximized"
	t.min.style.display="none"
	t.contentarea.style.display="block"
	t.statusarea.style.display="block"
	t.contentarea.style.height=dhtmlwindow.docheight-t.handle.offsetHeight+"px"
	t.style.width="100%"
	t.style.top="0px"
	t.style.left="0px"
	t.controls.style.visibility="visible"
	}
},

restore:function(button, t){
    dhtmlwindow.getviewpoint()
	if(t.state=="maximized"){
	button.setAttribute("src", dhtmlwindow.imagefiles[1])
	button.setAttribute("title", "Maximize")
	t.state="fullview"
	t.style.display="block"
	t.contentarea.style.display="block"
	t.min.style.display="inline-block"
	if (t.resizeBool)
	t.statusarea.style.display="block"
	t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px"
	t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px"
	t.style.width=parseInt(t.lastwidth)+"px"
	t.contentarea.style.height=parseInt(t.lastheight)+"px"
	t.controls.style.visibility="visible"
	}
	else if(t.state=="minimized"){
	button.setAttribute("src", dhtmlwindow.imagefiles[0])
	button.setAttribute("title", "Minimize")
	t.state="fullview"
	t.style.display="block"
	t.max.style.display="inline-block"
	t.handle.style.cursor="move"
	t.contentarea.style.display="block"
	if (t.resizeBool)
	t.statusarea.style.display="block"
	t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px"
	t.style.top=parseInt(t.lasty)+dhtmlwindow.scroll_top+"px"
	t.style.width=parseInt(t.lastwidth)+"px"
	t.controls.style.visibility="visible"
	this.zIndexvalue++
	t.style.zIndex=this.zIndexvalue
	}
},


close:function(t){
	try{
		var closewinbol=t.onclose()
	}
	catch(err){ //In non IE browsers, all errors are caught, so just run the below
		var closewinbol=true
 }
	finally{ //In IE, not all errors are caught, so check if variable isn't defined in IE in those cases
		if (typeof closewinbol=="undefined"){
			//alert("An error has occured somwhere inside your \"onclose\" event handler")
			var closewinbol=true
		}
	}
	if (closewinbol){ //if custom event handler function returns true
		if (t.state!="minimized") //if this window isn't currently minimized
			dhtmlwindow.rememberattrs(t) //remember window's dimensions/position on the page before closing
		if (window.frames["_iframe-"+t.id]) //if this is an IFRAME DHTML window
			window.frames["_iframe-"+t.id].location.replace("about:blank")
		else
			t.contentarea.innerHTML=""
		t.style.display="none"
		t.isClosed=true //tell script this window is closed (for detection in t.show())
	}
	return closewinbol
},


setopacity:function(targetobject, value){ //Sets the opacity of targetobject based on the passed in value setting (0 to 1 and in between)
	if (!targetobject)
		return
	if (targetobject.filters && targetobject.filters[0]){ //IE syntax
		if (typeof targetobject.filters[0].opacity=="number") //IE6
			targetobject.filters[0].opacity=value*100
		else //IE 5.5
			targetobject.style.filter="alpha(opacity="+value*100+")"
		}
	else if (typeof targetobject.style.MozOpacity!="undefined") //Old Mozilla syntax
		targetobject.style.MozOpacity=value
	else if (typeof targetobject.style.opacity!="undefined") //Standard opacity syntax
		targetobject.style.opacity=value
},

setfocus:function(t){ //Sets focus to the currently active window
	this.zIndexvalue++
	t.style.zIndex=this.zIndexvalue
	t.isClosed=false //tell script this window isn't closed (for detection in t.show())
	this.setopacity(this.lastactivet.handle, 1) //unfocus last active window
	this.setopacity(t.handle, 1) //focus currently active window
	this.lastactivet=t //remember last active window
},


show:function(t){
	if (t.isClosed){
		alert("DHTML Window has been closed, so nothing to show. Open/Create the window again.")
		return
	}
	if (t.lastx) //If there exists previously stored information such as last x position on window attributes (meaning it's been minimized or closed)
		dhtmlwindow.restore(t.controls.firstChild, t) //restore the window using that info
	else
		t.style.display="block"
	this.setfocus(t)
	t.state="fullview" //indicate the state of the window as being "fullview"
},

hide:function(t){
	t.style.display="none"
},

ajax_connect:function(url, t){
	var page_request = false
	var bustcacheparameter=""
	if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
		page_request = new XMLHttpRequest()
	else if (window.ActiveXObject){ // if IE6 or below
		try {
		page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
			page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else
		return false
	t.contentarea.innerHTML=this.ajaxloadinghtml
	page_request.onreadystatechange=function(){dhtmlwindow.ajax_loadpage(page_request, t)}
	if (this.ajaxbustcache) //if bust caching of external page
		bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	page_request.open('GET', url+bustcacheparameter, true)
	page_request.send(null)
},

ajax_loadpage:function(page_request, t){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
	t.contentarea.innerHTML=page_request.responseText
	}
},


stop:function(){
	dhtmlwindow.etarget=null //clean up
	document.onmousemove=null
	document.onmouseup=null
},

addEvent:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
	var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false)
	else if (target.attachEvent)
		target.attachEvent(tasktype, functionref)
},

cleanup:function(){
	for (var i=0; i<dhtmlwindow.tobjects.length; i++){
		dhtmlwindow.tobjects[i].handle._parent=dhtmlwindow.tobjects[i].resizearea._parent=dhtmlwindow.tobjects[i].controls._parent=null
	}
	window.onload=null
}

} //End dhtmlwindow object

document.write('<div id="dhtmlwindowholder"><span style="display:none">.</span></div>') //container that holds all dhtml window divs on page
window.onunload=dhtmlwindow.cleanup



//Ajax Pagination Script- Author: Dynamic Drive (http://www.dynamicdrive.com)

var ajaxpageclass=new Object()
ajaxpageclass.loadstatustext="Caricamento..." // HTML to show while requested page is being fetched:
ajaxpageclass.ajaxbustcache=false // Bust cache when fetching pages?
ajaxpageclass.paginatepersist=true //enable persistence of last viewed pagination link (so reloading page doesn't reset page to 1)?
ajaxpageclass.pagerange=3 // Limit page links displayed to a specific number (useful if you have many pages in your book)?
ajaxpageclass.ellipse=".. " // Ellipse text (no HTML allowed)

/////////////// No need to edit beyond here /////////////////////////

ajaxpageclass.connect=function(pageurl, divId){
	var page_request = false
	var bustcacheparameter=""
	if (window.XMLHttpRequest && !document.all) // if Mozilla, Safari etc (skip IE7, as object is buggy in that browser)
		page_request = new XMLHttpRequest()
	else if (window.ActiveXObject){ // if IE6 or below
		try {
		page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
			page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else
		return false
	document.getElementById(divId).innerHTML=this.loadstatustext //Display "fetching page message"
	page_request.onreadystatechange=function(){ajaxpageclass.loadpage(page_request, divId)}
	if (this.ajaxbustcache) //if bust caching of external page
		bustcacheparameter=(pageurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	page_request.open('GET', pageurl+bustcacheparameter, true)
	page_request.send(null)
}

ajaxpageclass.loadpage=function(page_request, divId){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
		document.getElementById(divId).innerHTML=page_request.responseText
	}
}

ajaxpageclass.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return null
}

ajaxpageclass.setCookie=function(name, value){
	document.cookie = name+"="+value
}

ajaxpageclass.getInitialPage=function(divId, pageinfo){
	var persistedpage=this.getCookie(divId)
	var selectedpage=(this.paginatepersist && this.getCookie(divId)!=null)? parseInt(this.getCookie(divId)) : pageinfo.selectedpage
	return (selectedpage>pageinfo.pages.length-1)? 0 : selectedpage //check that selectedpage isn't out of range
}

ajaxpageclass.createBook=function(pageinfo, divId, paginateIds){ //MAIN CONSTRUCTOR FUNCTION
	this.pageinfo=pageinfo //store object containing URLs of pages to fetch, selected page number etc
	this.divId=divId
	this.paginateIds=paginateIds //array of ids corresponding to the pagination DIVs defined for this pageinstance
	//NOTE: this.paginateInfo stores references to various components of each pagination DIV defined for this pageinstance
	//NOTE: Eg: divs[0] = 1st paginate div, pagelinks[0][0] = 1st page link within 1st paginate DIV, prevlink[0] = previous link within paginate DIV etc
	this.paginateInfo={divs:[], pagelinks:[[]], prevlink:[], nextlink:[], previouspage:null, previousrange:[null,null], leftellipse:[], rightellipse:[]}
	this.dopagerange=false
	this.pagerangestyle=''
	this.ellipse='<span style="display:none">'+ajaxpageclass.ellipse+'</span>' //construct HTML for ellipse
	var initialpage=ajaxpageclass.getInitialPage(divId, pageinfo)
	this.buildpagination(initialpage)
	this.selectpage(initialpage)
}

ajaxpageclass.createBook.prototype={

	buildpagination:function(selectedpage){ //build pagination links based on length of this.pageinfo.pages[]
		this.dopagerange=(this.pageinfo.pages.length>ajaxpageclass.pagerange) //Bool: enable limitpagerange if pagerange value is less than total pages available
		this.pagerangestyle=this.dopagerange? 'style="display:none"' : '' //if limitpagerange enabled, hide pagination links when building them
		this.paginateInfo.previousrange=null //Set previousrange[start, finish] to null to start
		if (this.pageinfo.pages.length<=1){ //no 0 or just 1 page
			document.getElementById(this.paginateIds[0]).innerHTML=(this.pageinfo.pages.length==1)? "Page 1 of 1" : ""
			return
		}
		else{ //construct paginate interface
			var paginateHTML='<div class="pagination"><ul>\n'
			paginateHTML+='<li><a href="#previous" rel="'+(selectedpage-1)+'">«</a></li>\n' //previous link HTML
			for (var i=0; i<this.pageinfo.pages.length; i++){
				var ellipses={left: (i==0? this.ellipse : ''), right: (i==this.pageinfo.pages.length-1? this.ellipse : '')} //if this is 1st or last page link, add ellipse next to them, hidden by default
				paginateHTML+='<li>'+ellipses.right+'<a href="#page'+(i+1)+'" rel="'+i+'" '+this.pagerangestyle+'>'+(i+1)+'</a>'+ellipses.left+'</li>\n'
			}
			paginateHTML+='<li><a href="#next" rel="'+(selectedpage+1)+'">»</a></li>\n' //next link HTML
			paginateHTML+='</ul></div>'
		}// end construction
		this.paginateInfo.previouspage=selectedpage //remember last viewed page
		for (var i=0; i<this.paginateIds.length; i++){ //loop through # of pagination DIVs specified
			var paginatediv=document.getElementById(this.paginateIds[i]) //reference pagination DIV
			this.paginateInfo.divs[i]=paginatediv //store ref to this paginate DIV
			paginatediv.innerHTML=paginateHTML
			var paginatelinks=paginatediv.getElementsByTagName("a")
			var ellipsespans=paginatediv.getElementsByTagName("span")
			this.paginateInfo.prevlink[i]=paginatelinks[0]
			if (paginatelinks.length>0)
				this.paginateInfo.nextlink[i]=paginatelinks[paginatelinks.length-1]
			this.paginateInfo.leftellipse[i]=ellipsespans[0]
			this.paginateInfo.rightellipse[i]=ellipsespans[1]
			this.paginateInfo.pagelinks[i]=[] //array to store the page links of pagination DIV
			for (var p=1; p<paginatelinks.length-1; p++){
				this.paginateInfo.pagelinks[i][p-1]=paginatelinks[p]
			}
			var pageinstance=this
			paginatediv.onclick=function(e){
				var targetobj=window.event? window.event.srcElement : e.target
				if (targetobj.tagName=="A" && targetobj.getAttribute("rel")!=""){
					if (!/disabled/i.test(targetobj.className)){ //if this pagination link isn't disabled (CSS classname "disabled")
						pageinstance.selectpage(parseInt(targetobj.getAttribute("rel")))
					}
				}
				return false
			}
		}
	},

	selectpage:function(selectedpage){
		//replace URL's root domain with dynamic root domain (with or without "www"), for ajax security sake:
		if (this.pageinfo.pages.length>0){
			var ajaxfriendlyurl=this.pageinfo.pages[selectedpage].replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
			ajaxpageclass.connect(ajaxfriendlyurl, this.divId) //fetch requested page and display it inside DIV
		}
		if (this.pageinfo.pages.length<=1) //if this book only contains only 1 page (or 0)
			return //stop here
		var paginateInfo=this.paginateInfo
		for (var i=0; i<paginateInfo.divs.length; i++){ //loop through # of pagination DIVs specified
			//var paginatediv=document.getElementById(this.paginateIds[i])
			paginateInfo.prevlink[i].className=(selectedpage==0)? "prevnext disabled" : "prevnext" //if current page is 1st page, disable "prev" button
			paginateInfo.prevlink[i].setAttribute("rel", selectedpage-1) //update rel attr of "prev" button with page # to go to when clicked on
			paginateInfo.nextlink[i].className=(selectedpage==this.pageinfo.pages.length-1)? "prevnext disabled" : "prevnext"
			paginateInfo.nextlink[i].setAttribute("rel", selectedpage+1)
			paginateInfo.pagelinks[i][paginateInfo.previouspage].className="" //deselect last clicked on pagination link (previous)
			paginateInfo.pagelinks[i][selectedpage].className="currentpage" //select current pagination link
		}
		paginateInfo.previouspage=selectedpage //Update last viewed page info
		ajaxpageclass.setCookie(this.divId, selectedpage)
		this.limitpagerange(selectedpage) //limit range of page links displayed (if applicable)
	},

	limitpagerange:function(selectedpage){
		//reminder: selectedpage count starts at 0 (0=1st page)
		var paginateInfo=this.paginateInfo
		if (this.dopagerange){
			var visiblelinks=ajaxpageclass.pagerange-1 //# of visible page links other than currently selected link
			var visibleleftlinks=Math.floor(visiblelinks/2) //calculate # of visible links to the left of the selected page
			var visiblerightlinks=visibleleftlinks+(visiblelinks%2==1? 1 : 0) //calculate # of visible links to the right of the selected page
			if (selectedpage<visibleleftlinks){ //if not enough room to the left to accomodate all visible left links
				var overage=visibleleftlinks-selectedpage
				visibleleftlinks-=overage //remove overage links from visible left links
				visiblerightlinks+=overage //add overage links to the visible right links
			}
			else if ((this.pageinfo.pages.length-selectedpage-1)<visiblerightlinks){ //else if not enough room to the left to accomodate all visible right links
				var overage=visiblerightlinks-(this.pageinfo.pages.length-selectedpage-1)
				visiblerightlinks-=overage //remove overage links from visible right links
				visibleleftlinks+=overage //add overage links to the visible left links
			}
			var currentrange=[selectedpage-visibleleftlinks, selectedpage+visiblerightlinks] //calculate indices of visible pages to show: [startindex, endindex]
			var previousrange=paginateInfo.previousrange //retrieve previous page range
			for (var i=0; i<paginateInfo.divs.length; i++){ //loop through paginate divs
				if (previousrange){ //if previous range is available (not null)
					for (var p=previousrange[0]; p<=previousrange[1]; p++){ //hide all page links
						paginateInfo.pagelinks[i][p].style.display="none"
					}
				}
				for (var p=currentrange[0]; p<=currentrange[1]; p++){ //reveal all active page links
					paginateInfo.pagelinks[i][p].style.display="inline"
				}
				paginateInfo.pagelinks[i][0].style.display="inline" //always show 1st page link
				paginateInfo.pagelinks[i][this.pageinfo.pages.length-1].style.display="inline" //always show last page link
				paginateInfo.leftellipse[i].style.display=(currentrange[0]>1)? "inline" : "none" //if starting page is page3 or higher, show ellipse to page1
				paginateInfo.rightellipse[i].style.display=(currentrange[1]<this.pageinfo.pages.length-2)? "inline" : "none" //if end page is 2 pages before last page or less, show ellipse to last page
			}
		}
			paginateInfo.previousrange=currentrange
	},

	refresh:function(pageinfo){
	this.pageinfo=pageinfo
	var initialpage=ajaxpageclass.getInitialPage(this.divId, pageinfo)
	this.buildpagination(initialpage)
	this.selectpage(initialpage)
	}
}


function isDate(dateStr,Minima) {
var MsgData = "";
var datePat = /^(\d{1,2})(\/)(\d{1,2})(\/)(\d{4})$/;
var matchArray = dateStr.match(datePat); // is the format ok?

if (matchArray == null) {
var MsgData = "Please enter your birth date as dd/mm/yyyy. Your current selection reads: " + dateStr;
return false;
}

day = matchArray[1]; // p@rse date into variables
month = matchArray[3];
year = matchArray[5];

if (month < 1 || month > 12) { // check month range
var MsgData = "Month must be between 1 and 12.";
return false;
}

if (day < 1 || day > 31) {
var MsgData = "Day must be between 1 and 31.";
return false;
}

if ((month==4 || month==6 || month==9 || month==11) && day==31) {
var MsgData = "Month "+month+" doesn`t have 31 days!";
return false;
}

if (month == 2) { // check for february 29th
var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
if (day > 29 || (day==29 && !isleap)) {
var MsgData = "February " + year + " doesn`t have " + day + " days!";
return false;
}
}
return true; // date is valid
}

function checkForValidDate(){
var ddlVMonth = document.getElementById("_ctl0_DropDownListMaanden");
var ddlVDay = document.getElementById("_ctl0_DropDownListDagen");
var ddlVYear = document.getElementById("_ctl0_DropDownListJaren");

if (!isDate(ddlVDay.value + '/' + ddlVMonth.value + '/' + ddlVYear.value))
{ return(false); var Messaggio =  MsgData; }

return(true); var Messaggio =  MsgData; 
}
/*
This license text has to stay intact at all times:
fleXcroll Public License Version
Cross Browser Custom Scroll Bar Script by Hesido.
Public version - Free for non-commercial uses.

This script cannot be used in any commercially built
web sites, or in sites that relates to commercial
activities. This script is not for re-distribution.
For licensing options:
Contact Emrah BASKAYA @ www.hesido.com

Derivative works are only allowed for personal uses,
and they cannot be redistributed.

FleXcroll Public Key Code: 20050907122003339
MD5 hash for this license: 9ada3be4d7496200ab2665160807745d

End of license text---
*/

// fleXcroll v1.9.5f

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 E={4L:6(){Q.N(1i,\'4v\',Q.51)},3s:6(f){7 g=17,G=1i,1Z=6Q;5(!g.20||!g.4b)B;5(3M(f)==\'4f\')f=17.20(f);5(f==14||1Z.3b.2v(\'5H\')!=-1||((1Z.3b.2v(\'5l\')!=-1||1Z.3b.2v(\'6n\')!=-1)&&!(3M(4O)!="6y"&&4O.6z))||1Z.65==\'67\'||(1Z.6d.2v(\'5h\')!=-1&&1Z.3b.2v(\'5J\')!=-1))B;5(f.1G){f.1G();B};5(!f.1W||f.1W==\'\'){7 h="6h",c=1;1E(17.20(h+c)!=14){c++};f.1W=h+c}7 k=f.1W;f.3n=2n 5E();7 l=f.3n;l.1K={6G:[\'-1s\',0],5r:[0,\'-1s\'],5f:[\'1s\',0],5m:[0,\'1s\'],5w:[0,\'-1p\'],5M:[0,\'1p\'],5Z:[0,\'-52\'],66:[0,\'+52\']};l.3R=["-2s","2s"];l.3z=["-2s","2s"];7 m=Z(\'6e\',C),D=Z(\'6c\',C),H=Z(\'6m\',C),18=Z(\'6O\',C);7 o=Z(\'5x\',C),1g=Z(\'5O\',C),2M=8;18.A.1v=\'4B 4P 5F\';18.1N();f.19.4W=\'2w\';1g.A.6F="6J";1g.A.1x="4j";1g.A.T="4j";1g.A.1P="3X";1g.A.3F="-6u";1g.1N();7 p=f.R,4X=f.1e;2c(f,18,\'16\',[\'1v-12-T\',\'1v-26-T\',\'1v-13-T\',\'1v-1R-T\']);7 q=f.R,4g=f.1e,3A=4X-4g,3C=p-q;7 s=(f.1T)?f.1T:0,5b=(f.1S)?f.1S:0;7 t=17.3O.1k,3S=/#([^#.]*)$/;7 u=[\'5B\',\'60\',\'5c\'];l.V=[];l.21=[];l.5s=l.O=[];l.5A=l.1M=[];l.1u=[8,8];l.W=[];l.1H=[0,0];l.1m=[];l.3x=[];l.X=[];1E(f.4M){m.Y(f.4M)};m.Y(o);f.Y(D);f.Y(18);5(L(f,\'1P\')!=\'3X\')f.19.1P="37";7 w=L(f,\'6p-6r\');f.19.4d=\'12\';D.A.T="4x";D.A.1x="4x";D.A.13="16";D.A.12="16";2c(f,18,"16",[\'J-12\',\'J-13\',\'J-26\',\'J-1R\']);7 x=f.1e,4e=f.R,3p;3p=D.R;D.A.5g="6b 4P 6I";5(D.R>3p)2M=C;D.A.5j="16";2c(18,f,8,[\'J-12\',\'J-13\',\'J-26\',\'J-1R\']);1o(D);1o(f);l.X[0]=D.1f-f.1f;l.X[2]=D.1h-f.1h;f.19.53=L(f,"J-1R");f.19.4G=L(f,"J-26");1o(D);1o(f);l.X[1]=D.1f-f.1f;l.X[3]=D.1h-f.1h;f.19.53=L(18,"J-13");f.19.4G=L(18,"J-12");7 y=l.X[2]+l.X[3],3E=l.X[0]+l.X[1];D.19.4d=w;2c(f,D,8,[\'J-12\',\'J-26\',\'J-13\',\'J-1R\']);H.A.T=f.1e+\'F\';H.A.1x=f.R+\'F\';D.A.T=x+\'F\';D.A.1x=4e+\'F\';H.A.1P=\'3X\';H.A.13=\'16\';H.A.12=\'16\';D.Y(m);f.Y(H);H.Y(1g);m.A.1P=\'37\';D.A.1P=\'37\';m.A.13="0";m.A.T="4y%";D.A.4W=\'2w\';D.A.12="-"+l.X[2]+"F";D.A.13="-"+l.X[0]+"F";l.3T=1g.R;l.2G=6(){7 a=m.5Q,2H=6j=0;1q(7 i=0;i<a.4A;i++){5(a[i].1e){2H=11.1Y(a[i].1e,2H)}};l.O[0]=((l.W[1]&&!l.1m[1])||l.21[1])?f.1e-l.1H[0]:f.1e;l.1M[0]=2H+y;B l.1M[0]};l.2K=6(){l.O[1]=((l.W[0]&&!l.1m[0])||l.21[0])?f.R-l.1H[1]:f.R;l.1M[1]=m.R+3E-2;B l.1M[1]};l.4D=6(){m.A.3I=\'6g\';m.A.3I=\'5t\'};l.3K=6(){D.A.T=(2M)?(l.O[0]-y-3A)+\'F\':l.O[0]+\'F\'};l.3U=6(){D.A.1x=(2M)?(l.O[1]-3E-3C)+\'F\':l.O[1]+\'F\'};l.2m=6(){l.2G();l.2K();H.2E=2n 3v();7 a=H.2E;2m(a,\'6N\');a.2i=[1a(L(a.4,\'J-13\')),1a(L(a.4,\'J-1R\'))];a.4.A.J=\'16\';a.4.K=0;a.4.2O=C;a.4.2a=1;m.4h=a.4;3o(a,0);l.1H[0]=a.1b.1e;l.3K();H.2Q=2n 3v();7 b=H.2Q;2m(b,\'5p\');b.2i=[1a(L(b.4,\'J-12\')),1a(L(b.4,\'J-26\'))];b.4.A.J=\'16\';b.4.K=0;b.4.2O=8;b.4.2a=0;m.5D=b.4;5(G.4T)b.4.A.1P=\'37\';3o(b,0);l.1H[1]=b.1b.R;l.3U();H.A.1x=f.R+\'F\';b.2p=Z(\'68\');H.Y(b.2p);b.2p.3r=6(){b.4.2S=C;l.1Q=b.4;b.4.2U=C;b.4.29=8;H.2E.4.29=8;E.N(g,\'3G\',2x);E.N(g,\'2g\',2W);E.N(g,\'2X\',2F);B 8}};l.1Q=14;l.2m();m.57(o);5(!Q.28(f,\'49\',2f)||!Q.28(f,\'4a\',2f)){f.5C=2f};Q.28(f,\'49\',2f);Q.28(f,\'4a\',2f);f.5G(\'5I\',\'0\');Q.N(f,\'5K\',6(e){5(f.2Z)B;5(!e){7 e=G.1w};7 a=e.4k;l.4u=a;l.27();5(l.1K[\'1L\'+a]&&!1i.4T){f.1c(l.1K[\'1L\'+a][0],l.1K[\'1L\'+a][1],C);5(e.1J)e.1J();B 8}});Q.N(f,\'6q\',6(e){5(f.2Z)B;5(!e){7 e=G.1w};7 a=e.4k;5(l.1K[\'1L\'+a]){f.1c(l.1K[\'1L\'+a][0],l.1K[\'1L\'+a][1],C);5(e.1J)e.1J();B 8}});Q.N(f,\'6s\',6(){l.4u=8});Q.N(g,\'2X\',2A);Q.N(f,\'6w\',6(e){5(!e)e=G.1w;7 a=(e.1A)?e.1A:(e.1n)?e.1n:8;5(!a||(a.1r&&a.1r.U(31("\\\\64\\\\b"))))B;l.4i=e.2r;l.4t=e.2k;33();1o(f);2A();E.N(g,\'2g\',3V);l.2u=[f.1h+10,f.1h+l.O[0]-10,f.1f+10,f.1f+l.O[1]-10]});6 3V(e){5(!e)e=G.1w;7 a=e.2r,3B=e.2k,3j=a+l.3D,3c=3B+l.3d;l.3e=(3j<l.2u[0]||3j>l.2u[1])?1:0;l.3f=(3c<l.2u[2]||3c>l.2u[3])?1:0;l.3k=a-l.4i;l.3m=3B-l.4t;l.36=(l.3k>40)?1:(l.3k<-40)?-1:0;l.39=(l.3m>40)?1:(l.3m<-40)?-1:0;5((l.36!=0||l.39!=0)&&!l.1U)l.1U=G.3a(6(){5(l.36==0&&l.39==0){G.2l(l.1U);l.1U=8;B};33();5(l.3e==1||l.3f==1)f.1c((l.36*l.3e)+"s",(l.39*l.3f)+"s",C)},45)};6 2A(){E.2d(g,\'2g\',3V);5(l.1U)G.2l(l.1U);l.1U=8;5(l.44)G.4V(l.44);5(l.46)G.2l(l.46)};6 33(){l.3D=(G.4Z)?G.4Z:(g.2e&&g.2e.1S)?g.2e.1S:0;l.3d=(G.54)?G.54:(g.2e&&g.2e.1T)?g.2e.1T:0};f.1G=6(a){H.2C();5(H.M[1]()===0||H.M[0]()===0)B;m.A.J=\'4B\';7 b=l.W[0],4p=l.W[1],47=H.2E,2t=H.2Q,2V,2J,2z=[];H.A.T=f.1e-3A+\'F\';H.A.1x=f.R-3C+\'F\';2z[0]=l.O[0];2z[1]=l.O[1];l.W[0]=l.2G()>l.O[0];l.W[1]=l.2K()>l.O[1];7 c=(b!=l.W[0]||4p!=l.W[1]||2z[0]!=l.O[0]||2z[1]!=l.O[1])?C:8;47.1b.3H(l.W[1]);2t.1b.3H(l.W[0]);2V=(l.W[1]||l.21[1]);2J=(l.W[0]||l.21[0]);l.2G();l.2K();l.3U();l.3K();5(!l.W[0]||!l.W[1]||l.1m[0]||l.1m[1])2t.2p.1N();1l 2t.2p.2C();5(2V)2N(47,(2J&&!l.1m[0])?l.1H[1]:0);1l m.A.13="0";5(2J)2N(2t,(2V&&!l.1m[1])?l.1H[0]:0);1l m.A.12="0";5(c&&!a)f.1G(C);m.A.J=\'16\';l.1u[0]=l.1u[1]=8};f.62=f.1c=6(a,b,c){7 d=[[8,8],[8,8]],P;5((a||a===0)&&l.V[0]){a=3L(a,0);P=H.2Q.4;P.1d=(c)?11.22(11.1Y(P.1I,P.1d-a),0):-a;P.3Q();d[0]=[-P.1d-P.24,-P.1I]}5((b||b===0)&&l.V[1]){b=3L(b,1);P=H.2E.4;P.1d=(c)?11.22(11.1Y(P.1I,P.1d-b),0):-b;P.3Q();d[1]=[-P.1d-P.24,-P.1I]}5(!c)l.1u[0]=l.1u[1]=8;B d};f.2Y=6(a){5(a==14||!59(a))B;7 b=48(a);f.1c(b[0]+l.X[2],b[1]+l.X[0],8);f.1c(0,0,C)};2c(18,f,\'16\',[\'1v-12-T\',\'1v-26-T\',\'1v-13-T\',\'1v-1R-T\']);f.57(18);f.1T=0;f.1S=0;f.2I=C;30(f,\'6i\',8);f.1G();f.1c(5b,s,C);5(t.U(3S)){f.2Y(g.20(t.U(3S)[1]))};l.5L=G.3a(6(){7 n=1g.R;5(n!=l.3T){f.1G();l.3T=n}},5N);6 3L(v,i){7 a=v.5P();v=5i(a);B 1a((a.U(/p$/))?v*l.O[i]*0.9:(a.U(/s$/))?v*l.O[i]*0.1:v)}6 41(a){7 a=a.6x(\'-\'),42=a[0],i;1q(i=1;3q=a[i];i++){42+=3q.6B(0).5U()+3q.5z(1)}B 42}6 L(a,b){5(G.4m)B G.4m(a,14).5W(b);5(a.4o)B a.4o[41(b)];B 8};6 2c(a,b,c,d){7 e=2n 3v();1q(7 i=0;i<d.4A;i++){e[i]=41(d[i]);b.19[e[i]]=L(a,d[i],e[i]);5(c)a.19[e[i]]=c}};6 Z(b,c){7 d=g.4b(\'4q\');d.1W=k+\'1L\'+b;d.1r=(c)?b:b+\' 5Y\';d.M=[6(){B d.1e},6(){B d.R}];d.2h=[6(a){d.A.T=a},6(a){d.A.1x=a}];d.4s=[6(){B L(d,"12")},6(){B L(d,"13")}];d.15=[6(a){d.A.12=a},6(a){d.A.13=a}];d.1N=6(){d.A.2j="2w"};d.2C=6(a){d.A.2j=(a)?L(a,\'2j\'):"5d"};d.A=d.19;B d};6 2m(a,b){a.1b=Z(b+\'5e\');a.2o=Z(b+\'5k\');a.25=Z(b+\'5o\');a.4=Z(b+\'5q\');a.1V=Z(b+\'5u\');a.1t=Z(b+\'5y\');H.Y(a.1b);a.1b.Y(a.4);a.1b.Y(a.2o);a.1b.Y(a.25);a.4.Y(a.1V);a.4.Y(a.1t)};6 3o(b,c){7 d=b.1b,4=b.4,i=4.2a;4.1O=b.2i[0];4.2P=d;4.D=D;4.4w=m;4.24=0;2N(b,c,C);4.3h=6(){4.K=(11.22(11.1Y(4.K,0),4.2b));4.1d=1a((4.K/4.32)*4.1I);4.24=(4.K==0)?0:(4.K==4.2b)?0:4.24;4.15[i](4.K+4.1O+"F");m.15[i](4.1d+4.24+"F")};4.3Q=6(){4.K=1a((4.1d*4.32)/4.1I);4.24=4.1d-1a((4.K/4.32)*4.1I);4.K=(11.22(11.1Y(4.K,0),4.2b));4.15[i](4.K+4.1O+"F");4.15[i](4.K+4.1O+"F");m.15[i](4.1d+"F")};l.2B=L(4,\'z-4F\');4.A.3F=(l.2B=="5R"||l.2B=="0"||l.2B==\'5T\')?2:l.2B;D.A.3F=L(4,\'z-4F\');4.3r=6(){4.2U=C;l.1Q=4;4.2S=8;4.29=8;E.N(g,\'3G\',2x);E.N(g,\'2g\',2W);E.N(g,\'2X\',2F);B 8};4.5V=2A;d.3r=d.5X=6(e){5(!e){7 e=G.1w}5(e.1A&&(e.1A==b.1V||e.1A==b.1t||e.1A==b.4))B;5(e.1n&&(e.1n==b.1V||e.1n==b.1t||e.1n==b.4))B;7 a,1X=[];33();l.27();1o(4);a=(4.2O)?e.2k+l.3d-4.1f:e.2r+l.3D-4.1h;1X[4.2a]=(a<0)?l.3z[0]:l.3z[1];1X[1-4.2a]=0;f.1c(1X[0],1X[1],C);5(e.61!="63"){2A();l.44=G.4H(6(){l.46=G.3a(6(){f.1c(1X[0],1X[1],C)},4J)},69)}B 8};d.3H=6(r){5(r){d.2C(f);l.1m[i]=(L(d,"2j")=="2w")?C:8;5(!l.1m[i])4.2C(f);1l 4.1N();l.V[i]=C;30(d,"","4N")}1l{d.1N();4.1N();l.21[i]=(L(d,"2j")!="2w")?C:8;l.V[i]=8;4.K=0;m.15[i](\'16\');30(d,"4N","")}D.15[1-i]((l.3x[i]&&(r||l.21[i])&&!l.1m[i])?l.1H[1-i]-l.X[i*2]+"F":"-"+l.X[i*2]+"F")};d.6f=2x};6 2N(a,b,c){7 d=a.1b,4=a.4,2o=a.2o,1V=a.1V,25=a.25,1t=a.1t,i=4.2a;d.2h[i](H.M[i]()-b+\'F\');d.15[1-i](H.M[1-i]()-d.M[1-i]()+\'F\');l.3x[i]=(1a(d.4s[1-i]())===0)?C:8;a.3l=a.2i[0]+a.2i[1];a.3J=1a((d.M[i]()-a.3l)*0.6l);4.4R=11.22(11.1Y(11.22(1a(l.O[i]/l.1M[i]*d.M[i]()),a.3J),45),a.3J);4.2h[i](4.4R+\'F\');4.2b=d.M[i]()-4.M[i]()-a.3l;4.K=11.22(11.1Y(0,4.K),4.2b);4.15[i](4.K+4.1O+\'F\');4.1I=D.M[i]()-l.1M[i];4.32=4.2b;2o.2h[i](d.M[i]()-25.M[i]()+\'F\');1V.2h[i](4.M[i]()-1t.M[i]()+\'F\');1t.15[i](4.M[i]()-1t.M[i]()+\'F\');25.15[i](d.M[i]()-25.M[i]()+\'F\');5(!c)4.3h();l.4D()};l.27=6(){D.1T=0;D.1S=0;f.1T=0;f.1S=0};Q.N(G,\'4v\',6(){5(f.2I)f.1G()});Q.N(G,\'6o\',6(){5(f.3t)G.4V(f.3t);f.3t=G.4H(6(){5(f.2I)f.1G()},4J)});1q(7 j=0,3i;3i=u[j];j++){7 z=f.34(3i);1q(7 i=0,2R;2R=z[i];i++){E.N(2R,\'6A\',6(){f.2Z=C});E.N(2R,\'6C\',6E=6(){f.2Z=8})}};6 2x(){B 8};6 2W(e){5(!e){7 e=G.1w};7 a=l.1Q,I,3N,6K,6M;5(a==14)B;5(!E.56&&!e.6P)2F();3N=(a.2S)?2:1;1q(7 i=0;i<3N;i++){I=(i==1)?a.4w.4h:a;5(a.2U){5(!I.29){l.27();1o(I);1o(I.2P);I.58=e.2k-I.1f;I.5a=e.2r-I.1h;I.4E=I.K;I.29=C};I.K=(I.2O)?e.2k-I.58-I.2P.1f-I.1O:e.2r-I.5a-I.2P.1h-I.1O;5(a.2S)I.K=I.K+(I.K-I.4E);I.3h()}1l I.29=8}};6 2F(){5(l.1Q!=14){l.1Q.2U=8}l.1Q=14;E.2d(g,\'3G\',2x);E.2d(g,\'2g\',2W);E.2d(g,\'2X\',2F)};6 2f(e){5(!e)e=G.1w;5(!Q.2I)B;7 a=Q,35,3P,1C=8,1j=0,1D;l.27();3g=(e.1A)?e.1A:(e.1n)?e.1n:Q;5(3g.1W&&3g.1W.U(/6a/))1C=C;5(e.4K)1j=-e.4K;5(e.4r)1j=e.4r;1j=(1j<0)?-1:+1;1D=(1j<0)?0:1;l.1u[1-1D]=8;5((l.1u[1D]&&!1C)||(!l.V[0]&&!l.V[1]))B;5(l.V[1]&&!1C)1B=f.1c(8,l.3R[1D],C);35=!l.V[1]||1C||(l.V[1]&&((1B[1][0]==1B[1][1]&&1j>0)||(1B[1][0]==0&&1j<0)));5(l.V[0]&&(!l.V[1]||1C))1B=f.1c(l.3R[1D],8,C);3P=!l.V[0]||(l.V[0]&&l.V[1]&&35&&!1C)||(l.V[0]&&((1B[0][0]==1B[0][1]&&1j>0)||(1B[0][0]==0&&1j<0)));5(35&&3P&&!1C)l.1u[1D]=C;1l l.1u[1D]=8;5(e.1J)e.1J();B 8};6 59(a){1E(a.1y){a=a.1y;5(a==f)B C}B 8};6 1o(a){7 b=a,23=1z=0;7 c="";5(b.2T){1E(b){23+=b.4c;1z+=b.4Q;b=b.2T;c+=1z+" "}}1l 5(b.x){23+=b.x;1z+=b.y}a.1h=23;a.1f=1z};6 48(a){7 b=a;23=1z=0;1E(!b.R&&b.1y&&b!=m&&L(b,\'3I\')=="6k"){b=b.1y}5(b.2T){1E(b!=m){23+=b.4c;1z+=b.4Q;b=b.2T}}B[23,1z]};6 30(a,b,c){5(!a.1r)a.1r=\'\';7 d=a.1r;5(b&&!d.U(31("(^|\\\\s)"+b+"($|\\\\s)")))d=d.3W(/(\\S$)/,\'$1 \')+b;5(c)d=d.3W(31("((^|\\\\s)+"+c+")+($|\\\\s)","g"),\'$2\').3W(/\\s$/,\'\');a.1r=d}},51:6(){5(E.38)1i.2l(E.38);7 d=/#([^#.]*)$/,2q=/(.*)#.*$/,5v,i,1F,4U=17.34("a"),2y=17.3O.1k;5(2y.U(2q))2y=2y.U(2q)[1];1q(i=0;1F=4U[i];i++){5(1F.1k&&1F.1k.U(d)&&1F.1k.U(2q)&&2y===1F.1k.U(2q)[1]){1F.3Y=C;E.N(1F,\'6t\',6(e){5(!e)e=1i.1w;7 a=(e.1n)?e.1n:Q;1E(!a.3Y&&a.1y){a=a.1y};5(!a.3Y)B;7 b=17.20(a.1k.U(d)[1]),2L=8;5(b==14)b=(b=17.6v(a.1k.U(d)[1])[0])?b:14;5(b!=14){7 c=b;1E(c.1y){c=c.1y;5(c.2Y){c.2Y(b);2L=c}};5(2L){5(e.1J)e.1J();17.3O.1k="#"+a.1k.U(d)[1];2L.3n.27();B 8}}})}};E.3Z();5(1i.4Y)1i.4Y()},3Z:6(){5(E.4z)B;E.4z=C;7 a=E.50(17.34("5n")[0],"4q",\'4l\');1q(7 i=0,3u;3u=a[i];i++)E.3s(3u)},50:6(a,b,c){5(3M(a)==\'4f\')a=17.20(a);5(a==14)B 8;7 d=2n 31("(^|\\\\s)"+c+"($|\\\\s)"),6D,3w=[],43=0;7 e=a.34(b);1q(7 i=0,2D;2D=e[i];i++){5(2D.1r&&2D.1r.U(d)){3w[43]=2D;43++}};B 3w},38:1i.3a(6(){7 a=17.20(\'4l-6H\');5(a!=14){E.3Z();1i.2l(E.38)}},4y),N:6(a,b,c){5(!E.28(a,b,c)&&a.55){a.55(\'4C\'+b,c)}},28:6(a,b,c){5(a.3y){a.3y(b,c,8);E.56=C;1i.3y("6L",6(){E.2d(a,b,c)},8);B C}1l B 8},2d:6(a,b,c){5(!E.4n(a,b,c)&&a.4I)a.4I(\'4C\'+b,c)},4n:6(a,b,c){5(a.4S){a.4S(b,c,8);B C}1l B 8}};6 5S(a){E.3s(a)};E.4L();',62,425,'||||sBr|if|function|var|false||||||||||||||||||||||||||||sY|return|true|mDv|fleXenv|px|wD|tDv|movBr|padding|curPos|getStyle|getSize|addTrggr|cntRSize|Bar|this|offsetHeight||width|match|scroller|reqS|paddings|appendChild|createDiv||Math|left|top|null|setPos|0px|document|pDv|style|parseInt|sDv|contentScroll|trgtScrll|offsetWidth|yPos|fDv|xPos|window|delta|href|else|forcedHide|srcElement|findPos||for|className||sSBr|edge|border|event|height|parentNode|curtop|target|scrollState|hoverH|iNDx|while|anchoR|scrollUpdate|barSpace|mxScroll|preventDefault|keyAct|_|cntSize|fHide|minPos|position|goScroll|bottom|scrollLeft|scrollTop|tSelectFunc|sFBr|id|mV|max|nV|getElementById|forcedBar|min|curleft|targetSkew|sSDv|right|mDPosFix|addChckTrggr|moved|indx|maxPos|copyStyles|remTrggr|documentElement|mWheelProc|mousemove|setSize|barPadding|visibility|clientY|clearInterval|createScrollBars|new|sFDv|jBox|urlExt|clientX||hBr|mTBox|indexOf|hidden|retFalse|urlBase|cPSize|intClear|barZ|fShow|pusher|vrt|mMouseUp|getContentWidth|maxCWidth|fleXcroll|hUpReq|getContentHeight|eScroll|stdMode|updateScroll|vertical|ofstParent|hrz|formItem|scrollBoth|offsetParent|clicked|vUpReq|mMoveBar|mouseup|scrollToElement|focusProtect|classChange|RegExp|sRange|pageScrolled|getElementsByTagName|vEdge|sXdir|relative|catchFastInit|sYdir|setInterval|userAgent|mdY|yScrld|mOnXEdge|mOnYEdge|hElem|doScrollPos|inputName|mdX|xAw|padLoss|yAw|fleXdata|prepareScroll|mHeight|parT|onmousedown|fleXcrollMain|refreshTimeout|tgDiv|Array|retArray|forcedPos|addEventListener|baseAct|brdWidthLoss|mY|brdHeightLoss|xScrld|padHeightComp|zIndex|selectstart|setVisibility|display|baseProp|setWidth|calcCScrollVal|typeof|maxx|location|hEdge|contentScrollPos|wheelAct|uReg|zTHeight|setHeight|tSelectMouse|replace|absolute|fleXanchor|initByClass||camelConv|reT|key|barClickRetard||barClickScroll|vBr|findRCpos|mousewheel|DOMMouseScroll|createElement|offsetLeft|textAlign|postHeight|string|intlWidth|vBar|inMposX|1em|keyCode|flexcroll|getComputedStyle|remChckTrggr|currentStyle|reqV|div|detail|getPos|inMposY|pkeY|load|scrlTrgt|100px|100|initialized|length|1px|on|fixIEDispBug|inCurPos|index|paddingLeft|setTimeout|detachEvent|80|wheelDelta|fleXcrollInit|firstChild|flexinactive|HTMLElement|solid|offsetTop|aSize|removeEventListener|opera|anchorList|clearTimeout|overflow|brdWidth|onfleXcrollRun|pageXOffset|getByClassName|globalInit|100p|paddingTop|pageYOffset|attachEvent|w3events|removeChild|pointerOffsetY|isddvChild|pointerOffsetX|oScrollX|select|visible|base|_39|borderBottom|Mac|parseFloat|borderBottomWidth|basebeg|AppleWebKit|_40|body|baseend|hscroller|bar|_38|containerSize|block|barbeg|matcH|_33|domfixdiv|barend|substr|contentSize|textarea|onmousewheel|hBar|Object|blue|setAttribute|OmniWeb|tabIndex|MSIE|keydown|sizeChangeDetect|_34|2500|zoomdetectdiv|toString|childNodes|auto|CSBfleXcroll|normal|toUpperCase|onmouseover|getPropertyValue|ondblclick|scrollgeneric|_36|input|type|commitScroll|dblclick|bscrollgeneric|vendor|_35|KDE|scrollerjogbox|425|_hscroller|2px|mcontentwrapper|platform|contentwrapper|onmouseclick|none|flex__|flexcrollactive|compPad|inline|75|scrollwrapper|Safari|resize|text|keypress|align|keyup|click|999|getElementsByName|mousedown|split|undefined|prototype|focus|charAt|blur|clsnm|onblur|fontSize|_37|init|black|12px|xScroll|unload|yScroll|vscroller|copyholder|button|navigator'.split('|'),0,{}));

// REGISTRAZIONE Account
function myHandlerAI() {
    if (myRequest.readyState == 4 && myRequest.status == 200) {
        e = document.getElementById("invioForm");
        e.innerHTML = myRequest.responseText;
    }
}
function iscrizione() {
    var Username = document.formIscrizione.account_name.value;
	var Passwd = document.formIscrizione.account_psw.value;
	var Mail = document.formIscrizione.account_mail.value;
	var Nascita = document.formIscrizione.account_nascita.value;
	var Conferma = document.formIscrizione.ck_regole.value;
	var r = Math.random();
    myRequest = CreateXmlHttpReq(myHandlerAI);
	var DatiIsc = "Username="+escape(Username)+"&Password="+escape(Passwd)+"&Mail="+escape(Mail)+"&Nascita="+escape(Nascita)+"&Conferma="+Conferma+"&rand="+r;
    myRequest.open("POST","/core/pages/iscrizione_2.php?");
	myRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
    myRequest.send(DatiIsc); 
}


function myHandlerAN() {
    if (myRequest.readyState == 4 && myRequest.status == 200) {
        e = document.getElementById("ck_name");
        e.innerHTML = myRequest.responseText;
    }
}
function ck_account() {
    var Username = document.formIscrizione.account_name.value;
	var ck_Name = document.getElementById("ck_name");
    var r = Math.random();	
	var Filtro = /^([a-zA-Z_\.\-])+$/;
if (Username.length < 3) { 
	ck_Name.innerHTML = '<img src="resources/images/home/error_small.png" />  Troppo corto. Minimo 3 caratteri';} 
else if (Username.length > 10) {
	ck_Name.innerHTML = '<img src="resources/images/home/error_small.png" />  Troppo lungo. Massimo 10 caratteri'; }  
else {
	if (Filtro.test(Username)) {
    myRequest = CreateXmlHttpReq(myHandlerAN);
    myRequest.open("GET","core/pages/ck_account.php?Tipo=1&Username="+escape(Username)+"&Rand="+r);
    myRequest.send(null);	
	return true;
} else {
	ck_Name.innerHTML = '<img src="resources/images/home/error_small.png" />  Caratteri non validi';
    return false;
      }
}
}

function ck_pass() {
	var Passwd = document.formIscrizione.account_psw.value;
	var ck_Pass = document.getElementById("ck_psw");
    var r = Math.random();	   
if (Passwd.length < 6) { 
	ck_Pass.innerHTML = '<img src="resources/images/home/error_small.png" />  Troppo corta. Minimo 3 caratteri';} 
else if (Passwd.length > 15) {
	ck_Pass.innerHTML = '<img src="resources/images/home/error_small.png" />  Troppo lunga. Massimo 15 caratteri'; }  
else { ck_Pass.innerHTML = '<img src="resources/images/home/ok_small.png" />  La password va bene'; }  
}

function myHandlerAM() {
    if (myRequest.readyState == 4 && myRequest.status == 200) {
        e = document.getElementById("ck_mail");
        e.innerHTML = myRequest.responseText;
    }
}
function ck_mail() {
	var Mail = document.formIscrizione.account_mail.value;
	var ck_Mail = document.getElementById("ck_mail");
    var r = Math.random(); 
	var Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

if (Filtro.test(Mail)) {
	myRequest = CreateXmlHttpReq(myHandlerAM);
    myRequest.open("GET","/core/pages/ck_account.php?Tipo=3&Mail="+escape(Mail)+"&Rand="+r);
    myRequest.send(null);
	return true;
} else { ck_Mail.innerHTML = '<img src="resources/images/home/error_small.png" />  Controlla Email'; return false; }
	
}


function ck_data() {
	var Nascita = document.formIscrizione.account_nascita.value;
	var ck_Nascita = document.getElementById("ck_nascita");
	if (!isDate(Nascita,16)) { ck_Nascita.innerHTML = '<img src="resources/images/home/error_small.png" /> Controlla la data. Dev\'essere in formato gg/mm/aaaa'; return false; }
	else { 
		ck_Nascita.innerHTML = '<img src="resources/images/home/ok_small.png" /> La data va bene'; return false; 
		} 
}
function myHandlerAA() {
    if (myRequest.readyState == 4 && myRequest.status == 200) {
        ee = document.getElementById("ck_invio");
        ee.innerHTML = myRequest.responseText;
    }
}

function ck_iscrivi() {
	var ck_Invio = document.getElementById("ck_invio");
    var Username = document.formIscrizione.account_name.value;
	var Num_Username = document.formIscrizione.account_name.value.length;
	var Passwd = document.formIscrizione.account_psw.value;
	var Num_Passwd = document.formIscrizione.account_psw.value.length;
	var Mail = document.formIscrizione.account_mail.value;
	var Nascita = document.formIscrizione.account_nascita.value;
	var Conferma = document.formIscrizione.ck_regole.checked;
	FiltroUsername = /^([a-zA-Z_\.\-])+$/;
    FiltroMail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
	var r = Math.random();

if ((Num_Username > 2 || Num_Username < 11) && (Conferma) && (Num_Passwd > 2 || Num_Passwd < 16) && FiltroMail.test(Mail) && FiltroUsername.test(Username) && (isDate(Nascita,16)) )
{
	myRequest = CreateXmlHttpReq(myHandlerAA);
    myRequest.open("GET","/core/pages/ck_account.php?Tipo=4&Username="+escape(Username)+"&Mail="+escape(Mail)+"&DN="+escape(Nascita)+"&Rand="+r);
    myRequest.send(null);
	return true;
	} else { 
	if ((Num_Username < 3 || Num_Username > 10 || !FiltroUsername.test(Username) ) ) 
	{ ck_Invio.innerHTML = "<input type='button' onClick='javascript:ck_iscrivi();' value='Verifica' /><br />Nome utente troppo corto o caratteri non validi.";	} 
	else if ((Num_Passwd < 3 || Num_Passwd > 15)) 
	{ ck_Invio.innerHTML = "<input type='button' onClick='javascript:ck_iscrivi();' value='Verifica' /><br />Password troppo corta";	} 
	else if (!FiltroMail.test(Mail)) 
	{ ck_Invio.innerHTML = "<input type='button' onClick='javascript:ck_iscrivi();' value='Verifica' /><br />Verifica l'indirizzo e-mail";	} 
	else if (!Conferma) 
	{ ck_Invio.innerHTML = "<input type='button' onClick='javascript:ck_iscrivi();' value='Verifica' /><br />Devi accettare regole e<br />informativa sul trattamento dei dati personali";	}
	else if (!isDate(Nascita,16))
	{ ck_Invio.innerHTML = "<input type='button' onClick='javascript:ck_iscrivi();' value='Verifica' /><br />La data di nascita e' obbligatoria";	}
 else {		
		ck_Invio.innerHTML = "<input type='button' onClick='javascript:ck_iscrivi();' value='Verifica' /><br />Mancano dati.";
	}

	return false; } 


}



function myHandlerCPC() {
    if (myRequest.readyState == 4 && myRequest.status == 200) {
        e = document.getElementById("punti");
        e.innerHTML = myRequest.responseText;
    }
}
function calcoloCaratteristiche() {
    var FOR = document.Creapg.FOR.value;
    var COS = document.Creapg.COS.value;
    var AGI = document.Creapg.AGI.value;
    var ASP = document.Creapg.ASP.value;
    var PER = document.Creapg.PER.value;
    var EGO = document.Creapg.EGO.value;
    var IST = document.Creapg.IST.value;
    var CAR = document.Creapg.CAR.value;
	var PTS = document.Creapg.PTS.value;			
    var r = Math.random();
    myRequest = CreateXmlHttpReq(myHandlerCPC);
    myRequest.open("GET","/core/creapg/contcaratteristiche.php?PTS="+escape(PTS)+"&FOR="+escape(FOR)+"&COS="+escape(COS)+"&AGI="+escape(AGI)+"&ASP="+escape(ASP)+"&PER="+escape(PER)+"&EGO="+escape(EGO)+"&IST="+escape(IST)+"&CAR="+escape(CAR)+"&Rand="+r);
    myRequest.send(null);
}

function mhobj(divchange) { 
	var divvinoobj = document.getElementById('pg_'+divchange);
	var tagginoobj = document.getElementById('ta_'+divchange);
	if (divvinoobj.getAttribute("class") == "mostra") { 
		divvinoobj.setAttribute("class", "nascondi");
		tagginoobj.innerHTML = "[Mostra]";
	} else { 
		divvinoobj.setAttribute("class", "mostra");
		tagginoobj.innerHTML = "[Nascondi]";
	}
}

