/***********************************************
* Show Hint script- � Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/	
// HINT DECLARATION AREA
var hints = new Array();

	hints[0] = "Only numbers allowed";
	hints[1] = "Upload Image File.<br/> Maximum size is: 800 x 600<br/>Allowed filetypes: JPEG, JPG, PJPEG, GIF";
	hints[2] = "Upload Image File.<br/> Maximum size is: 1024 x 768<br/>Allowed filetypes: JPEG, JPG, PJPEG, GIF";
	hints[3] = "Upload Movie File.<br/> Allowed filetypes: AVI, MPEG, MPG, WMV";
	hints[4] = "Area Riservata Object File.<br/> Allowed filetypes: AVI, MPEG, MPG, WMV, JPEG, JPG, PJPEG, GIF, DOC, PDF, PSD, AI, INDD";
	hints[5] = "Username must be at least 6 characters. Allowed characters are letters and digits";
	hints[6] = "Password field must be at least 8 characters. Allowed characters are letters and digits";
	hints[7] = "Upload Image File.<br/> Maximum width is: 240 pixels<br/>Allowed filetypes: JPEG, JPG, PJPEG, GIF";
	hints[8] = "Upload Image File.<br/> Maximum size is: 310 x 410<br/>Allowed filetypes: JPEG, JPG, PJPEG, GIF";
	hints[9] = "Upload Image File.<br/> Maximum size is: 180 x 410<br/>Allowed filetypes: JPEG, JPG, PJPEG, GIF";
	hints[10]= "Upload Image File.<br/> Maximum size is: 550 x 420<br/>Allowed filetypes: JPEG, JPG, PJPEG, GIF";
	hints[11]= "Cinemastore Magazine File.<br/> Allowed filetypes: PDF";
	hints[12]= "Upload Image File.<br/> Maximum size is: 195 x 420<br/>Allowed filetypes: JPEG, JPG, PJPEG, GIF";
	hints[13]= "Write shop address or shop city or shop province or shop region";
	hints[14]= "Allowed date format is: DD/MM/YYYY";
	hints[15]= "Upload Image File.<br/> Maximum image width: 480; height: unlimited<br/>Allowed filetypes: JPEG, JPG, PJPEG, GIF";

	hints[16]="Segnala ad un amico";
	hints[17]="Avvisami quando questo film sarà disponibile nei negozi Cinemastore";
	hints[18]="Prenota";
var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
		while (parentEl!=null){
			totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
		}
	return totaloffset;
}

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
	var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
		if (whichedge=="rightedge"){
			var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
			dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
		}
		else{
			var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
			dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
					if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
						edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
		}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
		if ((ie||ns6) && document.getElementById("hintbox")){
			dropmenuobj=document.getElementById("hintbox")
			dropmenuobj.innerHTML=menucontents
			dropmenuobj.style.left=dropmenuobj.style.top=-500
			if (tipwidth!=""){
			dropmenuobj.widthobj=dropmenuobj.style
			dropmenuobj.widthobj.width=tipwidth
			}
			dropmenuobj.x=getposOffset(obj, "left")
			dropmenuobj.y=getposOffset(obj, "top")
			dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
			dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
			dropmenuobj.style.visibility="visible"
			obj.onmouseout=hidetip
		}
}

function hidetip(e){
	dropmenuobj.style.visibility="hidden"
	dropmenuobj.style.left="-500px"
}

function createhintbox(){
	var divblock=document.createElement("div")
	divblock.setAttribute("id", "hintbox")
	document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox
// END HINT AREA



//ERROR BOX
/***********************************************
* Show Hint script- � Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/	
// HINT DECLARATION AREA

var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
		while (parentEl!=null){
			totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
		}
	return totaloffset;
}

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
	var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
		if (whichedge=="rightedge"){
			var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
			dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
		}
		else{
			var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
			dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
					if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
						edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
		}
return edgeoffset
}

function showerrorbox(menucontents, obj, e, tipwidth){
		if ((ie||ns6) && document.getElementById("errorbox")){
			dropmenuobj=document.getElementById("errorbox")
			dropmenuobj.innerHTML=menucontents
			dropmenuobj.style.left=dropmenuobj.style.top=-500
			if (tipwidth!=""){
			dropmenuobj.widthobj=dropmenuobj.style
			dropmenuobj.widthobj.width=tipwidth
			}
			dropmenuobj.x=getposOffset(obj, "left")
			dropmenuobj.y=getposOffset(obj, "top")
			dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
			dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
			dropmenuobj.style.visibility="visible"
			obj.onmouseout=hidetip
		}
}

function createerrorbox(){
	var divblock=document.createElement("div")
	divblock.setAttribute("id", "errorbox")
	document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createerrorbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createerrorbox)
else if (document.getElementById)
window.onload=createerrorbox
// END ERROR AREA

var clockID = 0;

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];}
}

// Shop management
function addShop(){
 	document.location = 'index.php?target=loggedin&action=shops&operation=add';
 }

function editShop(formId){
 	document.forms['shopOperation' + formId].action = 'index.php?target=loggedin&action=shops&operation=edit';
	document.forms['shopOperation' + formId].submit();
 }

function deleteShop(formId){
	var agree = confirm("Are you sure you want to delete this shop?");
	if (agree) {
 		document.forms['shopOperation' + formId].action = 'index.php?target=loggedin&action=shops&operation=delete';
	 	document.forms['shopOperation' + formId].submit();
	}
}

// Shop management
function addAro(){
 	document.location = 'index.php?target=loggedin&action=objects&operation=add';
 }

function editAro(formId){
 	document.forms['aroOperation' + formId].action = 'index.php?target=loggedin&action=objects&operation=edit';
	document.forms['aroOperation' + formId].submit();
 }

function deleteAro(formId){
	var agree = confirm("Are you sure you want to delete this object?");
	if (agree) {
 		document.forms['aroOperation' + formId].action = 'index.php?target=loggedin&action=objects&operation=delete';
	 	document.forms['aroOperation' + formId].submit();
	}
}

// Registered user management
function addRegistereduser(){
 	document.location = 'index.php?target=loggedin&action=registeredusers&operation=add';
 }

function editRegistereduser(formId){
 	document.forms['registereduserOperation' + formId].action = 'index.php?target=loggedin&action=registeredusers&operation=edit';
	document.forms['registereduserOperation' + formId].submit();
 }

function deleteRegistereduser(formId){
	var agree = confirm("Are you sure you want to delete this user?");
	if (agree) {
 		document.forms['registereduserOperation' + formId].action = 'index.php?target=loggedin&action=registeredusers&operation=delete';
	 	document.forms['registereduserOperation' + formId].submit();
	}
}

// Other user management
function addOtheruser(){
 	document.location = 'index.php?target=loggedin&action=otherusers&operation=add';
 }

function editOtheruser(formId){
 	document.forms['otheruserOperation' + formId].action = 'index.php?target=loggedin&action=otherusers&operation=edit';
	document.forms['otheruserOperation' + formId].submit();
 }

function deleteOtheruser(formId){
	var agree = confirm("Are you sure you want to delete this user?");
	if (agree) {
 		document.forms['otheruserOperation' + formId].action = 'index.php?target=loggedin&action=otherusers&operation=delete';
	 	document.forms['otheruserOperation' + formId].submit();
	}
}

// Wallpaper Management
function addWallpaper(){
 	document.forms['wallpaperAdd'].action = 'index.php?target=loggedin&action=wallpapers&operation=add';
	document.forms['wallpaperAdd'].submit();
 }

function editWallpaper(formId){
 	document.forms['wallpaperOperation' + formId].action = 'index.php?target=loggedin&action=wallpapers&operation=edit';
	document.forms['wallpaperOperation' + formId].submit();
 }

function deleteWallpaper(formId){
	var agree = confirm("Are you sure you want to delete this wallpaper?");
	if (agree) {
 		document.forms['wallpaperOperation' + formId].action = 'index.php?target=loggedin&action=wallpapers&operation=delete';
	 	document.forms['wallpaperOperation' + formId].submit();
	}
}


// Trailer Management
function addTrailer(){
 	document.forms['trailerAdd'].action = 'index.php?target=loggedin&action=trailers&operation=add';
	document.forms['trailerAdd'].submit();
 }

function editTrailer(formId){
 	document.forms['trailerOperation' + formId].action = 'index.php?target=loggedin&action=trailers&operation=edit';
	document.forms['trailerOperation' + formId].submit();
 }

function deleteTrailer(formId){
	var agree = confirm("Are you sure you want to delete this trailer?");
	if (agree) {
 		document.forms['trailerOperation' + formId].action = 'index.php?target=loggedin&action=trailers&operation=delete';
	 	document.forms['trailerOperation' + formId].submit();
	}
}

// used for the direction of links
function goDirection(direction, page,form){
	document.forms[form].action = 'index.php?target=loggedin&action='+direction+'&page='+page;
	document.forms[form].submit();
}

function goDirectionMain(direction, page,form){
	document.forms[form].action = 'ricerca.html?page='+page;
	document.forms[form].submit();
}

function goDirectionMain2(direction, page,form){
	document.forms[form].action = 'index.php?'+direction+'&page='+page;
	document.forms[form].submit();
}

// Categories management
function addCategory(){
	document.location = 'index.php?target=loggedin&action=categories&operation=add';	
 }

function editCategory(formId){
 	document.forms['categoryOperation' + formId].action = 'index.php?target=loggedin&action=categories&operation=edit';
	document.forms['categoryOperation' + formId].submit();
 }

function deleteCategory(formId){
	var agree = confirm("Are you sure you want to delete this category?");
	if (agree) {
 		document.forms['categoryOperation' + formId].action = 'index.php?target=loggedin&action=categories&operation=delete';
	 	document.forms['categoryOperation' + formId].submit();
	}
}



// News management
function addNews(){
	document.location = 'index.php?target=loggedin&action=news&operation=add';	
}

function editNews(formId){
 	document.forms['newsOperation' + formId].action = 'index.php?target=loggedin&action=news&operation=edit';
	document.forms['newsOperation' + formId].submit();
}

function deleteNews(formId){
	var agree = confirm("Are you sure you want to delete this news?");
	if (agree) {
 		document.forms['newsOperation' + formId].action = 'index.php?target=loggedin&action=news&operation=delete';
	 	document.forms['newsOperation' + formId].submit();
	}
}


// Newsletter management
function addNewsletter(){
	document.location = 'index.php?target=loggedin&action=newsletters&operation=add';	
}

function editNewsletter(formId){
 	document.forms['newsletterOperation' + formId].action = 'index.php?target=loggedin&action=newsletters&operation=edit';
	document.forms['newsletterOperation' + formId].submit();
}

function deleteNewsletter(formId){
	var agree = confirm("Are you sure you want to delete this newsletter?");
	if (agree) {
 		document.forms['newsletterOperation' + formId].action = 'index.php?target=loggedin&action=newsletters&operation=delete';
	 	document.forms['newsletterOperation' + formId].submit();
	}
}

// AR User management
function addArUser(){
	document.location = 'index.php?target=loggedin&action=users&operation=add';	
}

function editArUser(formId){
 	document.forms['aruserOperation' + formId].action = 'index.php?target=loggedin&action=users&operation=edit';
	document.forms['aruserOperation' + formId].submit();
}

function deleteArUser(formId){
	var agree = confirm("Are you sure you want to delete this user?");
	if (agree) {
 		document.forms['aruserOperation' + formId].action = 'index.php?target=loggedin&action=users&operation=delete';
	 	document.forms['aruserOperation' + formId].submit();
	}
}

function changePassword(formId){
 	document.forms['aruserOperation' + formId].action = 'index.php?target=loggedin&action=users&operation=chgpsw';
	document.forms['aruserOperation' + formId].submit();
}


function UpdateClock(){ 
var dte = new Date();
var hrs = dte.getHours();
var min = dte.getMinutes(); 
var sec = dte.getSeconds();
var col = ":";
var dateSpacer = "/";
var spc = " ";
var day = dte.getDate();
var month = dte.getMonth();
var year = dte.getFullYear();
var apm;

month = month + 1;

	if (12 < hrs) { 
	apm="PM";
	hrs-=12;
	}
	else {
	apm="AM";
	}

	if (hrs == 0) hrs=12;
	if (min<=9) min="0"+min;
	if (month<=9) month="0"+month;	
	if (day<=9) day="0"+day;	
	if (sec<=9) sec="0"+sec;

	document.getElementById('clock').innerHTML=hrs+col+min+col+sec+spc+apm+ '&nbsp;' + day+ dateSpacer + month + dateSpacer + year;
	
	clockID = setTimeout("UpdateClock()", 1000);
} 


function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}


function checkDate(field){
var checkstr = "0123456789";
var DateField = field;
var Datevalue = "";
var DateTemp = "";
var seperator = "/";
var day;
var month;
var year;
var leap = 0;
var err = 0;
var i;
   err = 0;
	   DateValue = DateField;
   /* Delete all chars except 0..9 */
   for (i = 0; i < DateValue.length; i++) {
	  if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) {
	     DateTemp = DateTemp + DateValue.substr(i,1);
	  }
   }
   DateValue = DateTemp;
   /* Always change date to 8 digits - string*/
   /* if year is entered as 2-digit / always assume 20xx */
   if (DateValue.length == 6) {
      DateValue = DateValue.substr(0,4) + '20' + DateValue.substr(4,2); }
   if (DateValue.length != 8) {
      err = 19;}
   /* year is wrong if year = 0000 */
   year = DateValue.substr(4,4);
   if (year == 0) {
      err = 20;
   }
   /* Validation of month*/
   month = DateValue.substr(2,2);
   if ((month < 1) || (month > 12)) {
      err = 21;
   }
   /* Validation of day*/
   day = DateValue.substr(0,2);
   
   //alert('Day: '+ day +  ' month: ' + month + ' year: ' + year);
   if (day < 1) {
     err = 22;
   }
   /* Validation leap-year / february / day */
   if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) {
      leap = 1;
   }
   if ((month == 2) && (leap == 1) && (day > 29)) {
      err = 23;
   }
   if ((month == 2) && (leap != 1) && (day > 28)) {
      err = 24;
   }
   /* Validation of other months */
   if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) {
      err = 25;
   }
   if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) {
      err = 26;
   }
   /* if 00 ist entered, no error, deleting the entry */
   if ((day == 0) && (month == 0) && (year == 00)) {
      err = 0; day = ""; month = ""; year = ""; seperator = "";
   }
   /* if no error, write the completed date to Input-Field (e.g. 13.12.2001) */
   if (err == 0) {
      //DateField.value = day + seperator + month + seperator + year;
	  return true;
   }
   /* Error-message if err != 0 */
   else {
     /* alert("Date is incorrect!");	  
      DateField.select();
	  DateField.focus();*/
	  return false;
   }
}


