// JavaScript Document
<!--


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function Draw(id){
	
	var divh = document.getElementById('stripeB').offsetHeight;
		
	var ttldiv = divh;// + 1;
	
	if(id=="footer"){
	   document.write ('<div id = "footer" style = "top:' + ttldiv  + 'px;"><p>&copy; 2010 DucatiClassic.it - Tutti i diritti riservati - <a href=\"mailto:info@ducaticlassic.it\" class=\"footer\">Contattaci</a></p></div>')
	   }else{
	document.write ('<div id = "'+ id +'" style = "height:' + ttldiv  + 'px;"></div>')
	}
}

function Dimensione(){
var IE6vDoc=(document.compatMode && document.compatMode != "BackCompat")?1:0;
var w = (window.innerWidth)?window.innerWidth:
	((IE6vDoc)?document.documentElement.clientWidth:
	document.body.clientWidth);
var h = (window.innerHeight)?window.innerHeight:
	((IE6vDoc)?document.documentElement.clientHeight:
	document.body.clientHeight);
}

function Parametri( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

function Controlla_Login(){
	username = document.modulo.username.value;
	password = document.modulo.password.value;
	
	if ((username == "") || (username == "undefined")) {
		alert("Non hai inserito nessuna username.");
		document.modulo.username.focus();
		return false;
		}
		
	if ((password == "") || (password == "undefined")) {
		alert("Non hai inserito nessuna password.");
		document.modulo.password.focus();
		return false;
		}
}
function Controlla_Commento(){
	autore = document.modulo.autore.value;
	commento = document.modulo.commento.value;
	
	if ((autore == "") || (autore == "undefined")) {
		alert("Il campo Autore è vuoto.");
		document.modulo.autore.focus();
		return false;
		}
		
	if ((commento == "") || (commento == "undefined")) {
		alert("Non hai inserito nessun commento.");
		document.modulo.commento.focus();
		return false;
		}
}

function Controlla_News(){
	titolo = document.modulo.titolo.value;
	testo = document.modulo.testo.value;
	link_post = document.modulo.link_post.value;
	autore = document.modulo.autore.value;
	
	
	
	if ((titolo == "") || (titolo == "undefined")) {
		alert("Il campo Titolo è vuoto.");
		document.modulo.titolo.focus();
		return false;
		}
		
	if ((testo == "") || (testo == "undefined")) {
		alert("Il campo Testo è vuoto.");
		document.modulo.testo.focus();
		return false;
		}
	/*if ((link_post == "") || (link_post == "undefined")) {
		alert("Il campo Link è vuoto.");
		document.modulo.link_post.focus();
		return false;
		}*/
	if ((autore == "") || (autore == "undefined")) {
		alert("Il campo Autore è vuoto.");
		document.modulo.autore.focus();
		return false;
		}
	return true;
}

function Controlla_Evento(){
	titolo = document.modulo.titolo.value;
	testo = document.modulo.testo.value;
	link_post = document.modulo.link_post.value;
	autore = document.modulo.autore.value;
	num_miniature = document.modulo.num_miniature.value;
	slide_commento = document.modulo.slide_commento.value;
	summary = document.modulo.summary.value;
	
	
	
	if ((titolo == "") || (titolo == "undefined")) {
		alert("Il campo Titolo è vuoto.");
		document.modulo.titolo.focus();
		return false;
		}
		
	if ((testo == "") || (testo == "undefined")) {
		alert("Il campo Testo è vuoto.");
		document.modulo.testo.focus();
		return false;
		}
		
	/*if ((link_post == "") || (link_post == "undefined")) {
		alert("Il campo Link è vuoto.");
		document.modulo.link_post.focus();
		return false;
		}*/
		
	if ((num_miniature == "") || (num_miniature == "undefined")) {
		alert("Il campo Numero Miniature è vuoto.");
		document.modulo.num_miniature.focus();
		return false;
		}
		
	if ((slide_commento == "") || (slide_commento == "undefined")) {
		alert("Il campo Slide Commento è vuoto.");
		document.modulo.slide_commento.focus();
		return false;
		}
		
	if ((summary == "") || (summary == "undefined")) {
		alert("Il campo Sommario è vuoto.");
		document.modulo.summary.focus();
		return false;
		}
		
	if ((autore == "") || (autore == "undefined")) {
		alert("Il campo Autore è vuoto.");
		document.modulo.autore.focus();
		return false;
		}
		
	return true;
}

function FBshare(u,n){
weblink=window.open(u,n,"width=575,height=380");
}

//-->
