try{var IsWindowsOS=function(){var a=!0;-1!=navigator.userAgent.indexOf("Mac OS X")&&(a=!1);return a},AddAllImagesCallback=function(a){try{var b=eval(a);a=function(){TextureClickImg(this,!1)};var c=function(){MouseOverImg(this)},h=function(){MouseOutImg(this)},f=0,k=IsWindowsOS()?"\\":"/";if(void 0!==b)for(var d=0;d<b.files.length;d++)if(b.files[d].toLowerCase().lastIndexOf(".png")===b.files[d].length-4||b.files[d].toLowerCase().lastIndexOf(".png")===b.files[d].length-4){var e=document.createElement("span");
e.setAttribute("id","img"+f.toString());var g=b.files[d].lastIndexOf(k)+1,l=b.files[d].substr(g,b.files[d].length-4-g);e.setAttribute("data-fullres",l);e.style.backgroundImage="url('"+b.files[d]+"')";e.onclick=a;e.onmouseover=c;e.onmouseout=h;0===f&&RemoveAllFromDiv();divImages.appendChild(e);f++}gTotalImages=f}catch(m){alert("AddAllImagesCallback error: "+m)}},MouseOutImg=function(a){try{isocons.innerHTML="SELECT AN ICON"}catch(b){alert(b)}},MouseOverImg=function(a){try{isocons.innerHTML=a.getAttribute("data-fullres")}catch(b){alert(b)}},
AddAllImages=function(a){try{var b=new CSInterface;loadJSX();b.evalScript("myLib.createImages('"+escape(encodeURIComponent(a))+"');",AddAllImagesCallback)}catch(c){alert("AllAllImages error: "+c)}},ParamsToParams=function(a,b){var c={filesArray:[]};c.filesArray.push(a);c.stateArray=[];c.stateArray.push(b);c.showHelpMessage=!1;c.version="1";c.currentFolder=gExternalFolder.length?gExternalFolder:gPanelPath+"/lib/iconLib";return JSON.stringify(c)},scaleit=function(){var a=new CSInterface;loadJSX();var b=
jQuery(".ui--slider").slider("value");a.evalScript('scale_obj("'+b+'")')},TextureClick=function(a){try{var b=ParamsToParams(a.getAttribute("data-fullres"));EvalScript("myLib.runProcess('"+b+"');");scaleit()}catch(c){gShowErrors&&alert("TextureClick : "+c)}},TextureClickImg=function(a){TextureClick(a,!1)},Persistent=function(a){a=a?new CSEvent("com.adobe.PhotoshopPersistent","APPLICATION"):new CSEvent("com.adobe.PhotoshopUnPersistent","APPLICATION");a.extensionId=gExtensionId;gCSInterface.dispatchEvent(a)},
RetrievePreferences=function(a){try{var b=eval(a);void 0!==b&&(gExternalFolder=b.currentFolder,gExternalFolder!=gPanelPath+"/lib/iconLib"&&(AddAllImages(gExternalFolder),gDefaultText=isocons.innerHTML))}catch(c){gShowErrors&&alert("RetrievePreferences : "+c+" : "+a)}},ResetIcons=function(){try{AddAllImages(gPanelPath+"/lib/iconLib"),gExternalFolder="",isocons.innerHTML="SELECT AN ICON"}catch(a){gShowErrors&&alert("ResetTextures catch : "+a)}},FolderPick=function(){try{var a=window.cep.fs.showOpenDialog(!1,
!0);a.err===cep.fs.NO_ERROR&&void 0!==a.data&&0<a.data.length&&(AddAllImages(a.data),gExternalFolder=a.data,gDefaultText=isocons.innerHTML)}catch(b){gShowErrors&&alert("FolderPick catch : "+b)}},RemoveAllFromDiv=function(){try{for(var a=0,b=document.getElementById("img"+a);b;)divImages.removeChild(b),a++,b=document.getElementById("img"+a)}catch(c){gShowErrors&&alert("RemoveAllFromDiv : "+c)}},GetUIItems=function(){divImages=document.getElementById("container");isocons=document.getElementById("isocons")},
loadJSX=function(){var a=new CSInterface,b=a.getSystemPath(SystemPath.EXTENSION)+"/host/";a.evalScript('$.evalFile("'+b+'mylib.jsx")')},EvalScript=function(a,b){loadJSX();gCSInterface.evalScript(a,b)},gCSInterface,gResourceBundle,gPanelPath,gTotalImages=54,gExtensionId="3dmapgenerator2.extension",gShowErrors=!0,gExternalFolder="",gPersistentOn=!0,ddAddMoreTextures,divImages,isocons,gDefaultText="";$(document).ready(function(){try{gCSInterface=new CSInterface,gResourceBundle=gCSInterface.initResourceBundle(),
GetUIItems(),gPanelPath=gCSInterface.getSystemPath(SystemPath.EXTENSION),gDefaultText=gResourceBundle.keySelecttextures,isocons.innerHTML=gResourceBundle.keySelecttextures,ResetIcons(),EvalScript("myLib.retrievePreferences();",RetrievePreferences),Persistent(gPersistentOn)}catch(a){gShowErrors&&alert("ready : resource bundle error "+a),gCSInterface=null,gResourceBundle={}}})}catch(e$$16){gShowErrors&&alert("Probably a syntax error in panel.js : "+e$$16)}
function urlopen(){cep.util.openURLInDefaultBrowser("http://www.3d-map-generator.com")};