function mapSelected(id){ 
var d;
d = document.getElementById('mapImage');
d.src = '/images/map/'+id+'.gif';
}

function mapDefault(selectedRegion){ 
var d;
var region = new Array(20);

	region[0] ="initialMap";
	region[1] ="sardegna";
	region[2] ="sicilia";
	region[3] ="calabria";
	region[4] ="basilicata";
	region[5] ="puglia";
	region[6] ="mosile";
	region[7] ="campania";
	region[8] ="abruzzo";
	region[9] ="lazio";
	region[10]="marche";
	region[11]="umbria";
	region[12]="toscana";
	region[13]="emiliaromagna";
	region[14]="veneto";
	region[15]="liguria";
	region[16]="friuliveneziagiulia";
	region[17]="trentinoaltoadise";
	region[18]="lombardia";
	region[19]="piedmonte";
	region[20]="valledaosta";

d = document.getElementById('mapImage');
d.src = '/images/map/'+region[selectedRegion]+'.gif';
}


function showCredits() {
	window.open('template/credits.php','mywindow2','width=280,height=280,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');	
}

function showWallpaperPopup(imageName,type) {
	if(type=='800') 
		window.open('../template/admin/mediaPopup.php?wId='+imageName+'&type='+type,'mywindow800','width=800,height=600,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');	
	else
	if(type=='1024')
		window.open('../template/admin/mediaPopup.php?wId='+imageName+'&type='+type,'mywindow1024','width=1024,height=768,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');	
	
}

