
var publicFolder='/img/public/';var myCache=new Array();var myCacheIndex=0;var myBoxInfoBusy=false;$(function(){if(setup)
{if(setup.byPassSlideIn)
$('#content').show();if(setup.flash)
{for(var id in setup.flash)
{info=setup.flash[id];$('#'+info.toBox).html(getFlashHTML(publicFolder+info.name,info.width,info.height));}}
if(setup.imagesWithFade)
{for(var id in setup.imagesWithFade)
{info=setup.imagesWithFade[id];myCache[myCacheIndex]=new Image();myCache[myCacheIndex].src=publicFolder+info.name;myCache[myCacheIndex].parentInfo=info;myCache[myCacheIndex++].onload=function()
{$('#'+this.parentInfo.toBox).hide().css('background-image','url('+publicFolder+this.parentInfo.name+')').fadeIn('slow');}}}
if(setup.imagesWithoutFade)
{for(var id in setup.imagesWithoutFade)
{info=setup.imagesWithoutFade[id];$('#'+info.toBox).css('background-image','url('+publicFolder+info.name+')');}}
if(setup.preload)
{for(var id in setup.preload)
{myCache[myCacheIndex]=new Image();myCache[myCacheIndex++].src=publicFolder+setup.preload[id];}}}
$("#moveUp").click(function(){$("#myText").scrollTo({top:"-=176"},800);});$("#moveDown").click(function(){$("#myText").scrollTo({top:"+=176"},800);});$('#popupLinkCollezione').click(function(){if($('#popupCategorie').length==1)
return $('#popupCategorie').fadeOut(100,showHidePopupCollezioni);showHidePopupCollezioni();});$('#popupLinkCategoria').click(function(){if($('#popupCollezioni').length==1)
return $('#popupCollezioni').fadeOut(100,showHidePopupCategorie);showHidePopupCategorie();});$('#btnShowDetails').click(showHideDetails);$('a').click(function()
{this.blur();if(setup&&setup.byPassSlideIn)
return true;var goTo=this.href;$('#content').fadeOut(300,function(){window.location.href=goTo});return false;});$('#myProdotti a').hover(function()
{if($(this).attr('rel')!=$('#boxDetails').attr('rel'))
$('#fotoPreview').hide().css('background-image','url('+publicFolder+'prodotti/'+$(this).attr('rel')+'_small.jpg)').fadeIn(300);},function(){$('#fotoPreview').fadeOut(300);});$('#content').fadeIn(300);});function showHidePopupCollezioni()
{if($('#popupCollezioni').css('display')=='block')
$('#popupCollezioni').fadeOut(500);else
$('#popupCollezioni').fadeIn(500);}
function showHidePopupCategorie()
{if($('#popupCategorie').css('display')=='block')
$('#popupCategorie').fadeOut(500);else
$('#popupCategorie').fadeIn(500);}
function showHideDetails()
{if(myBoxInfoBusy)
return false;myBoxInfoBusy=true;if($('#boxDetails li.fullText').length)
$('#boxDetails').css('height',65+180).slideToggle(300,function(){myBoxInfoBusy=false});else
$('#boxDetails').css('height',65+(18*$('#boxDetails li').length)).slideToggle(300,function(){myBoxInfoBusy=false});}
function getFlashHTML(fileName,width,height)
{var out="<OBJECT CLASSID='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' WIDTH='"+width+"' HEIGHT='"+height+"' ";out+="CODEBASE='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0'> ";out+="<PARAM NAME='MOVIE'  VALUE='"+fileName+"'> ";out+="<PARAM NAME='QUALITY' VALUE='high'> ";out+="<param name='menu' value='false' /> ";out+="<param name = 'wmode' value='transparent' />";out+="<EMBED SRC='"+fileName+"' ";out+="WIDTH='"+width+"' HEIGHT='"+height+"' QUALITY='high' menu='false' wmode='transparent' ";out+="PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'> ";out+="</EMBED>";out+="</OBJECT>";return out;}