// INIZIALIZZAZIONE AREA TESTO BIOGRAFIA
function initScrollLayer() {
  var wndo = new dw_scrollObj('wn', 'centrale');
  wndo.setUpScrollbar("dragBar", "track", "v", 0, 0);
  dw_scrollObj.GeckoTableBugFix('wn'); 
}

// INIZIALIZZAZIONE SCROLL ORIZZONTALE PRESS
function initScrollLayerPress() {
  var wndo = new dw_scrollObj('wn', 'centrale');
  dw_scrollObj.GeckoTableBugFix('wn'); 
}

// ROLLOVER IMMAGINI
function on(foto) {
	document.getElementById(foto).style.display='';
	document.getElementById('centrale').style.display='none';
	document.getElementById('scrollbar').style.display='none';
}
function off(foto) {
	document.getElementById(foto).style.display='none';
	document.getElementById('centrale').style.display='';
	document.getElementById('scrollbar').style.display='';
}

// PAGINA PRESS
function interno_press(titolo,numero) {
	document.getElementById('interno').style.backgroundImage='url("images/press/'+titolo+'_'+numero+'.jpg")';
}
function cover_press() {
	for (i=0; i < elementi.length; i++) {
		document.write('<td align="center"><a href="#" onclick="interno_press_on(\''+elementi[i]+'\');"><img src="images/press/'+elementi[i]+'_tn.jpg" height="45" border="0"/></a></td>');
	}
}
function interno_press_on(titolo) {
	for (i=0; i < elementi.length; i++) {
		document.getElementById(elementi[i]).style.display='none';
	}
	document.getElementById(titolo).style.display='';
	document.getElementById('interno').style.backgroundImage='url("images/press/'+titolo+'.jpg")';
}
function fotopress(titolo,n) { // TITOLO DEL FILM, N NUMERO DELLE FOTO
	for (i=1;i<=n;i++) {
	document.write('<td bgcolor="#92A7DA"><a href="#" onclick="interno_press(\''+titolo+'\',\''+i+'\');" onMouseOver="MM_swapImage(\''+titolo+i+'\',\'\',\'images/bott1press.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/bott0press.gif" name="'+titolo+i+'" width="12" height="12" border="0"/></a></td>');}
}

// PAGINA PHOTO
function interno_photo_on(titolo) {
	var elementi=new Array('home','01','02','03','04','05','poster');
	for (i=0;i<elementi.length;i++) {
	document.getElementById(elementi[i]).style.display='none';
	document.getElementById("des"+elementi[i]).style.display='none';}
	document.getElementById(titolo).style.display='';
	document.getElementById("des"+titolo).style.display='';
}

function interno_film(quale,numero) {
	if (numero==0) ext="gif"; else ext="jpg";
	document.getElementById('interno').style.display='';
	document.getElementById('interno').style.backgroundImage='url("images/film/'+quale+numero+'.'+ext+'")';
	document.getElementById(quale+'_dettagli').style.display='';
	document.getElementById(quale+'_navigazione').style.display='';
	document.getElementById('home').style.display='none';
}

function fotofilm(titolo,n) { // TITOLO DEL FILM, N NUMERO DELLE FOTO
	for (i=1;i<=n;i++) {
	document.write('<td bgcolor="#92A7DA"><a href="#" onclick="interno_film(\''+titolo+'\',\''+i+'\');" onMouseOver="MM_swapImage(\''+titolo+i+'\',\'\',\'images/bott1.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images/bott.gif" name="'+titolo+i+'" width="12" height="12" border="0"></a></td>');}
}

// PAGINA SCRIVIMI
function ControllaMail() {
   if (document.modulo.nome.value == "") {
		alert("Inserire il NOME");
		document.modulo.nome.focus();
		return false;}
	if (document.modulo.citta.value == "") {
		alert("Inserire la CITTA'");
		document.modulo.citta.focus();
		return false;}
	if (document.modulo.eta.value == "") {
		alert("Inserire l'ETA'");
		document.modulo.eta.focus();
		return false;}
   EmailAddr = document.modulo.mail.value;
	Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
	if (document.modulo.mail.value == "") {
		alert("Inserire l'EMAIL");
		document.modulo.mail.focus();
		return false;}
	if (!Filtro.test(EmailAddr)) {
		alert("L'indirizzo EMAIL non è corretto");
		document.modulo.mail.focus();
		return false;}
	if (document.modulo.commento.value == "") {
		alert("Inserire il MESSAGGIO");
		document.modulo.commento.focus();
		return false;}
}

// HOME
function check()   {

	EmailAddr = document.newsletter.email.value;
	Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
	if (document.newsletter.email.value == "") {
		alert("Inserire l'EMAIL");
		document.newsletter.email.focus();
		return false;}
	if (!Filtro.test(EmailAddr)) {
		alert("L'indirizzo EMAIL non è corretto");
		document.newsletter.email.focus();
		return false;}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

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_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_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];}
}