function showTrailerPopup(fileName) {
		window.open('../template/admin/mediaPopup.php?tId='+fileName,'mywindowTrailer','width=800,height=600,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');		
}

function showShops(object, region) {
	var whoIsSelected = object.selectedIndex;
    var selectedValue = object.options[whoIsSelected].value;   
	document.location = document.regioni.hidden_root.value+'negozi-'+region+'-'+document.regioni.hidden_regione.value+'/'+selectedValue+'.html';
}


function cancelMovie(formId){
 		document.forms['mediaOperation' + formId].action = 'index.php?target=loggedin&action=trailers';
	 	document.forms['mediaOperation' + formId].submit();
}

function showWallpaperManager(formId){
 	document.forms['mediaOperation' + formId].action = 'index.php?target=loggedin&action=wallpapers';
	document.forms['mediaOperation' + formId].submit();
 }

function showNoleggioOnline(formId){
 	document.forms['mediaOperation' + formId].action = 'index.php?target=loggedin&action=movieUpload&op=noleggio';
	document.forms['mediaOperation' + formId].submit();
 }

function showTrailerManager(formId){
 		document.forms['mediaOperation' + formId].action = 'index.php?target=loggedin&action=trailers';
	 	document.forms['mediaOperation' + formId].submit();
}

function deleteMovie(formId){
 		document.forms['mediaOperation' + formId].action = 'index.php?target=loggedin&action=movieUpload&op=delete';
	 	document.forms['mediaOperation' + formId].submit();
}

