// JavaScript Document

		function sel_cin() {
			 if (document.frm_search.sel_cinema.value != 0) {
				document.frm_search.action = "cerca.php";
				document.frm_search.sel_show.value = 0;
				document.frm_search.style_search.value = 0;
				document.frm_search.submit();
			} else {
				alert('Seleziona un cinema/teatro');
				return false;
			} 
		}
		
		function sel_sh() {
			if (document.frm_search.sel_show.value != 0) {
				document.frm_search.action = "cerca.php";
				document.frm_search.sel_cinema.value = 0;
				document.frm_search.style_search.value = 0;
				document.frm_search.submit();
			} else {
				alert('Seleziona un film/spettacolo');
				return false;
			}
		}
		
		function cancella_datastart() {
			document.frm_search.data_inizio.value = "";
		}
		
		function cancella_dataend() {
			document.frm_search.data_fine.value = "";
		}
		
		function change_search(step) {
			if (step == "adv") {
				document.getElementById("ricerca_avanzata").style.display = "block";
				document.getElementById("ricerca_semplice").style.display = "none";
				document.getElementById("tendina_avanzata").style.background = "url('img/tendina_arancio.gif')";
				document.getElementById("tendina_semplice").style.background = "url('img/tendina_grigia.gif')";
				document.getElementById("tendina_semplice").style.color = "#000000";
				document.getElementById("tendina_avanzata").style.color = "#ffffff";
			} else {
				document.getElementById("ricerca_avanzata").style.display = "none";
				document.getElementById("ricerca_semplice").style.display = "block";
				document.getElementById("tendina_avanzata").style.background = "url('img/tendina_grigia.gif')";
				document.getElementById("tendina_semplice").style.background = "url('img/tendina_arancio.gif')";
				document.getElementById("tendina_semplice").style.color = "#ffffff";
				document.getElementById("tendina_avanzata").style.color = "#000000";
			}
		}
		
		function ricerca_avanzata() {
			//alert('ricerca-avanzata');
			document.frm_search.action = "ricerca_avanzata.php";
			document.frm_search.style_search.value = 1;
			document.frm_search.submit();
		} 
		
		function Check_datainizio(data_inizio) {
			document.frm_search.data_inizio.value = data_inizio;
			document.frm_search.data_fine.value = data_inizio;
			ricerca_avanzata();
		}
		
		function change() {
		//alert("entrato");
			likeSubmit('src_show.php?rand=' + escape(Math.random()) , 'POST', 'frm_search', 'div_show');
			likeSubmit('src_teatri.php?rand=' + escape(Math.random()) , 'POST', 'frm_search', 'div_teatro');
		}
		
		function cambiapagina(page) {
			document.getElementById('pagina').value = page;
			document.frm_search.action = "cerca.php";
			document.frm_search.submit();
		}
		
		function cambiapagina_adv(page) {
			document.getElementById('pagina').value = page;
			document.frm_search.action = "ricerca_avanzata.php";
			document.frm_search.submit();
		}
		
		function cambiapagina_teatre(page) {
			document.getElementById('pagina').value = page;
			//alert(document.getElementById('pagina').value);
			document.frm_list.submit();
		}
		
		function cambiapagina_news(page) {
			document.getElementById('pagina').value = page;
			//alert(document.getElementById('pagina').value);
			document.frm_list.submit();
		}
		
		function Ordering(valore) {
		document.frm_search.order.value = valore;
		document.frm_search.action = "cerca.php";
		document.frm_search.submit();
		}
		
		function Ordering_adv(valore) {
		document.frm_search.order.value = valore;
		document.frm_search.action = "ricerca_avanzata.php";
		document.frm_search.submit();
		}