// variabili globali var baseURL = "http://www.demeuredecharme.com/" var imageURL = "http://www.demeuredecharme.com/upload//images/" var imageAlt = "Doppio click per chiudere la finestra." //funzione per risolvere i problemi del target blank. function OpenNewWindow(a, w, h){ if (w==0 || h==0){ a.target = '_blank'; } else{ try{ if(event.shiftKey || event.shiftLeft){ a.target = '_blank'; } else{ a.target = 'prova'; return OpenSizedWindow(a.href, 'prova', w, h); } } catch(except){ a.target = '_blank'; } } } function OpenWindow(url, width, height){ OpenSizedWindow(url, '_blank', width, height) } function OpenSizedWindow(url, target, width, height){ var properties if (width=='') properties = '' else properties = 'width=' + width + ', height=' + height + ', resizable=yes, scrollbars=yes, status=yes, menubar=no, toolbars=no' var w = window.open(url, target, properties); if (!w.opener) w.opener = this; return void(0); } function OpenAutoPositionedSizedWindow(url, target, width, height){ var properties var x, y; var top, left; try{ //calcola coordinata Y y = (event.screenY - event.offsetY) + 20; if ((y + height)>(screen.height-100)) y = (screen.height - height - 100); //calcola coordinata X x = (event.screenX - (width/2)); if (x < 20) x = 20; else if ((x + width)>(screen.width-20)) x = (screen.width - width - 20); top = 'top=' + y + ', '; left = 'left=' + x + ', '; } catch(except){ top=''; left=''; } if (width=='') properties = '' else properties = 'width=' + width + ', height=' + height + ', ' properties += top + left + 'resizable=yes, scrollbars=yes, status=yes, menubar=no, toolbars=no' var w = window.open(url, target, properties); if (!w.opener) w.opener = this; return void(0); } function OpenPositionedScrollWindow(url, target, left, top, width, height, scrollbars){ var properties if ((height + top)>(screen.height-60)){ height = screen.height - top - 60; width += 20; } if (width=='') properties = ''; else properties = 'left=' + left + ', top=' + top + ', width=' + width + ', height=' + height + ', resizable=yes, status=yes, menubar=no, toolbars=no'; if (scrollbars) properties += ", scrollbars=yes"; else properties += ", scrollbars=no"; var pW = window.open(url, target, properties); return pW; } function OpenAutoPositionedScrollWindow(url, target, width, height, scrollbars){ var top, left, except; try { //calcola coordinata Y top = (event.screenY - event.offsetY) + 20; if ((top + height)>(screen.height-100)) top = (screen.height - height - 100); //calcola coordinata X left = (event.screenX - (width/2)); if (left <20) left = 20; else if ((left + width)>(screen.width-20)) left = (screen.width - width - 20); } catch(except){ top = screenX + (outerWidth - innerWidth); left = screenY + (outerHeight - innerHeight); } var pW = OpenPositionedScrollWindow(url, target, left, top, width, height, scrollbars) return pW; } function opensmartimage(image){ OpenSmartImage(image); } var ImageWindowCount = 0; var ImageWindow; function OpenSmartImage(image){ if (ImageWindowCount){ ImageWindow.close(); ImageWindow = null; ImageWindowCount = 0; } ImageWindow = window.open('', 'ImageWindow', 'width=300,height=250,resizable=yes,scrollbars=no'); ImageWindowCount++; ImageWindow.document.open(); ImageWindow.document.write('\n'); ImageWindow.document.write('\t\n'); ImageWindow.document.write('\t\n'); ImageWindow.document.write('\t\t\n'); ImageWindow.document.write('\t\n'); ImageWindow.document.write('\t\n'); ImageWindow.document.write('\t\t
\n'); if (image.indexOf("http") == -1) image = imageURL + image ImageWindow.document.write('\t\t\t'+ imageAlt +'\n'); ImageWindow.document.write('\t\t
\n'); ImageWindow.document.write('\t\n'); ImageWindow.document.write('\n'); ImageWindow.document.close(); if (!ImageWindow.opener) ImageWindow.opener = this; return void(0); } function OpenSmartImageResizer(w, h){ ImageWindow.resizeTo(w + 12, h + 61); } function OpenPage(page, width, height){ OpenAutoPositionedSizedWindow(baseURL + "dynalay.asp?PAGINA=" + page.toString(), "_blank", width, height) } function openimage(image, width, height){ OpenImage(image, width, height); } function OpenImage(image, width, height){ if (width=='') properties = '' else properties = 'width=' + width + ', height=' + height + ', resizable=yes, scrollbars=yes, status=yes, menubar=no, toolbars=no' var w = window.open(imageURL + image, '_blank', properties); if (!w.opener) w.opener = this; return void(0); }