function showDownload(objectId) {
	window.open('template/objectDownload.php?oId='+objectId,'mywindowDownload','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');	
}

function showNewsPopup(fileName) {
		window.open('../template/admin/mediaPopup.php?nId='+fileName,'mywindowNews','width=150,height=150,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');		
}

function showNewsletterPopup(fileName) {
		window.open('../template/admin/mediaPopup.php?nlId='+fileName,'mywindowNewsletter','width=400,height=400,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');		
}

function previewNewsletter(newsletterId) {
		window.open('../template/admin/newsletterTemplate.php?nlId='+newsletterId,'mywindowNewsletterPreview','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');		
}


function showWallpaperDownloadPopup(imageName,type) {
	if(type=='800') 
		window.open('template/wallpaperPopup.php?wId='+imageName+'&type='+type,'mywindow800','width=800,height=600,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');	
	else
	if(type=='1024')
		window.open('template/wallpaperPopup.php?wId='+imageName+'&type='+type,'mywindow1024','width=1024,height=768,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes');		
}

function previewNewsletterFrontend(newsletterId) {
		window.open('template/newsletterTemplate.php?nlId='+newsletterId,'mywindowNewsletterPreview','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');		
}

function rateMovie(rId) {
		document.forms['ratingForm'].action = document.forms['ratingForm'].action + rId;
		document.forms['ratingForm'].submit();
}

