var Backoffice={Load:function(Title,Url,Width,Height){ZennWindow(Url,Width,Height);},Close:function(){ZennWindowClose();},CloseAndRefresh:function(){ZennWindowCloseAndRefresh();},CloseAndRedirect:function(Url){ZennWindowCloseAndRedirect(Url);}}
function ZennWindow(URL,Width,Height){var fwImagesPath='/css/images/backoffice/';var modalWidth=Number(Width)+20;var modalHeight=Number(Height);var modalPositionTop=(Number(jQuery(window).height())-Number(modalHeight))/2;if(modalPositionTop<0)modalPositionTop=0;var modalPositionLeft=(Number(jQuery(window).width())-Number(modalWidth))/2;if(modalPositionLeft<0)modalPositionLeft=0;jQuery('body').append('<div id="fwOverlay" style="position: absolute; top:0px; left:0px; z-index: 5; width: 100%; height:100%; filter: Alpha(Opacity=60); -moz-opacity:0.6; opacity: 0.6; background-color:#85BBEF;"></div>');if(modalHeight>jQuery('#fwOverlay').height())
jQuery('#fwOverlay').height(modalHeight+45);var ie=jQuery.browser.msie;var version=jQuery.browser.version;var border='';if(ie&&Number(version)<8){border='border:1px solid transparent;';}
var html='<div id="fwModal" style="display:none; position:absolute; top:'+modalPositionTop+'px; left:'+modalPositionLeft+'px; z-index:1000; width:'+modalWidth+'px;">';html+='<div style="position:relative; display:block; height:25px;">';html+='<div style="position:absolute; left:0px; top:0px;"><img src="'+fwImagesPath+'fw-left-top.gif" /></div>';html+='<div style="margin:0px 10px 0px 10px; '+border+' background:url('+fwImagesPath+'fw-right-middle.gif); text-align:right;"><span id="fwBtnClose" style="cursor:pointer;"><img src="'+fwImagesPath+'fw-btn-close.gif" alt=""></span></div>';html+='<div style="position:absolute; right:0px; top:0px;"><img src="'+fwImagesPath+'fw-right-top.gif" /></div>';html+='</div>';html+='<div style="position:relative; display:block; margin-top:-2px;">';html+='<div style="position:absolute; left:0px; top:0px; width:7px; height:'+modalHeight+'px; background-image:url('+fwImagesPath+'fw-frame-left.gif);"></div>';html+='<div style="margin:-2px 7px 0px 7px; height:'+modalHeight+'px; background-color:#FFFFFF;">';html+='<iframe width="'+Width+'" height="'+Height+'"  frameborder="0" marginwidth="0" marginheight="0" scrolling="NO" src="'+URL+'"></iframe>';html+='</div>';html+='<div style="position:absolute; right:0px; top:0px; width:7px; height:'+modalHeight+'px; background-image:url('+fwImagesPath+'fw-frame-right.gif);"></div>';html+='</div>';html+='<div style="position:relative; display:block; height:7px;">';html+='<div style="position:absolute; left:0px; top:0px;"><img src="'+fwImagesPath+'fw-bottom-left-c.gif" style="vertical-align:top;" /></div>';html+='<div style="margin:0px 7px 0px 7px; background-image:url('+fwImagesPath+'fw-bottom-middle.gif); height:7px;"> </div>';html+='<div style="position:absolute; right:0px; top:0px;"><img src="'+fwImagesPath+'fw-bottom-right-c.gif" style="vertical-align:top;" /></div>';html+='</div>';html+='</div>';jQuery('body').append(html);jQuery('#fwBtnClose').click(ZennWindowCloseAndRefresh);scroll(0,0);document.documentElement.style.overflow="hidden";jQuery('#fwModal').toggle('slow');}
function ZennWindowClose(){jQuery('#fwOverlay').remove();jQuery('#fwModal').toggle('slow',function(){jQuery('#fwModal').remove();document.documentElement.style.overflow="auto";});}
function ZennWindowCloseAndRedirect(URL){ZennWindowClose();window.location=URL;}
function ZennWindowCloseAndRefresh(){window.location.reload(true);}
