function copyPrototype(D,C){var E=C.toString();var B=E.match(/\s*function ([^\(\s]*)\s*\(/);if(B!=null){D.prototype[B[1].replace(/^\s*|\s*$/g,"")]=C}D.prototype[B[1]]=C;for(var A in C.prototype){D.prototype[A]=C.prototype[A]}}function IlBaseObject(B,A){this.name=B;this.id=A}function IlConfigItem(D,C,A,B){this.IlBaseObject(D,C);this.settings=A;this.selected=B?true:false;this.setMeActive=function(){alert("Override me: IlConfigItem->setMeActive")}}copyPrototype(IlConfigItem,IlBaseObject);function IlMainObject(D,C,A,B){this.configCats=D?D:[];this.ilObject=A;this.type=C;this.ilMain=(typeof (B)=="string"?new Imagelooop.Looop(this.ilObject,B):(B?B:null));this.ilMainSettings={};this.getConfigCat=function(E){return this.configCats[E]};this.getType=function(){if(this.type){return this.type}return""};this.getIlMain=function(){return this.ilMain};this.makeIlMain=function(E){if(typeof (E)=="string"){this.ilMain=new Imagelooop.Looop(this.ilObject,E)}else{this.ilMain=E}this.addSetting("id",this.getId())};this.getMetaData=function(F){try{if(!this.ilMain.metDat||!this.ilMain.metDat.looopId||F){this.ilMain.clear();
this.ilMain.metDat=this.ilMain.getMetaData()}return this.ilMain.metDat}catch(E){return{}}};this.getLpcfg=function(F){try{if(!this.ilMainSettings.playerConfig||F){this.ilMain.clear();var G=this.ilMain.getLooopPlayerConfig();this.ilMainSettings.playerConfig=G.playerConfig;if(!this["name"]){this["name"]=G.name}}return this.ilMainSettings.playerConfig}catch(E){return{}}};this.clearSetting=function(E){delete this.ilMainSettings[E]};this.addSetting=function(E,F){this.ilMainSettings[E]=F};this.getSetting=function(E){return this.ilMainSettings[E]};this.getId=function(){try{return this.ilMain.getId()}catch(E){return false}};this.getContents=function(){try{return this.ilMain.getImages()}catch(E){return[]}};this.getContentsEx=function(){try{return this.ilMain.getImagesEx()}catch(E){return[]}};this.getSettingsString=function(){var E="";for(foo in this.ilMainSettings){if(typeof (this.ilMainSettings[foo])=="object"){for(bar in this.ilMainSettings[foo]){if(typeof (this.ilMainSettings[foo][bar])!="undefined"&&this.ilMainSettings[foo][bar]!=null){E+=(foo+"$"+bar+"="+this.ilMainSettings[foo][bar]+"&")
}}continue}if(typeof (this.ilMainSettings[foo])!="undefined"){E+=(foo+"="+this.ilMainSettings[foo]+"&")}}return E.substring(0,E.length-1)};this.updateMe=function(E,F){alert("Override me: IlMainObject->updateMe")};this.saveMe=function(E,F){alert("Override me: IlMainObject->saveMe")};this.beforeCollectionCheck=function(F){var E=false;if(this.ilMain&&this.ilMain.getId&&this.ilMain.getId()!=defaultId){E=this.getId()}else{if(this.createParams&&F){this.createParams+=("&"+F)}else{if(F){this.createParams=F}}looop=window.il.createLooop(window.pageBrand?window.pageBrand:this.getType(),"accessType="+this.getType()+"&"+(this.createParams?this.createParams:""));this.makeIlMain(looop);E=this.getId()}return E}}function addSet(B,A){for(foo in B){if(typeof (B[foo])=="object"){if(!Imagelooop.PAGE.mainObject.ilMainSettings[foo]){Imagelooop.PAGE.mainObject.ilMainSettings[foo]={}}for(bar in B[foo]){Imagelooop.PAGE.mainObject.ilMainSettings[foo][bar]=B[foo][bar]}}else{Imagelooop.PAGE.mainObject.ilMainSettings[foo]=B[foo]}}Imagelooop.PAGE.mainObject.updateMe();
return false}if(!window.Imagelooop){Imagelooop={}}Imagelooop.PAGE={importerFunctions:{}};Imagelooop.PAGE.doImport=function(){if(this.importerFunctions[arguments[0]]){this.importerFunctions[arguments[0]].apply(this,arguments)}else{this.importerFunctions["default"].apply(this,arguments)}};Imagelooop.PAGE.refreshImagePane=function(){alert("Override me: PAGE->refreshImagePane")};Imagelooop.PAGE.updateImages=function(){alert("Override me: PAGE->updateImages")};Imagelooop.PAGE.importerFunctions["default"]=function(F,E){var D=Imagelooop.PAGE.mainObject.getId();if(Imagelooop.PAGE.mainObject){Imagelooop.PAGE.mainObject.beforeCollectionCheck()}var H=F.split(".");H=H[H.length-1];$("#"+H+"-uploading").css("display","block");$("#"+H+"-choosing").css("display","none");var C=E.split(",");var B="importerId="+F+"&looopId="+Imagelooop.PAGE.mainObject.getId();for(var G=1;G<C.length;G++){var A=$("#"+C[G])[0];if(!A){continue}B+="&attributes="+A.name+"&attributes="+encodeURIComponent(A.value);A.value=""}il.rpcCall("imagelooop.importPrepareContent",B,function(I,J){try{if(I&&!I.isException){if(I.imageId&&I.imageId.length&&I.imageId.length>0){Imagelooop.PAGE.flashUploader.queueComplete(D!=Imagelooop.PAGE.mainObject.getId())
}else{alert("No photos found.")}}else{if(I&&I.isException){alert(I.message)}else{alert("Error: Unexpected return value.")}}}finally{var K=J.split(".");K=K[K.length-1];$("#"+K+"-uploading").css("display","none");$("#"+K+"-choosing").css("display","block")}},F);return false};