var classe;var idHref;var req=null;var console=null;var READY_STATE_UNINITIALIZED=0;var READY_STATE_LOADING=1;var READY_STATE_LOADED=2;var READY_STATE_INTERACTIVE=3;var READY_STATE_COMPLETE=4;var HANDLE_AJAX_REQUEST;var busy_blind=false;var workingGallery=null;var htmlelementfilename=false;var htmlelementresponse=null;var portfolioMode=false;function sendAjaxRequest(arg1,arg2,handleAjaxRequest){try{if(arg2=="htmlelementfilename"){htmlelementfilename=arg1;}else if(arg2.indexOf("__DescriptionLabel")!=-1){htmlelementfilename=arg2;}if(handleAjaxRequest==null){handleAjaxRequest='ajax-setImgSize';}}catch(e){}HANDLE_AJAX_REQUEST=handleAjaxRequest;HttpMethod="POST";req=initXMLHTTPRequest();if(req){if(arg1=='filename'){workingGallery=arg2;}try{req.open(HttpMethod,'faces/'+handleAjaxRequest,true);}catch(e){var str=window.location.protocol+'//'+window.location.hostname;req.open(HttpMethod,str+'/faces/'+handleAjaxRequest,true);}req.onreadystatechange=onAjaxReadyState;req.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");req.send("arg1="+arg1+'&'+"arg2"+'='+arg2);}}function advancedOpt(myClass,myHref){classe=myClass;idHref=myHref;$$("div."+classe).each(function(e){blindUp(e)})}function blinda(e){var divAdvanced=document.getElementById(idHref+'Advanced');var divOpacity=document.getElementById(idHref+'Opacity');if(divOpacity==null){divOpacity=window.parent.document.getElementById(idHref+'Opacity');}if(divAdvanced!=null){var advancedHeight=parseInt(divAdvanced.style.height);var currHeight=parseInt(divOpacity.style.height);if(e.getAttribute("blindDown")=="false"){e.setAttribute("blindDown","true");divOpacity.style.height=(currHeight-advancedHeight)+'px';$(idHref+'AdvancedImage').innerHTML='<img src="img/xM.png" border="0"> advanced'}}if(document.getElementById("form1:imgLabel").value!=""){window.parent.document.getElementById("RTB_imgLabel").value=document.getElementById("form1:imgLabel").value;}else{splitpath=document.getElementById("form1:fileupload").value.split('\\');window.parent.document.getElementById("RTB_imgLabel").value=splitpath[splitpath.length-1];}if(window.parent.document.getElementById('adddiv')!=null){window.parent.document.getElementById('adddiv').complete=false;}}function chkNoLabel(obj){if(obj.checked){obj.mylabel=document.getElementById("RTB_imgLabel").value;document.getElementById("RTB_imgLabel").value="";document.getElementById("RTB_imgLabel").disabled=true;}else{document.getElementById("RTB_imgLabel").disabled=false;document.getElementById("RTB_imgLabel").value=obj.mylabel;}}function blindUp(e){if(busy_blind){return false;}var divAdvanced=document.getElementById(idHref+'Advanced');var divOpacity=document.getElementById(idHref+'Opacity');if(divOpacity==null){divOpacity=window.parent.document.getElementById(idHref+'Opacity');}var advancedHeight=parseInt(divAdvanced.style.height);var currHeight=parseInt(divOpacity.style.height);if(e.getAttribute("blindDown")=="false"){e.setAttribute("blindDown","true");if(isIe())e.visualEffect('slide_up',{beforeStart:function(effect){busy_blind=true;},afterFinish:function(effect){divOpacity.style.height=(currHeight-advancedHeight)+'px';busy_blind=false;},duration:1});else{divOpacity.style.height=(currHeight-advancedHeight)+'px';e.style.display='none';}$(idHref+'AdvancedImage').innerHTML='<img src="img/xM.png" border="0"> advanced'}else{e.setAttribute("blindDown","false");if(isIe())e.visualEffect('slide_down',{beforeStart:function(effect){busy_blind=true;divOpacity.style.height=(currHeight+advancedHeight)+'px';},afterFinish:function(effect){busy_blind=false;},duration:1});else{divOpacity.style.height=(currHeight+advancedHeight)+'px';e.style.display='block';}$(idHref+'AdvancedImage').innerHTML='<img src="img/xM.png" border="0px"> simple'}return false;}function isIe(){var ua=window.navigator.userAgent;var msie=ua.indexOf("MSIE ");if(msie>0)return true;else return false;}function setImgSize(img){document.getElementById("smallSize").src="img/size.gif";document.getElementById("smallSize").selected=false;document.getElementById("mediumSize").src="img/size.gif";document.getElementById("mediumSize").selected=false;document.getElementById("largeSize").src="img/size.gif";document.getElementById("largeSize").selected=false;document.getElementById(img.id).src="img/size_selected.gif";document.getElementById(img.id).selected=true;var filename=document.getElementById('form1:fileupload').value;var imgLabel=document.getElementById('form1:imgLabel').value;var arryfilename=filename.split('\\');filename=arryfilename[arryfilename.length-1];if(imgLabel==""){sendAjaxRequest(img.id,filename);}else{sendAjaxRequest(img.id,imgLabel);}}function uploadSubmit(){var selectedSize=null;if(document.getElementById("mediumSize").selected==true){selectedSize=document.getElementById("mediumSize").selected;}else if(document.getElementById("largeSize").selected==true){selectedSize=document.getElementById("largeSize").selected;}else{selectedSize=document.getElementById("smallSize").selected;}}function initXMLHTTPRequest(){var XHR=null,browserUtente=navigator.userAgent.toUpperCase();if(typeof(XMLHttpRequest)==="function"||typeof(XMLHttpRequest)==="object")XHR=new XMLHttpRequest();else if(window.ActiveXObject&&browserUtente.indexOf("MSIE 4")<0){if(browserUtente.indexOf("MSIE 5")<0)XHR=new ActiveXObject("Msxml2.XMLHTTP");else XHR=new ActiveXObject("Microsoft.XMLHTTP");}return XHR;};var dataXML=null;function onAjaxReadyState(){var ready=req.readyState;if(ready==READY_STATE_COMPLETE){if(req.status==200){dataXML=req.responseXML;}posthandleReq(req);}else{}}function posthandleReq(req){abilitaModificaLabel="on";if(HANDLE_AJAX_REQUEST=='ajax-setImgSize'){}else if(HANDLE_AJAX_REQUEST=='ajax-retriveImgSize'){window.parent.document.getElementById("RTB_imageWidth").value=req.responseXML.getElementsByTagName("ImgWidth").item(0).firstChild.nodeValue;window.parent.document.getElementById("RTB_imageHeight").value=req.responseXML.getElementsByTagName("ImgHeight").item(0).firstChild.nodeValue;}else if(HANDLE_AJAX_REQUEST=='ajax-linearResponsePortfolio'){if(req.responseXML.getElementsByTagName("portfolio.xml")[0]){createGallery(req.responseXML);alreadyCreated=true;}else{createGallery(req.responseXML);alreadyCreatedImgUploaded=true;}}else if(HANDLE_AJAX_REQUEST=='ajax-lastResponsePortfolio'){createGallery(req.responseXML,false);}else if(HANDLE_AJAX_REQUEST=='ajax-htmlFileRW'){if(htmlelementfilename.indexOf("__DescriptionLabel")==-1){htmlelementresponse=req.responseText;openWin('#'+htmlelementfilename,"portfolio");}else{setDescription(htmlelementfilename,req.responseText);}}else if(HANDLE_AJAX_REQUEST=='ajax-setWorkingFileLayout'){imgFileNameUL=req.responseXML.getElementsByTagName("filename").item(0).firstChild.nodeValue;window.frames[1].document.getElementById('myForm:layoutImgPreview').src='img/'+imgFileNameUL;}else if(HANDLE_AJAX_REQUEST=='indexPrivate.jsp'){try{if(req.responseXML==null)return;if(req.responseXML.getElementsByTagName("privateArea").item(0).firstChild.nodeValue){document.getElementById('portfolioDialog').style.display='none';RTB_hideTargetDialog(document.getElementById('portfolioDialog'),false);document.getElementById('editorDialog').style.display='none';closeWindow();try{window.navigate("faces/indexPriv.jsp");}catch(e){window.location="faces/indexPriv.jsp";}}else{return;}}catch(e){return;}}}var abilitaModificaLabel="on";function setDescription(htmlelementfilename,responseText){$(htmlelementfilename).innerHTML=responseText;if(htmlelementfilename.indexOf('portfolioImage290x180')!=-1){sendAjaxRequest("portfolioImage135x100LeftDescription","portfolioImage135x100Left__DescriptionLabel","ajax-htmlFileRW");}if(htmlelementfilename.indexOf('portfolioImage135x100Left')!=-1){sendAjaxRequest("portfolioImage135x100RightDescription","portfolioImage135x100Right__DescriptionLabel","ajax-htmlFileRW");}}function postUplaod(){window.parent.sendAjaxRequest("","","ajax-lastResponsePortfolio");}var lastImageUpdate;function postUploadLayout(){if(lastImageUpdate!=null){tmp=document.getElementById(lastImageUpdate).src;document.getElementById(lastImageUpdate).src=tmp.split('?')[0]+'?'+new Date().getTime();}}function cursorMouseOver(nodo,index){if(index==null){index=0;nodo.getElementsByTagName('img').item(index).src=nodo.getElementsByTagName('img').item(index).src.replace("bianco","verde");}if(operatingMode=="private"){nodo.style.cursor='pointer';nodo.style.cursor='hand';if(nodo!=null&&nodo.getElementsByTagName('div').item(index)!=null){nodo.getElementsByTagName('div').item(index).style.display='block';}}}function cursorMouseOut(nodo,index){if(index==null){index=0;if(selected!=nodo.getElementsByTagName('a').item(index).id)nodo.getElementsByTagName('img').item(index).src=nodo.getElementsByTagName('img').item(index).src.replace("verde","bianco");}if(operatingMode=="private"){nodo.style.cursor='default';if(nodo!=null&&nodo.getElementsByTagName('div').item(index)!=null){nodo.getElementsByTagName('div').item(index).style.display='none';}}}function clearSession(){operatingMode="public";alreadyCreated=false;alreadyCreatedImgUploaded=false;workingGallery=null;sendAjaxRequest("","","ajax-clearSession");}function logInArea(){if(operatingMode=='private')return;alreadyCreated=false;alreadyCreatedImgUploaded=false;sendAjaxRequest('','','indexPrivate.jsp');}function createGallery(XML_response,remove){if(workingGallery==null)return;gallery_name=workingGallery.split('.xml')[0];var dom=tinyMCE.activeEditor.windowManager.createInstance('tinymce.dom.DOMUtils',document);my_document=document;var i=0;var j=-1;var nodeValueString=null;var nodeValueLabel=null;zoomImageFileName=null;var nodeHide=null;var idDiv=null;var div=null;var divLabel=null;try{var root_item=XML_response.getElementsByTagName(workingGallery)[0];array_item=root_item.childNodes;}catch(e){return;}var gallery_name_Div=gallery_name+'Div';var galleryDiv=my_document.getElementById(gallery_name_Div);if(remove==null)remove=true;if(remove&&!linearAppend&&galleryDiv.hasChildNodes()){while(galleryDiv.childNodes.length>=1){if(galleryDiv.firstChild.id==gallery_name+'DivScript');galleryDiv.removeChild(galleryDiv.firstChild);}}else if(galleryDiv.hasChildNodes()){j=galleryDiv.childNodes.length-2;galleryDiv.removeChild(galleryDiv.lastChild);}for(i=0;i<array_item.length-1;i++){if(array_item[i].nodeType==1){nodeValueString=''+array_item[i].firstChild.nodeValue.split('&{des};')[0];nodeValueLabel=''+array_item[i].firstChild.nodeValue.split('&{des};')[1];heightImg=''+array_item[i].firstChild.nodeValue.split('&{des};')[3];widthImg=''+array_item[i].firstChild.nodeValue.split('&{des};')[2];try{nodeHide=''+array_item[i].firstChild.nodeValue.split('&{des};')[4];if(nodeHide!='undefined'){continue;}}catch(e){alert(e.Message);break;}j++;div=dom.create('div');divLabel=dom.create("div");dom.setStyles(divLabel,{position:'absolute',left:1,top:83,width:80,textAlign:'left',paddingLeft:'1px',overflow:'hidden'});dom.setAttribs(div,{id:'image_'+j,align:'center'});var heightDivPrincipale=112;var widthDivPrincipale=80;if(previewMode=="on"||operatingMode=="public"){dom.setStyles(div,{display:'block',overflow:'hidden',float:'left',border:'0px solid #78BD00',marginLeft:'6px',marginRight:'6px',marginTop:'0px',height:(heightDivPrincipale),width:widthDivPrincipale});}else dom.setStyles(div,{display:'block',overflow:'hidden',float:'left',border:'1px solid #78BD00',marginLeft:'6px',marginRight:'6px',marginTop:'0px',height:heightDivPrincipale,width:widthDivPrincipale});this.idDiv='image_'+j;div.nodeValueString=''+array_item[i].firstChild.nodeValue.split('&{des};')[0];div.nodeValueLabel=''+array_item[i].firstChild.nodeValue.split('&{des};')[1];div.heightImg=''+array_item[i].firstChild.nodeValue.split('&{des};')[3];div.widthImg=''+array_item[i].firstChild.nodeValue.split('&{des};')[2];div.onclick=function(){if(previewMode=="on"||operatingMode=="public")return;selected_valueString=this.nodeValueString;selected_imgLabel=this.nodeValueLabel;heightImg=this.heightImg;widthImg=this.widthImg;selLast=selDiv;if(selDiv==this)return false;selDiv=this;dom.setStyles(this,{border:'1px solid red'});if(dom.getAttrib(selLast,'id')){dom.setStyles(selLast,{border:'1px solid #78BD00'});}};dom.setAttribs(div,{onclick:div.onclick});div.onmouseover=function(){var evt=window.event?window.event:null;for(var fromObj=evt?(evt.fromElement?evt.fromElement:null):null;fromObj!=null;fromObj=(fromObj.parentNode?fromObj.parentNode:null))if(fromObj==this)return;this.style.cursor='pointer';this.style.cursor='hand';if(previewMode=="on"||operatingMode=="public")return;mouseOverDiv=this;zoomImageFileName=this.nodeValueString.split('_th.jpg')[0];var id_j=this.id.split('_')[1];child=this.getElementsByTagName("div").item(1);dom.setStyles(child,{display:'block'});};dom.setAttribs(div,{onmouseover:div.onmouseover});div.onmouseout=function(){var evt=window.event?window.event:null;for(var toObj=evt?(evt.toElement?evt.toElement:null):null;toObj!=null;toObj=(toObj.parentNode?toObj.parentNode:null))if(toObj==this)return;if(previewMode=="on"||operatingMode=="public")return;var id_j=this.id.split('_')[1];child=this.getElementsByTagName("div").item(1);dom.setStyles(child,{display:'none'});};dom.setAttribs(div,{onmouseout:div.onmouseout});var g_img=dom.create("img");g_img.filename=div.nodeValueString.split('_th.jpg')[0];if(gallery_name=='portfolio'){g_img.onclick=function(){sendAjaxRequest(this.filename,"htmlelementfilename","ajax-htmlFileRW");return false;};}if(gallery_name=='portfolio'){dom.setAttribs(g_img,{id:g_img.filename,alt:array_item[i].firstChild.nodeValue.split('&{des};')[1],src:'img_uploaded/'+"g_"+array_item[i].firstChild.nodeValue.split('&{des};')[0]});}else{dom.setAttribs(g_img,{id:g_img.filename,alt:array_item[i].firstChild.nodeValue.split('&{des};')[1],src:'img_uploaded/'+"g_"+array_item[i].firstChild.nodeValue.split('&{des};')[0],onclick:div.onmousedown});}var tmp_width=80;var tmp_height=80;if(tmp_height&&tmp_width){var ratio=1;if(tmp_height>tmp_width)ratio=parseFloat(heightDivPrincipale/tmp_height);else ratio=parseFloat(80/tmp_width);var offsetTop=parseInt((heightDivPrincipale-tmp_height*ratio)/2)+2;var offsetLeft=1;dom.setStyles(g_img,{position:'absolute',top:0,left:offsetLeft,height:'80px',width:'80px'});}var subDivLabel=dom.create("div");dom.setAttribs(subDivLabel,{id:'lab_'+j});dom.setStyles(subDivLabel,{display:'none',position:'absolute',background:'#003300',left:offsetLeft,top:80,height:100,zIndex:30000});var zoomLabel=dom.create("a");zoomLabel.i=i;zoomLabel.filename=div.nodeValueString.split('_th.jpg')[0];dom.setAttribs(zoomLabel,{href:'#'});if(gallery_name=='portfolio'){zoomLabel.onclick=function(){sendAjaxRequest(this.filename,"htmlelementfilename","ajax-htmlFileRW");return false;};}else{zoomLabel.onclick=function(){zoomImage(this.i,richTextBox_ifr);return false;};}dom.setAttribs(zoomLabel,{onclick:zoomLabel.onclick});if(gallery_name=='portfolio'){dom.setHTML(zoomLabel,'<font face=\"Arial\"><small>apri</small></font>');}else{dom.setHTML(zoomLabel,'<font face=\"Arial\"><small>zoom</small></font>');}var deleteLabel=dom.create("a");dom.setAttribs(deleteLabel,{href:'#'});deleteLabel.nodeValueString=''+array_item[i].firstChild.nodeValue.split('&{des};')[0];deleteLabel.nodeValueLabel=''+array_item[i].firstChild.nodeValue.split('&{des};')[1];deleteLabel.onclick=function(){if(confirm('eliminare '+this.nodeValueLabel+'?')){dom.setStyles(mouseOverDiv,{display:'none'});sendAjaxRequest(zoomImageFileName,"",'ajax-deleteGalleryImg');var docH=parseInt($(gallery_name+"Div").offsetHeight);var scroller=$(gallery_name+"Scroller");var scrollArea=$(gallery_name+"ScrollArea");var container=$(gallery_name+"Container");var content=$(gallery_name+"Div");initScroll(docH,scroller,scrollArea,container,content);};return false;};dom.setAttribs(deleteLabel,{onclick:deleteLabel.onclick});dom.setHTML(deleteLabel,'<font face=\"Arial\"><small>elimina</small></font>');var separatorLabel=dom.create("a");dom.setStyles(separatorLabel,{visibility:'hidden'});dom.setHTML(separatorLabel,'<font face=\"Arial\"><small>sepa</small></font>');subDivLabel.appendChild(zoomLabel);subDivLabel.appendChild(separatorLabel);subDivLabel.appendChild(deleteLabel);dom.setHTML(divLabel,"<font face=\"Arial\"><small>"+array_item[i].firstChild.nodeValue.split('&{des};')[1]+"</small></font>");div.appendChild(g_img);div.appendChild(divLabel);div.appendChild(subDivLabel);galleryDiv.appendChild(div);if(previewMode=="on"||operatingMode=="public"){Sortable.create(gallery_name_Div,{tag:'div',overlap:'horizontal',constraint:false,onUpdate:function(){}});Sortable.destroy(gallery_name_Div);}else{Sortable.create(gallery_name_Div,{tag:'div',overlap:'horizontal',constraint:false,onUpdate:function(){updatePortfolioDiv(Sortable.serialize(gallery_name_Div));}});}}if(!remove){if(previewMode=="on"||operatingMode=="public")return;selected_valueString=div.nodeValueString;selected_imgLabel=div.nodeValueLabel;selLast=selDiv;if(selDiv==this)return false;selDiv=div;dom.setStyles(div,{border:'1px solid red'});if(dom.getAttrib(selLast,'id')){dom.setStyles(selLast,{border:'1px solid #78BD00'});}}}var docH1=parseInt($(gallery_name+"Div").offsetHeight);var scroller1=$(gallery_name+"Scroller");var scrollArea1=$(gallery_name+"ScrollArea");var container1=$(gallery_name+"Container");var content1=$(gallery_name+"Div");initScroll(docH1,scroller1,scrollArea1,container1,content1);if(array_item[array_item.length-1].firstChild.nodeValue!="false"){div=dom.create('div');dom.setAttribs(div,{id:'waitdiv'});dom.setStyles(div,{display:'block',overflow:'hidden',float:'left',border:'1px dotted #78BD00',marginLeft:'2px',paddingLeft:'0.4em',height:90,width:80});imgHtml='<img src="img/waitimg.gif" align="center" style="position: relative; margin-top: 0px" width="80px" height="80px"/>';dom.setHTML(div,imgHtml);galleryDiv.appendChild(div);linearAppend=true;sendAjaxRequest(array_item[array_item.length-1].firstChild.nodeValue,"","ajax-linearResponsePortfolio");return;}sendAjaxRequest("portfolioImage290x180Description","portfolioImage290x180__DescriptionLabel","ajax-htmlFileRW");linearAppend=false;if(previewMode=="on"||operatingMode=="public")return;div=dom.create('div');dom.setAttribs(div,{id:'adddiv'});dom.setStyles(div,{display:'block',overflow:'hidden',float:'left',border:'1px dotted #78BD00',marginLeft:'2px',paddingLeft:'0.4em',height:heightDivPrincipale,width:80});if(gallery_name=='portfolio'){imgHtml='<a href="#" onclick="return false;"><img src="img/addimg.jpg" align="center" style="position: relative; margin-top: 0px" width="80px" height="80px" border="0px"/></a>';dom.setHTML(div,imgHtml);div.onclick=function(){div.current_j=j;RTB_InsertUploadImage(my_document.getElementById('richTextBox_ifr'));};}else if(gallery_name=='gallery'){imgHtml='<a href="#" onclick="return false;"><img src="img/addimg.jpg" align="center" style="position: relative; margin-top: 32px" width="60px" height="60px" border="0px"/></a>';dom.setHTML(div,imgHtml);div.onclick=function(){div.current_j=j;RTB_InsertUploadImage(my_document.getElementById('richTextBox_ifr'));};}galleryDiv.appendChild(div);div=$('divPortfolio290x180');div.onmouseover=function(){var evt=window.event?window.event:null;for(var fromObj=evt?(evt.fromElement?evt.fromElement:null):null;fromObj!=null;fromObj=(fromObj.parentNode?fromObj.parentNode:null))if(fromObj==this)return;this.style.cursor='pointer';this.style.cursor='hand';if(previewMode=="on"||operatingMode=="public")return;mouseOverDiv=this;dom.setStyles(document.getElementById('portfolioImage290x180Label'),{display:'block'});};dom.setAttribs(div,{onmouseover:div.onmouseover});div.onmouseout=function(){var evt=window.event?window.event:null;for(var toObj=evt?(evt.toElement?evt.toElement:null):null;toObj!=null;toObj=(toObj.parentNode?toObj.parentNode:null))if(toObj==this)return;if(previewMode=="on"||operatingMode=="public")return;dom.setStyles(document.getElementById('portfolioImage290x180Label'),{display:'none'});};dom.setAttribs(div,{onmouseout:div.onmouseout});div=$('divPortfolioImage135x100Left');div.onmouseover=function(){var evt=window.event?window.event:null;for(var fromObj=evt?(evt.fromElement?evt.fromElement:null):null;fromObj!=null;fromObj=(fromObj.parentNode?fromObj.parentNode:null))if(fromObj==this)return;this.style.cursor='pointer';this.style.cursor='hand';if(previewMode=="on"||operatingMode=="public")return;mouseOverDiv=this;dom.setStyles(document.getElementById('portfolioImage135x100LeftLabel'),{display:'block'});};dom.setAttribs(div,{onmouseover:div.onmouseover});div.onmouseout=function(){var evt=window.event?window.event:null;for(var toObj=evt?(evt.toElement?evt.toElement:null):null;toObj!=null;toObj=(toObj.parentNode?toObj.parentNode:null))if(toObj==this)return;if(previewMode=="on"||operatingMode=="public")return;dom.setStyles(document.getElementById('portfolioImage135x100LeftLabel'),{display:'none'});};dom.setAttribs(div,{onmouseout:div.onmouseout});div=$('divPortfolioImage135x100Right');div.onmouseover=function(){var evt=window.event?window.event:null;for(var fromObj=evt?(evt.fromElement?evt.fromElement:null):null;fromObj!=null;fromObj=(fromObj.parentNode?fromObj.parentNode:null))if(fromObj==this)return;this.style.cursor='pointer';this.style.cursor='hand';if(previewMode=="on"||operatingMode=="public")return;mouseOverDiv=this;dom.setStyles(document.getElementById('portfolioImage135x100RightLabel'),{display:'block'});};dom.setAttribs(div,{onmouseover:div.onmouseover});div.onmouseout=function(){var evt=window.event?window.event:null;for(var toObj=evt?(evt.toElement?evt.toElement:null):null;toObj!=null;toObj=(toObj.parentNode?toObj.parentNode:null))if(toObj==this)return;if(previewMode=="on"||operatingMode=="public")return;dom.setStyles(document.getElementById('portfolioImage135x100RightLabel'),{display:'none'});};dom.setAttribs(div,{onmouseout:div.onmouseout});}function updatePortfolioDiv(param){var dom=tinyMCE.activeEditor.windowManager.createInstance('tinymce.dom.DOMUtils',document);var gallery_name_Div=gallery_name+'Div';var galleryDiv=my_document.getElementById(gallery_name_Div);Sortable.destroy(gallery_name_Div);var dimensione=param.split("=").length-2;var line_a=1;var line_b=dimensione;var newsortable=new Array();for(var i=0;i<dimensione;i++){newsortable[i]=param.split("=")[i+1].split("&")[0];dom.setAttribs($("image_"+i),{id:"image_"+i+"Temp"});dom.setAttribs($("lab_"+newsortable[i]),{id:"lab_"+i+"Temp"});};for(var i=0;i<dimensione;i++){var img=$("lab_"+newsortable[i]+"Temp");dom.setAttribs($("image_"+newsortable[i]+"Temp"),{id:"image_"+i});dom.setAttribs($("lab_"+newsortable[i]+"Temp"),{id:"lab_"+i});}for(var i=0;i<dimensione;i++){if(newsortable[i]!=i){line_a=i+1;break;}};for(var i=line_a;i<dimensione;i++){if(newsortable[i]==i){line_b=i;break;}};if(newsortable[line_a-1]==line_b-1){}else{var tmp_line=line_a;line_a=line_b;line_b=tmp_line;}sendAjaxRequest(line_a,line_b,"ajax-shiftLinePortfolio");Sortable.create(gallery_name_Div,{tag:'div',overlap:'horizontal',constraint:false,onUpdate:function(){updatePortfolioDiv(Sortable.serialize(gallery_name_Div));}});}function zoomImage(i,editor){var dom=tinyMCE.activeEditor.windowManager.createInstance('tinymce.dom.DOMUtils',document);if(selected_valueString==null)return false;editor.focus();dom.setHTML(document.getElementById('zoomFileName'),zoomImageFileName);var zoomDiv=document.getElementById('zoomDiv');if(zoomDiv.hasChildNodes()){while(zoomDiv.childNodes.length>=1){zoomDiv.removeChild(zoomDiv.firstChild);}}var imgZoom=dom.create('img');var tmp_img=dom.create('img');dom.setAttribs(tmp_img,{src:'img_uploaded/'+zoomImageFileName+'.jpg'});var tmp_width=parseInt(array_item[i].firstChild.nodeValue.split('&{des};')[2]);var tmp_height=parseInt(array_item[i].firstChild.nodeValue.split('&{des};')[3]);if(tmp_width&&tmp_height){var int_tmp_width=parseInt(tmp_width);var int_tmp_height=parseInt(tmp_height);var ratio=1;if(int_tmp_height>=int_tmp_width)ratio=280/int_tmp_height;else ratio=360/int_tmp_width;dom.setAttribs(imgZoom,{src:'img_uploaded/'+zoomImageFileName+'.jpg',height:int_tmp_height*ratio,width:int_tmp_width*ratio});var tmp_height=dom.getAttrib(imgZoom,'height');var tmp_width=dom.getAttrib(imgZoom,'width');if(tmp_height&&tmp_width){var offsetTop=parseInt((280-tmp_height)/2)+60;var offsetLeft=parseInt((360-tmp_width)/2)+50;dom.setStyles(imgZoom,{position:'absolute',top:offsetTop,left:offsetLeft});}}zoomDiv.appendChild(imgZoom);RTB_showDialog(document.getElementById("zoomDialog"),document.getElementById("zoomDialog"),manageDialogCallback);return false;}
