// JavaScript Document




function openMenu() 
{
  /*
  if($("div#menu").css("display")=="block")
  {
  $("div#menu").css("display", "none");
  }
  else
  {
  $("div#menu").css("display", "block");
  }
  */

  // dissolvenza
  if ($("div#menu").is(":hidden")) {
    $("div#menu").slideDown(3000);
  }
  else {
    // $("div#menu").hide(3000);
    $("div#menu").slideToggle(3000);
  }
}


function openWin(theURL, winName, features) 
{
  try 
  {
    window.open(theURL, winName, features);
  }
  catch (e) 
  {
    alert("Error" + e.message);
  }
}


function closeFullscreen(theURL) 
{
  self.close();
}


function openFullscreen(theURL) 
{
  try 
  {
    var dimX = ((screen.width != null) ? screen.width : screen.availWidth) - 5; //larghezza pagina
    var dimY = ((screen.height != null) ? screen.height : screen.availHeight) - 30; //lunghezza pagina

    if (navigator.appName == "Microsoft Internet Explorer") 
    { // better be ie6 at least
      window.open(theURL, 'Banci', 'fullscreen=yes, scrollbars=no, resizable=no, channelmode=no, menubar=no, toolbar=no, location=no, status=no').focus();
    }
    else 
    { // i.e. if Firefox
      window.open(theURL, 'Banci', 'width=' + dimX + ',height=' + dimY + ', scrollbars=auto, resizable=yes, ').focus();
    }

    /*
    window.open(theURL,'Banci','width='+dimX+',height='+dimY+',left=0,top=0,resizable=no,fullscreen=yes,channelmode=no,menubar=no,toolbar=no,location=no,scrollbars=no,status=no');
    */
  }
  catch (e) 
  {
    alert("Error" + e.message);
  }
}


function setFullscreen() 
{
  try 
  {
    //	alert("ciao"+screen.width+screen.availWidth);

    var dimX = (screen.width != null) ? screen.width : screen.availWidth; //larghezza pagina
    var dimY = (screen.height != null) ? screen.height : screen.availHeight; //lunghezza pagina
    window.moveTo(0, 0);
    window.resizeTo(dimX, dimY);
  } 
  catch (e) 
  {
    alert("Error" + e.message);
  }
}


	
	
	
	this.tooltip = function()
	{	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tt").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<div id='tooltip'><p>"+ this.t +"</p></div>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tt").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

		
	$(document).ready(function () 
	{
	  try
	  {
	tooltip();
	

}catch(e){
		alert("Error"+e.message);
	} 

});

	/*---------------------------------------------------------------------------*/
  // RedirectComboItemSelect
  /*---------------------------------------------------------------------------*/
  function RedirectComboItemSelect(MyPathPage,ValueSelect)
  {
    location.href = MyPathPage + ValueSelect;
  }
  /*---------------------------------------------------------------------------*/
  
  
  /*---------------------------------------------------------------------------*/
  // ShowHideShop2Div
  /*---------------------------------------------------------------------------*/
  function ShowHideShop2Div(IDCorr,Div1,Div2) 
  {
   
 //  alert(IDCorr + "<--->" + Div1 + "<--->" + Div2);
    if(IDCorr == Div1)
    {
        // Apro il menu con effetto
    //    OpenMenu(Div1);

      document.getElementById(Div1).style.display = "block";
      document.getElementById(Div2).style.display = "none";


  //      document.getElementById(Div1).style.display = document.getElementById(Div2).style.display == "block" ? "none" : "block";
        
        // Seleziono il link corrente
        document.getElementById("Link_" + Div1).className = "ShopLinkNeroSel";
        
        // Deseleziono L'altro link
        document.getElementById("Link_" + Div2).className = "ShopLinkNero";
        
        // Nascondo l'altro div
  //      document.getElementById(Div2).style.display = "none";
        
    } 
    if(IDCorr == Div2)
    {
      document.getElementById(Div1).style.display = "none";
      document.getElementById(Div2).style.display = "block";

//      document.getElementById(Div2).style.display = document.getElementById(Div2).style.display == "block" ? "none" : "block";
      
      // Apro il menu con effetto
  //    OpenMenu(Div2);
      
      // Seleziono il link corrente
      document.getElementById("Link_" + Div2).className = "ShopLinkNeroSel";
        
      // Deseleziono L'altro link
      document.getElementById("Link_" + Div1).className = "ShopLinkNero";

    }      
  }
  /*---------------------------------------------------------------------------*/
  
  
  /*---------------------------------------------------------------------------*/
  // OpenMenu
  /*---------------------------------------------------------------------------*/
  function OpenMenu(MyIDDiv) 
  {
    // dissolvenza
    if ($("div#" + MyIDDiv).is(":hidden")) 
    {
      $("div#" + MyIDDiv).slideDown(1000);
    }
    else {
      // $("div#" + MyIDDiv).hide(3000);
      $("div#" + MyIDDiv).slideToggle(1000);
    }
  }
  /*---------------------------------------------------------------------------*/
  
  
  /*---------------------------------------------------------------------------*/
  /* ShowHide                                                                  */
  /*---------------------------------------------------------------------------*/
  function ShowHide(i) 
  {
    if ((document.getElementById) && (document.getElementById(i))) {
      var obj = document.getElementById(i);
      obj.style.display = obj.style.display == 'none' ? 'block' : 'none';
    }
    
    
  }
  /*---------------------------------------------------------------------------*/
