function wow_handleError(c,b,a){var d="An error has occurred in this dialog.\n\nError: "+a+"\n"+c;
alert(d);
return true
}function WowImageSelector(e,b,c){this.id=e;
this.selected_store=new WowISImageList();
this.main_store=new WowISImageStore();
this.selector;
this.uploader;
this.browser;
this.selection_view;
this.objects=new Object();
this.thumbnail_size=94;
this.max_selected=b?b:9999999;
if(c){var a=document.getElementById(c);
var d=function(g,f,h){if(h.selected_store.count()>=h.max_selected){a.disabled=true
}else{a.disabled=false
}};
if(a){this.selected_store.pushEvent.subscribe(d,this);
this.selected_store.removeEvent.subscribe(d,this)
}}}WowImageSelector.prototype.addImage=function(b,d){var c;
if(this.main_store.inStore(b.asset_id)){var a=this.main_store.getImage(b.asset_id);
a.sync(b,false);
if(d){if(a.selected&&!b.selected){a.selected=b.selected;
this.selected_store.removeById(a.asset_id)
}else{if(!a.selected&&b.selected){a.selected=b.selected;
this.selected_store.push(a,false)
}}}c=a
}else{c=b.clone();
if(!d){c.selected=false
}c=this.main_store.push(c,false);
if(c.selected){this.selected_store.push(c,false)
}}return c
};
WowImageSelector.prototype.addObject=function(b,a){this.objects[b]=a
};
WowImageSelector.prototype.calcMarginTop=function(b,c){var a=0;
if(c>0){var d=Math.floor(this.thumbnail_size*c/b);
if(d<this.thumbnail_size){a=Math.floor((this.thumbnail_size-d)/2)
}}return a
};
WowImageSelector.prototype.deselectImage=function(a){this.selected_store.removeById(a)
};
WowImageSelector.prototype.getId=function(){return this.id
};
WowImageSelector.prototype.getObject=function(a){return this.objects[a]
};
WowImageSelector.prototype.getMainStore=function(){return this.main_store
};
WowImageSelector.prototype.getSelectedStore=function(){return this.selected_store
};
WowImageSelector.prototype.getUploader=function(){return this.uploader
};
WowImageSelector.prototype.moveSelected=function(c,d,b){if(this.selected_store.inStore(c)){var a=this.selected_store.getImage(d);
if(c=a.asset_id){this.selected_store.move(c,b)
}}};
WowImageSelector.prototype.onImagesLoadedEvent=function(j,g,h){var a=g[0];
var f=g[1];
var k=a.getImages();
for(var e=0,b=k.length;
e<b;
e++){var d=k[e];
if(h.main_store.inStore(d)){var c=h.main_store.getImage(d.asset_id);
if(f){if(d.selected){if(!c.selected){c.selected=true;
h.selected_store.push(c)
}}else{if(c.selected){c.selected=false;
h.selected_store.removeImage(c.asset_id)
}}}k[e]=c
}else{if(!f){d.selected=false
}h.main_store.push(d,0)
}}};
WowImageSelector.prototype.onUploadedImageEvent=function(b,a,c){var d=a[0];
var e=a[1];
if(!c.main_store.inStore(d.asset_id)){c.main_store.push(d,false);
if(!e){if(c.selected_store.count()<c.max_selected){d.selected=true;
c.selected_store.push(d,false)
}}}};
WowImageSelector.prototype.openBrowserPanel=function(a){if(!this.browser){this.browser=new WowISBrowserPanel(this,a)
}this.scrollWinToTop();
this.browser.show();
return this.browser
};
WowImageSelector.prototype.openSelectionPanel=function(a){if(!this.selector){this.selector=new WowISSelectionPanel(this,a)
}this.scrollWinToTop();
this.selector.show();
return this.selector
};
WowImageSelector.prototype.openUploadPanel=function(b,a){if(!this.uploader){this.uploader=new WowISUploadPanel(this,b,a);
this.uploader.uploadedImageEvent.subscribe(this.onUploadedImageEvent,this)
}this.scrollWinToTop();
this.uploader.show();
return this.uploader
};
WowImageSelector.prototype.scrollWinToTop=function(){window.scroll(0,0)
};
WowImageSelector.prototype.setSelectionList=function(a){this.selection_view=new WowISSelectionView(this,a,this.selected_store);
this.selected_store.moveEvent.subscribe(this.selection_view.onImageMoveEvent,this.selection_view);
return this.selection_view
};
function WowISBrowserPanel(b,c){this.image_selector=b;
this.tag_id=c;
this.image_selector.addObject(this.tag_id,this);
this.panel;
this.panel=new YAHOO.widget.Panel(this.tag_id+"dummy",{close:false,draggable:false,fixedcenter:true,height:"580px",modal:true,visible:false,width:"790px"});
this.panel.setHeader("");
this.panel.setBody('<div id="WowBrowserView"></div>');
this.panel.setFooter('<input type="button" class="wowButton" value="Sluit" onclick="'+this.image_selector.getId()+".getObject('"+this.tag_id+"').hide()\"></input>");
this.panel.render(this.tag_id);
var a=this.image_selector.getSelectedStore();
this.browser_view=new WowISThumbnailView(this.image_selector,"WowBrowserView",true);
this.browser_view.setImageList(a);
this.browser_view.imageSelectionEvent.subscribe(this.onImageSelectionEvent,this);
this.hideEvent=new YAHOO.util.CustomEvent("hideEvent",this,true)
}WowISBrowserPanel.prototype.hide=function(){this.panel.hide();
this.hideEvent.fire()
};
WowISBrowserPanel.prototype.onImageSelectionEvent=function(d,b,e){var a=e.image_selector.getSelectedStore();
var f=b[0];
var c=b[1];
if(c){a.push(f)
}else{a.removeById(f.asset_id)
}};
WowISBrowserPanel.prototype.show=function(){this.browser_view.redraw();
this.panel.show()
};
function WowISImage(a){this.asset_id;
this.thumbnail;
this.filename;
this.url;
this.selected=0;
this.height;
this.width;
if(a.asset_id){this.asset_id=a.asset_id
}if(a.thumbnail){this.thumbnail=a.thumbnail
}if(a.filename){this.filename=a.filename
}if(a.url){this.url=a.url
}if(a.selected){this.selected=a.selected
}if(a.height){this.height=a.height
}if(a.width){this.width=a.width
}this.toggleSelectedEvent=new YAHOO.util.CustomEvent("toggleSelected",this,true)
}WowISImage.prototype.clone=function(){return new WowISImage(this)
};
WowISImage.prototype.sync=function(a,b){this.thumbnail=a.thumbnail;
this.filename=a.filename;
this.url=a.url;
this.height=a.height;
this.width=a.width;
if(b){this.selected=a.selected
}return this
};
WowISImage.prototype.toggleSelected=function(){};
function WowISImageList(){this.images_by_idx=new Array();
this.moveEvent=new YAHOO.util.CustomEvent("moveEvent",this,true);
this.pushEvent=new YAHOO.util.CustomEvent("pushEvent",this,true);
this.removeEvent=new YAHOO.util.CustomEvent("removeEvent",this,true)
}WowISImageList.prototype.count=function(){return this.images_by_idx.length
};
WowISImageList.prototype.getImage=function(a){return this.images_by_idx[a]
};
WowISImageList.prototype.getImages=function(){return this.images_by_idx
};
WowISImageList.prototype.inStore=function(b){for(var a=0,c=this.images_by_idx.length;
a<c;
a++){if(this.images_by_idx[a].asset_id==b){return true
}}return false
};
WowISImageList.prototype.move=function(d,b){var a;
for(var c=0,e=this.images_by_idx.length;
c<e;
c++){if(this.images_by_idx[c].asset_id==d){if(c!=b){a=this.images_by_idx[c];
this.images_by_idx.splice(c,1);
this.images_by_idx.splice(b,0,a);
this.moveEvent.fire(a,c,b)
}break
}}};
WowISImageList.prototype.push=function(b,d){var c=d?b.clone():b;
var a=this.images_by_idx.length;
this.images_by_idx[a]=c;
this.pushEvent.fire(c,a);
return a
};
WowISImageList.prototype.removeById=function(c){for(var b=0,d=this.images_by_idx.length;
b<d;
b++){if(this.images_by_idx[b].asset_id==c){var a=this.images_by_idx.splice(b,1);
this.removeEvent.fire(b,a);
break
}}};
function WowISImageStore(){this.images_by_id=new Object();
this.pushEvent=new YAHOO.util.CustomEvent("pushEvent",this,true);
this.removeEvent=new YAHOO.util.CustomEvent("removeEvent",this,true)
}WowISImageStore.prototype.getImage=function(a){return this.images_by_id[a]
};
WowISImageStore.prototype.getImages=function(){return this.images_by_id
};
WowISImageStore.prototype.inStore=function(a){if(this.images_by_id[a]!=undefined&&this.images_by_id[a].asset_id==a){return true
}return false
};
WowISImageStore.prototype.push=function(a,c){var b=c?a.clone():a;
if(this.images_by_id[b.asset_id]!=undefined&&this.images_by_id[b.asset_id].asset_id==b.asset_id){alert(b.asset_id+" already in stored!")
}else{this.images_by_id[b.asset_id]=b
}return b
};
WowISImageStore.prototype.removeById=function(b){var a=this.images_by_id[b];
delete this.images_by_id[b];
this.removeEvent.fire(a)
};
function WowISSelectionPanel(a,b){this.image_selector=a;
this.tag_id=b;
this.image_selector.addObject(this.tag_id,this);
this.panel;
this.panel=new YAHOO.widget.Panel(this.tag_id+"dummy",{close:false,draggable:false,fixedcenter:true,height:"580px",modal:true,visible:false,width:"790px"});
this.panel.setHeader("");
this.panel.setBody('<div id="WowTreeview"></div><div id="WowImagesView"></div>');
this.panel.setFooter('<input type="button" class="wowButton" value="Sluit" onclick="'+this.image_selector.getId()+".getObject('"+this.tag_id+"').hide()\"></input>");
this.panel.render(this.tag_id);
this.tree_view=new WowISTreeView(this.image_selector,"WowTreeview");
this.thumbnail_view=new WowISThumbnailView(this.image_selector,"WowImagesView");
this.tree_view.nodeLoadedEvent.subscribe(this.onNodeLoadedEvent,this);
this.thumbnail_view.imageSelectionEvent.subscribe(this.onImageSelectionEvent,this);
this.hideEvent=new YAHOO.util.CustomEvent("hideEvent",this,true)
}WowISSelectionPanel.prototype.hide=function(){this.panel.hide();
this.hideEvent.fire()
};
WowISSelectionPanel.prototype.onNodeLoadedEvent=function(b,a,c){var d=a[0];
c.thumbnail_view.setImageList(d)
};
WowISSelectionPanel.prototype.onImageSelectionEvent=function(d,b,e){var a=e.image_selector.getSelectedStore();
var f=b[0];
var c=b[1];
if(c){if(a.count()>=this.image_selector.max_selected){f.selected=false
}else{a.push(f)
}}else{a.removeById(f.asset_id)
}};
WowISSelectionPanel.prototype.show=function(){this.thumbnail_view.redraw();
this.panel.show()
};
function WowISSelectionView(b,c,a){this.image_selector=b;
this.selected_store=a;
this.tag_id=c;
this.selected_store.pushEvent.subscribe(this.onPushImageToStoreEvent,this);
this.selected_store.removeEvent.subscribe(this.onRemoveImageEvent,this)
}WowISSelectionView.prototype.createDomNode=function(b,a){var e=document.createElement("img");
var d=document.createElement("input");
var c=document.createElement("div");
e.setAttribute("src",b.url+"?w="+this.image_selector.thumbnail_size+";bestfit=1");
e.setAttribute("alt","");
d.setAttribute("type","hidden");
d.setAttribute("name","wow_images");
d.setAttribute("value",a+"#"+b.asset_id);
c.appendChild(d);
c.appendChild(e);
c.className="selectionListItem";
return c
};
WowISSelectionView.prototype.onImageMoveEvent=function(e,c,f){var a=c[0];
var d=c[1];
var b=c[2];
var h=document.getElementById(f.tag_id);
var g=h.childNodes[d];
h.removeChild(g);
h.insertBefore(g,h.childNodes[b]);
f.recalculateIndex(d<b?d:b,d<b?b:d)
};
WowISSelectionView.prototype.onPushImageToStoreEvent=function(c,b,d){var e=b[0];
var a=b[1];
var g=document.getElementById(d.tag_id);
var f=d.createDomNode(e,a);
g.insertBefore(f,g.lastChild);
d.recalculateIndex(a)
};
WowISSelectionView.prototype.onRemoveImageEvent=function(c,b,d){var a=b[0];
var e=b[1];
var g=document.getElementById(d.tag_id);
var f=g.childNodes[a];
g.removeChild(f);
d.recalculateIndex(a)
};
WowISSelectionView.prototype.recalculateIndex=function(b,m){var k=document.getElementById(this.tag_id);
var l=this.selected_store.getImages();
if(m==undefined){m=l.length-1
}for(var f=b,c=m+1;
f<c;
f++){var a=k.childNodes[f];
var g=a.getElementsByTagName("input");
for(var d=0,h=g.length;
d<h;
d++){var e=g[d];
e.setAttribute("value",f+"#"+l[f].asset_id)
}}};
function WowISThumbnailView(a,d,c,b){this.tag_id=d;
this.show_toolbar=c;
this.image_selector=a;
this.image_selector.addObject(d,this);
this.has_clear_div=false;
this.image_list;
if(b){this.image_list=b
}else{this.image_list=new WowISImageList()
}this.imageSelectionEvent=new YAHOO.util.CustomEvent("imageSelectionEvent",this,true)
}WowISThumbnailView.prototype.createDomNode=function(j,o,d){var i=document.createElement("img");
var e=document.createElement("div");
var l=document.createElement("div");
var n=document.createElement("a");
var c=j.filename;
var q;
if(c.length>15){c=c.substr(0,12)+"..."
}if(this.show_toolbar){this.setImageItemClass(e,false);
n.setAttribute("href","#")
}else{this.setImageItemClass(e,j.selected);
n.setAttribute("href","#");
var m=this;
n.onclick=function(){m.image_selector.getObject(m.tag_id).toggleSelection(j.asset_id,o);
return false
}
}e.appendChild(n);
l.className="image";
q=document.createTextNode(c);
n.appendChild(l);
n.setAttribute("title",j.filename);
if(this.show_toolbar){var p=document.createElement("div");
p.className="toolbar";
n.appendChild(p);
var k=document.createElement("a");
var b=document.createElement("img");
k.setAttribute("href","#");
k.appendChild(b);
p.appendChild(k);
var a=document.createElement("a");
var f=document.createElement("img");
a.setAttribute("href","#");
a.appendChild(f);
p.appendChild(a);
var g=document.createElement("a");
var h=document.createElement("img");
g.setAttribute("href","#");
g.appendChild(h);
p.appendChild(g);
this.setToolbarButtons(n,j,o,d)
}n.appendChild(q);
i.setAttribute("src",j.url+"?w="+this.image_selector.thumbnail_size+";bestfit=1");
i.setAttribute("alt","");
l.appendChild(i);
return e
};
WowISThumbnailView.prototype.onImageMoveEvent=function(k,h,j){var f=h[0];
var a=h[1];
var m=h[2];
var g=document.getElementById(j.tag_id);
var l=j.image_list.count();
var e=j.createDomNode(f,m,l);
var c=g.childNodes[a];
g.removeChild(c);
if(m<g.childNodes.length||j.has_clear_div){g.insertBefore(c,g.childNodes[m])
}else{g.appendChild(c)
}for(var d=(a<m?a:m),b=(a<m?m:a);
d<=b;
d++){j.setToolbarButtons(g.childNodes[d],j.image_list.getImage(d),d,l)
}};
WowISThumbnailView.prototype.onImageRemoveEvent=function(h,f,g){var j=f[0];
var d=f[1];
var e=document.getElementById(g.tag_id);
var b=e.childNodes[j];
e.removeChild(b);
for(var c=(j>0?j-1:j),a=e.childNodes.length;
c<a;
c++){g.setToolbarButtons(e.childNodes[c],g.image_list.getImage(c),c,a)
}};
WowISThumbnailView.prototype.redraw=function(d){var a=this.image_list.getImages();
var f=document.getElementById(this.tag_id);
while(f.hasChildNodes()){f.removeChild(f.firstChild)
}for(var c=0,e=a.length;
c<e;
c++){var b=this.createDomNode(a[c],c,e);
f.appendChild(b)
}};
WowISThumbnailView.prototype.setImageList=function(a){this.image_list=a;
this.image_list.moveEvent.subscribe(this.onImageMoveEvent,this);
this.image_list.removeEvent.subscribe(this.onImageRemoveEvent,this);
this.redraw()
};
WowISThumbnailView.prototype.setImageItemClass=function(a,b){if(b){a.className="imagesViewItem";
a.className+=" imagesViewItemSelected"
}else{a.className="imagesViewItem"
}};
WowISThumbnailView.prototype.setToolbarButtons=function(g,k,o,d){var h=o>0?true:false;
var c=o<d-1?true:false;
var j=true;
var n=YAHOO.util.Dom.getElementsByClassName("toolbar","div",g);
var p=n[0];
var l=p.firstChild;
var b=l.firstChild;
var a=p.childNodes[1];
var e=a.firstChild;
var f=p.childNodes[2];
var i=f.firstChild;
var m=this;
if(h){l.onclick=function(){m.image_selector.moveSelected(k.asset_id,o,o-1);
return false
};
b.setAttribute("src","/extras/wow/img/left.gif");
b.setAttribute("alt","")
}else{l.removeAttribute("onclick");
b.setAttribute("src","/extras/wow/img/left-gray.gif");
b.setAttribute("alt","")
}if(c){a.onclick=function(){m.image_selector.moveSelected(k.asset_id,o,o+1);
return false
};
e.setAttribute("src","/extras/wow/img/right.gif");
e.setAttribute("alt","")
}else{a.removeAttribute("onclick");
e.setAttribute("src","/extras/wow/img/right-gray.gif");
e.setAttribute("alt","")
}if(j){f.setAttribute("href","#");
f.onclick=function(){m.image_selector.deselectImage(k.asset_id);
return false
};
i.setAttribute("src","/extras/wow/img/delete.gif");
i.setAttribute("alt","")
}};
WowISThumbnailView.prototype.toggleSelection=function(d,a){var e=document.getElementById(this.tag_id);
var b=this.image_list.getImage(a);
if(b.asset_id==d){b.selected=!b.selected;
var c=e.childNodes[a];
this.imageSelectionEvent.fire(b,b.selected);
this.setImageItemClass(c,b.selected)
}return false
};
function WowISTreeView(image_selector,tag_id){this.image_selector=image_selector;
this.tag_id=tag_id;
this.images_cache=new Object();
this.load_url=getWebguiProperty("pageURL")+"?op=WowISgetAssets";
this.tree_view=new YAHOO.widget.TreeView(tag_id);
this.nodeLoadedEvent=new YAHOO.util.CustomEvent("nodeLoadedEvent",this,true);
this.image_selector.addObject(this.tag_id,this);
var me=this;
var f=function(node){var node_object=node.data;
if(node_object.assetId){if(node_object.autoReload){me.tree_view.removeChildren(node);
node.setDynamicLoad(me.loadNodeData,1);
node.toggle()
}else{if(node_object.assetId in me.images_cache){me.showNodeImages(node_object.assetId)
}}}};
this.tree_view.subscribe("labelClick",f);
var callback={success:function(oResponse){var node=me.tree_view.getRoot();
var oResults=eval("("+oResponse.responseText+")");
me.parseTreeNode(node,oResults,false);
me.tree_view.draw()
},failure:function(oResponse){},argument:{},timeout:30000};
YAHOO.util.Connect.asyncRequest("GET",this.load_url,callback)
}WowISTreeView.prototype.loadNodeData=function(node,fnLoadComplete){var me=node.data.tree_view;
var url=me.load_url+";assetId="+node.data.assetId;
var callback={success:function(oResponse){var oResults=eval("("+oResponse.responseText+")");
me.parseTreeNode(node,oResults,true);
oResponse.argument.fnLoadComplete()
},failure:function(oResponse){oResponse.argument.fnLoadComplete()
},argument:{node:node,fnLoadComplete:fnLoadComplete},timeout:30000};
YAHOO.util.Connect.asyncRequest("GET",url,callback)
};
WowISTreeView.prototype.parseTreeNode=function(d,c,l){if((c.assets)&&(c.assets.length)){var b=new WowISImageList();
for(var h=0,g=c.assets.length;
h<g;
h++){var a=c.assets[h];
if(a.isImage){var f=new WowISImage({asset_id:a.assetId,url:a.url,thumbnail:a.thumbNailUrl,filename:a.label,width:a.width,height:a.height,selected:false});
f=this.image_selector.addImage(f,false);
this.images_cache[a.assetId]=f;
b.push(f)
}}if(d.data&&d.data.assetId){this.images_cache[d.data.assetId]=b
}if(l){this.showNodeImages(d.data.assetId)
}for(var h=0,g=c.assets.length;
h<g;
h++){var a=c.assets[h];
if(!a.isImage){var e=a.inPath;
var k=new YAHOO.widget.TextNode({label:a.label,assetId:a.assetId,autoReload:a.autoReload,tree_view:this},d,e);
if(e){this.parseTreeNode(k,a,e)
}else{k.setDynamicLoad(this.loadNodeData,1)
}if(a.iconType){k.labelStyle="icon-"+a.iconType
}}}}};
WowISTreeView.prototype.showNodeImages=function(b){var a=this.images_cache[b];
this.nodeLoadedEvent.fire(a)
};
function WowISUploadPanel(a,c,b){this.image_selector=a;
this.tag_id=c;
this.upload_url=b;
this.panel;
this.image_selector.addObject(this.tag_id,this);
this.sync_pending=0;
this.syncUploadedImages("init");
this.uploadedImageEvent=new YAHOO.util.CustomEvent("uploadedImageEvent",this,true);
this.hideEvent=new YAHOO.util.CustomEvent("hideEvent",this,true);
this.panel=new YAHOO.widget.Panel(this.tag_id,{close:false,draggable:false,fixedcenter:true,height:"580px",modal:true,visible:false,width:"790px"});
this.panel.setHeader("");
this.panel.setFooter('<input type="button" class="wowButton" id="WowJumpLoaderStart" value="Start uploaden" onclick="'+this.image_selector.getId()+".getObject('"+this.tag_id+'\').uploadButton()" disabled="disabled"></input><input type="button" class="wowButton" id="WowJumpLoaderCancel" value="Annuleer" onclick="'+this.image_selector.getId()+".getObject('"+this.tag_id+"').cancelButton()\"></input>");
this.panel.setBody('<div id="WowJumpLoaderDiv">Even wachten alsjeblieft...</div>');
this.panel.render();
setTimeout(this.image_selector.getId()+".getObject('"+this.tag_id+"').includeJumploader()",1000)
}WowISUploadPanel.prototype.cancelButton=function(){var a;
if(document.jumpLoaderApplet){a=document.jumpLoaderApplet.getUploader()
}if(a&&a.isUploading()){}else{if(this.sync_pending){setTimeout(this.image_selector.getId()+".getObject('"+this.tag_id+"').cancelButton()",1000)
}else{this.hide()
}}};
WowISUploadPanel.prototype.hide=function(){this.panel.hide();
if(jQuery){jQuery(".mceEditor").css("visibility","visible")
}this.hideEvent.fire()
};
WowISUploadPanel.prototype.includeJumploader=function(){var c=false;
var b=c?document.createElement("object"):document.createElement("applet");
var a;
b.setAttribute("id","jumpLoaderApplet");
b.setAttribute("name","jumpLoaderApplet");
if(c){b.setAttribute("type","application/x-java-applet")
}else{b.setAttribute("code","jmaster.jumploader.app.JumpLoaderApplet.class");
b.setAttribute("archive","/extras/wow/jumploader_z.jar")
}b.setAttribute("width","780");
b.setAttribute("height","520");
b.setAttribute("mayscript","true");
if(c){a=document.createElement("param");
a.setAttribute("name","code");
a.setAttribute("value","jmaster.jumploader.app.JumpLoaderApplet.class");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","archive");
a.setAttribute("value","/extras/wow/jumploader_z.jar");
b.appendChild(a)
}a=document.createElement("param");
a.setAttribute("name","uc_uploadUrl");
a.setAttribute("value",this.upload_url+"?func=jumpLoaderUpload");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","uc_fileNamePattern");
a.setAttribute("value",".*(GIF|gif|JPEG|jpeg|JPG|jpg|PNG|png)$");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","gc_loggingLevel");
a.setAttribute("value","INFO");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","vc_fileListViewLocationBarVisible");
a.setAttribute("value","true");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","vc_fileTreeViewShowFileLength");
a.setAttribute("value","false");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","vc_fileTreeViewShowFiles");
a.setAttribute("value","false");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","vc_mainViewFileListViewHeightPercent");
a.setAttribute("value","60");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","vc_mainViewFileListViewVisible");
a.setAttribute("value","true");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","vc_mainViewLogoEnabled");
a.setAttribute("value","false");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","vc_uploadViewStartActionVisible");
a.setAttribute("value","false");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","vc_uploadViewStopActionVisible");
a.setAttribute("value","false");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","ac_fireUploaderFileStatusChanged");
a.setAttribute("value","true");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","ac_fireUploaderStatusChanged");
a.setAttribute("value","true");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","ac_fireUploaderSelectionChanged");
a.setAttribute("value","true");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","ac_fireUploaderFileAdded");
a.setAttribute("value","true");
b.appendChild(a);
a=document.createElement("param");
a.setAttribute("name","ac_fireUploaderFileRemoved");
a.setAttribute("value","true");
b.appendChild(a);
var d=document.getElementById("WowJumpLoaderDiv");
while(d.hasChildNodes()){d.removeChild(d.firstChild)
}d.appendChild(b)
};
WowISUploadPanel.prototype.setButtons=function(c){var b=document.getElementById("WowJumpLoaderStart");
var a=document.getElementById("WowJumpLoaderCancel");
if(c.isUploading()){b.value="Stop uploaden";
b.disabled=false;
a.disabled=true
}else{b.value="Start uploaden";
if(c.canStartUpload()){b.disabled=false
}else{b.disabled=true
}a.disabled=false
}};
WowISUploadPanel.prototype.show=function(){if(jQuery){jQuery(".mceEditor").css("visibility","hidden")
}this.panel.show()
};
WowISUploadPanel.prototype.syncUploadedImages=function(init){var me=this;
var load_url=this.upload_url+"?op=WowISgetAssets;upload_url=1";
var callback={success:function(oResponse){var oResults=eval("("+oResponse.responseText+")");
if((oResults.assets)&&(oResults.assets.length)){for(var i=0,j=oResults.assets.length;
i<j;
i++){var child_node=oResults.assets[i];
if(child_node.isImage){var new_image=new WowISImage({asset_id:child_node.assetId,url:child_node.url,thumbnail:child_node.thumbNailUrl,filename:child_node.label,width:child_node.width,height:child_node.height});
me.uploadedImageEvent.fire(new_image,init)
}}}me.sync_pending--
},failure:function(oResponse){me.sync_pending--
},argument:{},timeout:30000};
me.sync_pending++;
YAHOO.util.Connect.asyncRequest("GET",load_url,callback)
};
WowISUploadPanel.prototype.uploadButton=function(){var a=document.jumpLoaderApplet.getUploader();
if(a.isUploading()){a.stopUpload()
}else{a.startUpload()
}};
function uploaderFileAdded(a){wow_is.getUploader().setButtons(a)
}function uploaderFileRemoved(a){wow_is.getUploader().setButtons(a)
}function uploaderSelectionChanged(a){wow_is.getUploader().setButtons(a)
}function uploaderStatusChanged(a){wow_is.getUploader().setButtons(a)
}function uploaderFileStatusChanged(b,a){if(a.getStatus()==2){wow_is.getUploader().syncUploadedImages();
if(b.isReady()){wow_is.getUploader().cancelButton()
}}};
