var arrTemp=self.location.href.split("?"); var picUrl = (arrTemp.length>0)?arrTemp[1]:""; var NS = (navigator.appName=="Netscape")?true:false; function FitPic() { iWidth = (NS)?window.innerWidth:document.body.clientWidth; iHeight = (NS)?window.innerHeight:document.body.clientHeight; iWidth = document.images['imgRef'].width - iWidth + 20; iHeight = document.images['imgRef'].height - iHeight + 130; window.resizeBy(iWidth, iHeight); self.focus(); }; function calc_left (w) { var left = (screen.availWidth / 2) - (w / 2); return (left); } function calc_top (h) { var top = (screen.availHeight / 2) - (h / 2); return (top); } function open_page(url, w, h, scrollbar,location,toolbar,status,menubar,resizable,id,target) { if(!target){target = '';} if(!scrollbar){scrollbar = 'no'} if(!toolbar){toolbar = 'no'} if(!status){status = 'no'} if(!menubar){menubar = 'no'} if(!location){location = 'no'} if(!id){id = ''} var top = calc_top (h); var left = calc_left (w); //alert(target); if(target =='opener') { opener.window.location.href = url; } else if(w && h) { popup = window.open (url,id,'width='+w+',height='+h+',left=0,top=0,screenX=0,screenY=0,status='+status+', menubar='+menubar+', toolbar='+toolbar+',location='+location+', scrollbars='+scrollbar+',resizable='+resizable); popup.focus(); } else { document.location.href = url; //alert(url) } return false; } function findPosX(objName) { var posx = 0; obj= document.getElementById(objName); if (obj.offsetParent) { while (obj.offsetParent) { posx += obj.offsetLeft obj = obj.offsetParent; } } else if (obj.x) { posx += obj.x; } return posx; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; } function scrollInit() { if(document.getElementById('wn')) { var wndo = new dw_scrollObj('wn', 'lyr'); wndo.setUpScrollbar("dragBar", "track", "v", 0, 0); dw_scrollObj.GeckoTableBugFix('wn'); scrollStatus = 'init'; } if(document.getElementById('wnOr')) { var wndo = new dw_scrollObj('wnOr', 'lyr'); wndo.setUpScrollbar("dragBar", "track", "h", 0, 0); dw_scrollObj.GeckoTableBugFix('wnOr'); scrollStatus = 'init'; } } $(document).ready(function() { $('.blank').attr({target: "_blank"}) $('.png').ifixpng(); $('.popupDettaglio').click(function() { dettaglioProdotto(this); return false; }) $('.popUpNoteLegali').click(function() { window.open(this,'noteLegali','width=467,height=238;'); return false; }) $('.siteMap').click(function() { window.open(this,'siteMap','width=487,height=400,scrollbars=1;'); return false; }) $("#right").click(function(){ cssWidth = $(".prod").width(); cssLeft = ($(".prod").css("left").replace("px","")*1); if((cssWidth+(cssLeft-572))>0){ $(".prod").animate({"left": "-=143px"}, "fast","",checkRight); $('#scrollLeft').css('display','block'); } else { $(".prod").animate({"left": (572-cssWidth)+"px"}, "fast"); } cssWidth = $(".prod").width(); cssLeft = ($(".prod").css("left").replace("px","")*1); }); $("#left").click(function(){ cssLeft = ($(".prod").css("left").replace("px","")*1); if(cssLeft<0){ $(".prod").animate({"left": "+=143px"}, "fast","",checkLeft); $('#scrollRight').css('display','block');} else{ $(".prod").animate({"left": "0px"}, "fast","",checkLeft);} }); }) function checkLeft() { cssWidth = $(".prod").width(); cssLeft = ($(".prod").css("left").replace("px","")*1); if(cssLeft>=0){ $('#scrollLeft').css('display','none');} else{ $('#scrollLeft').css('display','block');} } function checkRight() { cssWidth = $(".prod").width(); cssLeft = ($(".prod").css("left").replace("px","")*1); //alert(cssLeft+" "+(572-cssWidth)); //if((cssWidth+(cssLeft-572))> (cssLeft-572)){ if(cssLeft<=(572-cssWidth)){ $('#scrollRight').css('display','none');} else{ $('#scrollRight').css('display','block');} } function dettaglioProdotto(vars) { $.ajax({ type: "GET", url: vars+'&type=virtual', success: function(msg){ $('#dettaglioProdotti').html(msg); $('#dettaglioProdotti').css('display','block'); } }); } function closeDettaglio() { $('#dettaglioProdotti').css('display','none'); } function openStoria() { $('#storia').css('display','block'); $('#boxMenu').css('display','none'); } function chiudiStoria() { $('#boxMenu').css('display','block'); $('#storia').css('display','none'); } function showHide(divId) { if ($(divId).is(":hidden")) { $(divId).slideDown("fast",function(){scrollInit()}); } else { $(divId).slideUp("fast",function(){scrollInit()}); } } function updateLineaDesc(param) { $.ajax({ type: "GET", url: "/site/prodotti_e_soluzioni/prodotti/testi.php", data: param, success: function(msg){ $('#description').html(msg); } }); } function openSite(site) { window.open(site) } function resetLineaDesc() { $('#description').html(''); }