$(document).ready(function(){$("#giovaniLB").click(function(event){if(event.target.id=='giovaniLB')closeLightBox();});$("#giovaniLB_op").click(function(event){if(event.target.id=='giovaniLB_op')closeLightBox();});$("#clickme1 a").bind("click",function(event){event.preventDefault();var whichDom=$(this).attr("href");whichDom=whichDom.substring(4);setLightBox(whichDom);openLightBox();});$("#clickme2 a").bind("click",function(event){event.preventDefault();var whichDom=$(this).attr("href");whichDom=whichDom.substring(4);setLightBox(whichDom);openLightBox();});$("div#giovaniLBBody dt a").bind("click",function(event){event.preventDefault();var whichDom=$(this).attr("name");whichDom=whichDom.substring(3);setLightBox(whichDom);});$("#giovaniLBClose, #giovaniLBClose2").click(function(event){closeLightBox();});});function setLightBox(whichDom){var whichDomToShow=$("#dom"+whichDom);var whichRisToShow=$("#ris"+whichDom);$("#giovaniLBBody dt.on").removeClass("on").addClass("off");$("#giovaniLBBody dd.on").removeClass("on").addClass("off");whichDomToShow.removeClass("off").addClass("on");whichRisToShow.removeClass("off").addClass("on");}
function closeLightBox(){$("#giovaniLB, #giovaniLB_op").hide();setLightBox("01");}
function openLightBox(){getPageSize();getPageScroll();var lightboxTop=arrayPageScroll[1]+((arrayPageSize[3]-477)/2);if(lightboxTop<arrayPageScroll[1]){lightboxTop=arrayPageScroll[1];}
$("#giovaniLBBody").css({top:lightboxTop+'px'});$("#giovaniLB_op").hide().css({width:'100%',height:arrayPageSize[1]+'px'}).fadeTo("slow",0.75).show();$("#giovaniLB").hide().css({width:'100%',height:arrayPageSize[1]+'px'}).show();}
var arrayPageScroll="";function getPageScroll(){var xScroll,yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;xScroll=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;xScroll=document.documentElement.scrollLeft;}else if(document.body){yScroll=document.body.scrollTop;xScroll=document.body.scrollLeft;}
arrayPageScroll=new Array(xScroll,yScroll);return arrayPageScroll;};var arrayPageSize="";function getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=window.innerWidth+window.scrollMaxX;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;}else{windowWidth=self.innerWidth;}
windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=xScroll;}else{pageWidth=windowWidth;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight);return arrayPageSize;};
