﻿function SetLanguage(Sel) {
var theForm = document.forms['aspnetForm'];
document.forms['aspnetForm'].Language.value = Sel;
theForm.submit();
}
function xSizeDiv(IdElemento, h, w) {
    xSize = new fx.Resize(IdElemento, {duration: 800});
    xSize.modify(h, w);
}
function JSgetElementById(id_elemento) 
{
	var oggetto;
	if(document.getElementById)
		oggetto = document.getElementById(id_elemento);
	else
		oggetto = document.all[id_elemento];
	return oggetto;
}
function HideAutoCompleteList()
{
    var ACL = JSgetElementById("AutoCompleteList")
    ACL.style.display = "none";
    ACL.innerHTML = "";
}
function GetAclVal(IDaclIVal)
{
        setTimeout('HideAutoCompleteList()',3000);
}
function SaveAclVal(divIDaclIVal)
{
    var elDiv = JSgetElementById(divIDaclIVal);
    document.forms['aspnetForm'].SaveAclValtxt.value=elDiv.innerHTML;
}
function SetValAcl()
{
        var el = JSgetElementById("SaveAclValtxt");
        document.forms['aspnetForm'].ctl00$SearchBox1$searchTXTbox.value=el.value;
        document.forms['aspnetForm'].ctl00$SearchBox1$CercaXNome.focus();
        document.forms['aspnetForm'].SaveAclValtxt.value="";
        HideAutoCompleteList();
}
//
function mPage(TotRows)
{
    if (intPage > 1)
    {
        intPage = intPage - 1;
    }    
}
function pPage(TotRows)
{
    intPage = intPage + 1;
}
function ResetIntPage()
{
    intPage = 1;
}
function SetActInput(Act)
{
    var IAct = document.forms['aspnetForm'].ctl00$SearchBox1$ActInput;
    IAct.value = Act;
}
function fCheckDetailsPage(navBarScheda) 
{
     var existInputCheckDetailsPage = JSgetElementById('CheckDetailsPage');
     if (existInputCheckDetailsPage) 
     {
         //visibility RightBlock in controllo server detail 
         //var masterRightBlock = JSgetElementById('RightBlock');
         //masterRightBlock.style.visibility='hidden'; 
         var divNavBlock = JSgetElementById('navBlockSchede');
         divNavBlock.innerHTML = navBarScheda;
     }
}
function SelectorComune(strComune)
{
    var i;
    var txtCom;
    var searchStrVal;
    var objSelectCom = JSgetElementById("ctl00$SearchBox1$Select2");  
	
	//if (objSelectCom  != null) 
	//	{
		    for (i = 1; i < objSelectCom.length; i++)
		    {
		        txtCom = objSelectCom.options[i].text;        
		        txtCom = txtCom.toLowerCase(); 
		        txtCom = txtCom.replace(" ","-"); 
		        txtCom = txtCom.replace(" ","-");       
		        txtCom = txtCom.replace(" ","-");   
		        txtCom = txtCom.replace("'","-");      
		        strComune = strComune.toLowerCase();        
		        searchStrVal = strComune.indexOf(txtCom);
		        if (searchStrVal != -1)
		            {
		                objSelectCom.selectedIndex = i;
		                break;
		            }
		    }
	//	}	
}
function verifTipSel()
{
    var objSelCat = JSgetElementById("ctl00_SearchBox1_Select1"); 
    if (objSelCat.value==0)
        {
            alert("Seleziona la tipologia di locale o evento");       
            objSelCat.focus(); 
            return false;
        }
    else
        {
            return true;
        }
}     
function dtPageGUnload()
{
  var boolIsDetailsPage = JSgetElementById("CheckDetailsPage");
  if (boolIsDetailsPage == null)
    {
        return false;
    }
  else
  {
    GUnload();
  }  
}
function dtPageload()
{
  var boolIsDetailsPage = JSgetElementById("CheckDetailsPage");
  if (boolIsDetailsPage == null)
    {
        return false;
    }
  else
  {
    load();
  }  
}
function OpenLink(link)
{
    document.location.href=link;
}