

// ------------------ REGIONI E PROVINCIE ------------------ //
function selectedByValue(objCombo,val){
	for(var i=0;i<objCombo.options.length; i++){
		if(String(objCombo.options[i].value) == String(val)){
			objCombo.options[i].selected = true;
			return;
		}
	}
}
function clearListBox(objCombo,bAll){
	if((String(bAll) == 'true')){
		for(var i=objCombo.options.length;i>0;i--)	objCombo.options[i] = null;
	}else{ 
		for(var i=objCombo.options.length;i>-1;i--)	objCombo.options[i] = null;
	}
}
function updateListBox(objCombo,UpdateCombo,bAll){
	var objUpdateCombo = eval('objCombo.form.' + UpdateCombo);
	clearListBox(objUpdateCombo,bAll);
	var arName;
	arName = objCombo.options[objCombo.selectedIndex].value;
	arName = arName.replace(/ /gi,''); arName = arName.replace(/'/gi,''); arName = arName.replace(/"/gi,''); arName = arName.replace(/;/gi,''); arName = arName.replace(/=/gi,'');
	if(String(bAll)=='true' && objCombo.selectedIndex==0){		
		arName = objCombo.form.name + '_' + objCombo.name + '_ALL_';		
		loadListBox(objUpdateCombo,arName);
	}else if(arName != ''){
		arName = objCombo.form.name + '_' + objCombo.name + arName;
		loadListBox(objUpdateCombo,arName);
	}
	if(String(bAll)!='true' && String(bAll)!='false' && objUpdateCombo.length==0){
		objUpdateCombo.options[0] = new Option('','',true,true);
	}
	objUpdateCombo.options[0].selected = true;
}
function loadListBox(objChSelect, arName)
{	
	var arLabel = eval(arName + '_desc');
	var arValue = eval(arName + '_val');

	var j=0;
	if(objChSelect.options.length==1)
		j=1;
	if (arLabel.length >0){
		for (var i=0; i<arLabel.length; i++)
			objChSelect.options[i+j] = new Option(arLabel[i], arValue[i], false, false);
	}
}

function setRegionAndProv(idReg) {
	selectedByValue(document.thisForm.usrRegion,idReg);
	updateListBox(document.thisForm.usrRegion,'usrProv',true);
}



	var objprevDV=null
	function zoomIMG(obj,sz_dvzoom,sz_zoom,key)
	{
		var cntrZoom=null;
		
		/*
		obj.parentElement.className='divphotoclicked'
		if (objprevDV!=null)
			objprevDV.className='divphoto';
		//Store parent element IMAGE for style's change
		objprevDV=obj.parentElement.tagName=='DIV' ?obj.parentElement:null;
		*/

		


		var i=0;
		for (i=0 ;i<document.all['dvcontainer'].length ;i++)
			document.all['dvcontainer'][i].className="divphoto";
			
		for (i=0 ;i<document.all['dvcontainer'].length ;i++)
		{
				if (document.all['dvcontainer'][i].name==key)
						document.all['dvcontainer'][i].className="divphotoclicked";
		}	
		
		document.getElementById(sz_zoom).src=	obj.srcIMG;
		document.getElementById('spanlabelDescription').innerText=	obj.ImageDescription;
		document.getElementById(sz_dvzoom).style.visibility='visible';
		cntrZoom=document.getElementById(sz_zoom);
		document.getElementById(sz_zoom).onclick=function (sz_imageSRC) { clickZoomLarge(obj.srcIMGLarge); } 
		
		
	}

function clickZoomLarge(sz_imageSRC)
{
	
	//alert(sz_imageSRC)

}	

function listen(file)
{
	//alert(file)
}

function download(file)
{
	//alert(file)
}
function changepage(value)
{
 //if document.all.currentposition.value=
 //alert(value)
}
