

function changeTitle(new_title){	
	document.title = new_title;
}




// set the variable in the SWF
function changeVideo(str1,str2,str3){	
	
	if(window.player) {
	 	window.document["player"].SetVariable("idgallery", str1);
	 	window.document["player"].SetVariable("idcategoria", str2);
	 	window.document["player"].SetVariable("localita", str3);
	 	window.document["player"].GotoFrame(2);
	 	window.document["player"].Play();
	}
	else if(document.player) {
		document.player.SetVariable("idgallery", str1);
		document.player.SetVariable("idcategoria", str2);
		document.player.SetVariable("localita", str3);
	 	document.player.GotoFrame(2);
	 	document.player.Play();
	} else {
		//se non c'è il player, quindi se sto visualizzando qualcosa invece del player flash
		location.href = "index.php?idgallery="+str1;
	}
	
}
//-->




//Highlight image script- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

function makevisible(cur,which){
strength=(which==0)? 1 : 0.6

if (cur.style.MozOpacity)
cur.style.MozOpacity=strength
else if (cur.filters)
cur.filters.alpha.opacity=strength*100
}






function change_id_html(getid,html)
{

document.getElementById(getid).innerHTML=html;

}





/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/*var loadedobjects=""
var rootdomain="http://"+window.location.hostname

function ajaxpage(url, containerid){
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
document.getElementById(containerid).innerHTML="<p> &nbsp; <img src='images/loading.gif'><br> &nbsp; Caricamento..." //commentare per non visualizzare caricamento
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}*/

function ajaxpage(url, containerid){

	$("#"+containerid).html("<p>&nbsp;&nbsp;&nbsp;&nbsp; Loading...");

	$.ajax({
		type: "POST",
		url: url,
		data: "",
		cache: false,
		success: function(html) {
			
			$("#"+containerid).html(html);
			$.ajax({
				
				url: "veniceweb.js",
				dataType: "script"
				
			});
			
		}
	});

}





function changeSelect(x) {
	//funzione utilizzata in ricerca_avanzata.php
	
	if (x == "attiva_cerca") { 		
		document.getElementById("filtro_cameraman").disabled = true; 
		 	document.getElementById('filtro_cameraman').selectedIndex=0; 	//riporto la select al primo valore			
		document.getElementById("filtro_montatori").disabled = true; 
		 	document.getElementById('filtro_montatori').selectedIndex=0; 	//riporto la select al primo valore	
		document.getElementById("filtro_autori").disabled = true; 
		 	document.getElementById('filtro_autori').selectedIndex=0; 	//riporto la select al primo valore		  	   

		document.getElementById("cerca_avanzata").disabled = false;
		document.getElementById("id_filtro_categoria_avanzata").disabled = false; 
	}
	
	if (x == "attiva_select1") {    
		document.getElementById("cerca_avanzata").disabled = true;
			document.getElementById("cerca_avanzata").value = "";
		document.getElementById("id_filtro_categoria_avanzata").disabled = true; 
		 	document.getElementById('id_filtro_categoria_avanzata').selectedIndex=0; 	//riporto la select al primo valore			
		document.getElementById("filtro_cameraman").disabled = true; 
		 	document.getElementById('filtro_cameraman').selectedIndex=0; 	//riporto la select al primo valore			
		document.getElementById("filtro_montatori").disabled = true; 
		 	document.getElementById('filtro_montatori').selectedIndex=0; 	//riporto la select al primo valore			
		 	
		document.getElementById("filtro_autori").disabled = false;
		//	document.getElementById('filtro_autori').selectedIndex=1; 	//porto la select al secondo valore
	}
	
	if (x == "attiva_select2") {    
		document.getElementById("cerca_avanzata").disabled = true;
			document.getElementById("cerca_avanzata").value = "";
		document.getElementById("id_filtro_categoria_avanzata").disabled = true; 
		 	document.getElementById('id_filtro_categoria_avanzata').selectedIndex=0; 	//riporto la select al primo valore			
		document.getElementById("filtro_autori").disabled = true; 
		 	document.getElementById('filtro_autori').selectedIndex=0; 	//riporto la select al primo valore			
		document.getElementById("filtro_montatori").disabled = true; 
		 	document.getElementById('filtro_montatori').selectedIndex=0; 	//riporto la select al primo valore			
		 	
		document.getElementById("filtro_cameraman").disabled = false;
	}
	
	if (x == "attiva_select3") {    
		document.getElementById("cerca_avanzata").disabled = true;
			document.getElementById("cerca_avanzata").value = "";
		document.getElementById("id_filtro_categoria_avanzata").disabled = true; 
		 	document.getElementById('id_filtro_categoria_avanzata').selectedIndex=0; 	//riporto la select al primo valore			
		document.getElementById("filtro_autori").disabled = true; 
		 	document.getElementById('filtro_autori').selectedIndex=0; 	//riporto la select al primo valore			
		document.getElementById("filtro_cameraman").disabled = true; 
		 	document.getElementById('filtro_cameraman').selectedIndex=0; 	//riporto la select al primo valore			
		 	
		document.getElementById("filtro_montatori").disabled = false;
	}

}


function fai_redirect_invece_che_ajax(id_video) {

	if ( (window.player) || (document.player) ) {	//solo se c'è il player flash
	
		location.href = "index.php?idgallery="+id_video;
		
	}

}

