var lastWidth=0;var lastHeight=0;function URLEncode(e){var g="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*'()";var b="0123456789ABCDEF";var f="";for(var c=0;c<e.length;c++){var d=e.charAt(c);if(d==" "){f+="+"}else{if(g.indexOf(d)!=-1){f+=d}else{var a=d.charCodeAt(0);if(a>255){alert("Unicode Character '"+d+"' cannot be encoded using standard URL encoding.\n(URL encoding only supports 8-bit characters.)\nA space (+) will be substituted.");f+="+"}else{f+="%";f+=b.charAt((a>>4)&15);f+=b.charAt(a&15)}}}}return f}function URLDecode(e){var a="0123456789ABCDEFabcdef";var d="";var b=0;while(b<e.length){var c=e.charAt(b);if(c=="+"){d+=" ";b++}else{if(c=="%"){if(b<(e.length-2)&&a.indexOf(e.charAt(b+1))!=-1&&a.indexOf(e.charAt(b+2))!=-1){d+=unescape(e.substr(b,3));b+=3}else{alert("Bad escape combination near ..."+e.substr(b));d+="%[ERROR]";b++}}else{d+=c;b++}}}return d}function _dialog_footer(a){if(typeof(a)=="undefined"){a="black"}win="</div>";win+="</td>";win+='<td class="dialog_'+a+'_e"></td>';win+="</tr>";win+="<tr>";win+='<td class="dialog_'+a+'_sw"></td>';win+='<td class="dialog_'+a+'_s"></td>';win+='<td class="dialog_'+a+'_se"></td>';win+="</tr>";win+="</table>";win+="</div>";return win}function _dialog_header(d){var b="";if(d.title=="Alerta"){b="Alert"}if(typeof(d.color)=="undefined"){d.color="black"}else{if(d.color==""){d.color="black"}}if(typeof(d.dv)=="undefined"){d.dv="divJSDialogContent"}else{if(d.dv==""){d.dv="divJSDialogContent"}}if(typeof(d.showclose)=="undefined"){d.showclose=true}mtw=d.jsWidth-60;tl=mtw/6;d.title=URLDecode(d.title);if(d.title.length>tl){d.title=d.title.substr(0,tl-1)+"..."}var c="jsWindowArea"+b;var a="jsWindowHandle"+b;win='<div style="position: absolute; left: '+d.jsLeft+"px; top: "+d.jsTop+'px" id="jsWindow'+b+'">';win+='<table class="text textBlanc" style="width: '+d.jsWidth+"px; height: "+d.jsHeight+'px;" cellpadding="0" cellspacing="0" id="'+c+'">';win+='<tr style="cursor:pointer;" id="'+a+'">';win+='<td class="dialog_'+d.color+'_nw"></td>';win+='<td class="dialog_'+d.color+'_n3">';win+='<div style="float:left;" class="dialog_'+d.color+'_n1"><p style="margin-top:20px;">&nbsp;'+d.title+"</p></div>";win+='<div style="float:left;" class="dialog_'+d.color+'_n2">&nbsp;</div>';if(d.showclose){win+='<div class="dialog_'+d.color+'_close_down" id="btnCloseDialog" onclick="closeDialog'+b+'();" onMouseOver="rollover(this);" onMouseOut="rollout(this);"></div></td>'}win+='<td class="dialog_'+d.color+'_ne"></td>';win+="</tr>";win+="<tr>";win+='<td class="dialog_'+d.color+'_w"></td>';win+='<td style="vertical-align:top; text-align:center;background:#fff;">';win+='<div id="'+d.dv+'" style="background:#fff;color:#000;width:'+(d.jsWidth-36)+"px;height:"+(d.jsHeight-20)+'px;">';return win}function closeDialog(){fadeOutScreen();el=window.top.document.getElementById("jsWindow");js=window.top.document.getElementById("jsDialog");if(el){el.parentNode.removeChild(el)}if(js){js.parentNode.removeChild(js)}}function closeDialogAlert(){fadeOutScreen({alerta:"Alerta"});el=window.top.document.getElementById("jsWindowAlert");js=window.top.document.getElementById("jsDialogAlert");if(el){el.parentNode.removeChild(el)}if(js){js.parentNode.removeChild(js)}}function ecms_confirm(a,b){if(confirm(a)){window.location.href=b}}function dialogAjaxLoadURL(a){var c={success:function(k){el=window.top.document.getElementById("divJSDialogContent");var d='<script id="initDlgScript" type="text/javascript">';var j="<\/script>";var i="";var g="";startScript=k.responseText.search(/<script [^>]*>/i);endScript=k.responseText.search(/<\/script>/i);if(startScript>-1){g=k.responseText.substring(0,startScript-1);i=k.responseText.substring(startScript,endScript-1);i=i.substring(i.search(/>/i)+1);var f=window.top.document.getElementsByTagName("head")[0];var e=window.top.document.getElementById("jsDialog");if(e){e.parentNode.removeChild(e)}e=window.top.document.createElement("script");e.type="text/javascript";e.id="jsDialog";e.text=i;f.appendChild(e);el.innerHTML=g}else{el.innerHTML=k.responseText}if(k.responseText.indexOf("tabber")>-1){var h=({});el=window.top.document.getElementById("dialog_tabber_object");tabber=new tabberObj(h);tabber.init(el)}if(k.responseText.indexOf("InputTextMandatory")>-1){checkMandatoryStartup()}if(k.responseText.indexOf("jsInitDialog()")>-1){jsInitDialog()}},upload:function(d){this.success(d)}};var b=YAHOO.util.Connect.asyncRequest("GET",a,c)}function getPageSizeWithScroll(){if(window.top.innerHeight&&window.top.scrollMaxY){yWithScroll=window.top.innerHeight+window.top.scrollMaxY;xWithScroll=window.top.innerWidth+window.top.scrollMaxX}else{if(window.top.document.body.scrollHeight>window.top.document.body.offsetHeight){yWithScroll=window.top.document.body.scrollHeight;xWithScroll=window.top.document.body.scrollWidth}else{yWithScroll=window.top.document.body.offsetHeight;xWithScroll=window.top.document.body.offsetWidth}}arrayPageSizeWithScroll=new Array(xWithScroll,yWithScroll);return arrayPageSizeWithScroll}function fadeInScreen(b){alerta="";if(b!=null&&b.alerta=="Alerta"){alerta="Alerta"}ps=getPageSizeWithScroll();div='<div class="fade_screen" style="width:'+ps[0]+"px;height:"+ps[1]+'px" id="_fade_div'+alerta+'">&nbsp;</div>';var a=window.top.document.createElement("div");a.innerHTML=div;window.top.document.getElementsByTagName("body")[0].appendChild(a);a.style.top="0px";a.style.left="0px"}function fadeOutScreen(a){alerta="";if(a!=null&&a.alerta=="Alerta"){alerta="Alerta"}el=window.top.document.getElementById("_fade_div"+alerta);if(el){el.parentNode.removeChild(el)}}function openAjaxDialog(c){var a=460;var b=370;if((typeof(c.width)!="undefined")&&(c.width!="")){a=parseInt(c.width)}if((typeof(c.height)!="undefined")&&(c.height!="")){b=parseInt(c.height)}openDialog(c.title,'<div style="left:'+(a-20)+"px;top:"+(((b-50)/2)-15)+'px;"><img src="/templates/noe/img/loading.gif" width="41" height="39" /></div>',a,b,c.color,"",c.showclose);dialogAjaxLoadURL(c.url)}function openAlert(a){dw=350;dh=150;cntnt='<table style="width:100%;height:100%"><tr><td style="text-align:center"><img src="/templates/noe/img/ico/ico_alerta.gif"></td></tr><tr><td style="text-align:center">'+a+'</td></tr><tr><td style="text-align:center"><button id="buttonOk" type="submit" style="background-color:transparent;margin:0;border:0;cursor:pointer;width:auto;" onclick="closeDialogAlert();return false;" onmouseover="rolloverBoto(this.id);" onmouseout="rolloutBoto(this.id);"><table cellpadding="0" cellspacing="0"><tr><td id="buttonOk_e" class="button_e_down"></td><td id="buttonOk_c" class="button_c_down">'+strOk+'</td><td id="buttonOk_d" class="button_d_down"></td></tr></table></button></td></tr></table>';openDialog("Alerta",cntnt,dw,dh,"blue")}function openDialog(i,f,h,e,d,b,j){var c=navigator.userAgent.toLowerCase();var g=c.indexOf("msie ");if(g>0){var a=parseInt(c.substring(g+5,c.indexOf(".",g)))}else{var a=0}if(g>0){winW=window.top.document.body.offsetWidth;winH=window.top.document.documentElement.clientHeight;if(winH==0){winH=document.body.offsetHeight}}else{winW=window.top.innerWidth;winH=window.top.innerHeight}jsLeft=(winW-parseInt(h))/2;if((a==0)||(a>=7)){jsTop=((winH-parseInt(e))/2)+window.top.document.documentElement.scrollTop}else{jsTop=((winH-parseInt(e))/2)+window.top.document.documentElement.scrollTop}if(d==null){d="black"}if(typeof(j)=="undefined"){j=true}win=_dialog_header({title:i,jsTop:jsTop,jsLeft:jsLeft,jsWidth:h,jsHeight:e,color:d,dv:b,showClose:j});win+=unescape(f);win+=_dialog_footer(d);if(i=="Alerta"){fadeInScreen({alerta:"Alerta"})}else{fadeInScreen()}dialogWindow=window.top.document.createElement("div");dialogWindow.innerHTML=win;dialogWindow.style.top=jsTop+"px";dialogWindow.style.left=jsLeft+"px";window.top.document.body.appendChild(dialogWindow);if(i=="Alerta"){dd=new YAHOO.util.DD("jsWindowAlerta");dd.useShim=true;dd.setHandleElId("jsWindowHandleAlerta")}else{dd=new YAHOO.util.DD("jsWindow");dd.useShim=true;dd.setHandleElId("jsWindowHandle")}}function openExtVideoDialog(d,c,a,e,b){incStats(b);if((c==0)||(c=="")){c=800}if((a==0)||(a=="")){a=600}openDialog(d,URLDecode(e),parseInt(c)+36,parseInt(a),"black","divJSDialogResources")}function openFLVDialog(d,c,b,a){incStats(d.codrecurs,d.mirror);if(typeof(d.mirror)=="undefined"){d.mirror=""}content='<object type="application/x-shockwave-flash" data="'+d.mirror+'/flash/flowplayer/FlowPlayer.swf" width="425" height="350" id="FlowPlayer">';content+='	<param name="allowScriptAccess" value="always" />';content+='	<param name="movie" value="'+d.mirror+'/flash/flowplayer/FlowPlayer.swf" />';content+='	<param name="quality" value="high" />';content+='	<param name="scaleMode" value="showAll" />';content+='	<param name="allowfullscreen" value="false" />';content+='	<param name="wmode" value="transparent" />';content+='	<param name="allowNetworking" value="all" />';content+='	<param name="flashvars" value="config={ ';content+="		autoPlay: false, ";content+="		loop: false, ";content+="		initialScale: 'scale',";content+="		showLoopButton: false,";content+="		showPlayListButtons: false,";content+="     showMenu: false,";content+="     fullScreenScriptURL: '',";content+="		playList: [";content+="			{ url: '"+d.mirror+"/"+d.file+"', type: 'flv' }";content+="		]";content+='		}" />';content+="</object>";openDialog(d.title,content,460,370,"black","divJSDialogResources")}function openIMGDialog(a){incStats(a.codrecurs,a.mirror);margin_top=72;margin_left=36;width=800;height=600;if(navigator.appName.indexOf("Microsoft")!=-1){maxH=document.body.offsetHeight-20}else{maxH=window.innerHeight-16}if(height>maxH){ratio=maxH/height;height=maxH;width=Math.round(width*ratio)}content='<div height="'+height+'"><img src="'+a.mirror+"/"+a.imatge+'" alt="'+a.title+'" style="max-width:'+width+"px;width:expression(this.width>"+width+" ? '"+width+"px' : true);max-height:"+height+"px;height:expression(this.height>"+height+"?'"+height+"px':true);\" /></div>";openDialog(a.title,content,parseInt(width)+margin_left,parseInt(height)+margin_top,"black","divJSDialogResources")}function openResource(params){$.get("index.php",{di:1,p:"resources",op:"openResource",idRecurs:params.id},function(data){eval(data)})}function openMP3Dialog(a){incStats(a.codrecurs,a.mirror);if(typeof(a.mirror)=="undefined"){a.mirror=""}content='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="240" height="70">';content='<param name="movie" value="'+a.mirror+'/flash/reproductor.swf">';content='<param name="quality" value="high">';content='<embed src="'+a.mirror+"/flash/reproductor.swf?titol="+URLEncode(a.title)+"&reduccio=0&ruta="+a.mirror+a.file+'&descarrega=false&sgae=false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="240" height="70"></embed></object>';openDialog(a.title,content,276,70,"black","divJSDialogResources")}function openSWFDialog(h,d,f,a,g,b,e,c){incStats(b);lastSlash=d.lastIndexOf("/");g=d.substring(0,lastSlash);margin_top=72;margin_left=36;if((f==0)||(f=="")){f=800}if((a==0)||(a=="")){a=600}if(navigator.appName.indexOf("Microsoft")!=-1){maxH=document.body.offsetHeight-20-(margin_top*2)}else{maxH=window.innerHeight-16-(margin_top*2)}if(a>maxH){ratio=maxH/a;a=maxH;f=Math.round(f*ratio)}content="<div>";content+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"  width="'+f+'" height="'+a+'" allowFullScreen="true">';content+='<param name="movie" value="'+d+'" />';content+='<param name="quality" value="high" />';content+='<param name="base" value="'+g+'" />';content+='<param name="allowFullScreen" value="true" />';if(e!=""&&c!=""){content+='<param name="'+e+'" value="'+c+'"/>'}content+='<embed src="'+d+'" quality="high" base="'+g+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+f+'" height="'+a+'" allowFullScreen="true"></embed>';content+="</object>";content+="</div>";content+='<div style="text-align:center;margin-top:10px;"><a href="javascript:void(0);" onclick="window.open(\''+d+"');\">"+strNovaFinestra+"</a></div>";openDialog(h,"",parseInt(f)+margin_left,parseInt(a)+margin_top,"black","divJSDialogResources");YAHOO.util.Dom.get("divJSDialogResources").innerHTML=content}function openLink(b,a){incStats(a);window.open(b,"_blank")}function resizeDialog(b,a){el=document.getElementById("jsWindowArea");if(el){window.lastWidth=el.style.width;window.lastHeight=el.style.height;el.style.width=b+"px";el.style.height=a+"px"}}function restoreDialogSize(){resizeDialog(parseInt(window.lastWidth),parseInt(window.lastHeight))};