function showHideAdvancedFilter() {
	var tableFilter = document.getElementById('filterTable');
	var aFilter = document.getElementById('advancedFilter');
	var aButton = document.getElementById('advancedFilterButton');
	var allDiv 	= document.getElementById('allMovie');

	if(aFilter.style.display=='none'){
		aFilter.style.display='block';	
		aButton.value="Chiudi ricerca avanzata";	
		allDiv.style.height = '250px';
		tableFilter.style.background = 'url(images/boxBig.gif)'; 
		tableFilter.style.height = '130px'; 
	} else 
		if(aFilter.style.display=='block'){
			aFilter.style.display='none';	
			aButton.value="Mostra ricerca avanzata";	
			allDiv.style.height = '310px';
			tableFilter.style.background = 'url(images/box.gif)'; 			
			tableFilter.style.height = '60px'; 
		}	
}

function openRentApp(links, selectedShopId, movieId){
	var url = links[selectedShopId];
	if(movieId!='-999')
		url += '?movieId='+movieId;
	rentWindow = window.open(url,'rentApp','');	
}

function showHideActorContainer(selectedContainer) {
	var container = document.getElementById(selectedContainer);

	if(container.style.display=='none')
	{
		container.style.display='block';	
	} 
	else 
		if(container.style.display=='block')
		{
			container.style.display='none';	
		}	
}
