function insertFolderImages(G,V,e){function ha(){window.jQuery&&jQuery.noConflict();for(var a=["/Common/ThirdParty/prototype.js","/Common/ThirdParty/lightbox/js/effects.js","/Common/ThirdParty/lightbox/js/lightbox.js"],d=document.getElementsByTagName("head")[0],f=0;f<a.length;++f){script=document.createElement("script");script.type="text/javascript";script.src=a[f];setTimeout(function(c){return function(){d.appendChild(c)}}(script),f*50)}}function W(a){try{q=new XMLHttpRequest;q.overrideMimeType("text/xml")}catch(d){try{q= new ActiveXObject("Msxml2.XMLHTTP")}catch(f){try{q=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){return true}}}if(J)q.onreadystatechange=X;q.open("GET",a,J);q.send(null)}function Y(a,d,f){window.addEventListener?a.addEventListener(d,f,false):a.attachEvent("on"+d,f)}function i(a){return parseInt(a,10).toString()=="NaN"?0:parseInt(a,10)}function ia(a,d){for(var f,c=[],j=0,h=[];j<a.length;j++)h.push(j);if(r){r=r.split(",");h=h.length;var b=f=0,t=",";for(j=[];b<r.length;++b){r[b]=r[b].replace(/^\s+|\s+$/g, "");r[b]=i(r[b]);if(t.indexOf(","+r[b]+",")==-1)j[f++]=r[b];t+=r[b]+","}f=","+j.join(",")+",";if(d){for(b=[];j.length>0;)b.push(j.splice(Math.floor(Math.random()*j.length),1)[0]);j=b}for(b=0;b<h;++b)if((t=a[b].getAttribute("title").replace(/^\s+|\s+$/g,"").match(/(^\d+)[\.\s]?\s*.*/))&&t[1].length)if(f.indexOf(","+i(t[1])+",")>-1)c[i(t[1])]=b;b=0;for(f=[];b<j.length;++b)if(c[j[b]]!=undefined&&!(y&&c[j[b]]>h-2)){f.push(c[j[b]]);y&&f.push(c[j[b]]+1)}h=f}else if(d){c=[];if(y)for(;Math.floor(h.length/ 2)*2>0;){j=Math.floor(Math.random()*Math.floor(h.length/2));c.push(h.splice(j*2,1)[0]);c.push(h.splice(j*2,1)[0])}else for(;h.length>0;)c.push(h.splice(Math.floor(Math.random()*h.length),1)[0]);h=c}if(K<h.length)h=h.splice(0,K*(y?2:1));return h}function Z(a){var d,f=a.offsetWidth,c=a.parentNode;if(c.nodeName!="DIV")c=c.parentNode;a=[];if((d=c.getElementsByTagName("strong")).length)a.push(d[0]);if((d=c.getElementsByTagName("span")).length)a.push(d[0]);for(d=0;d<a.length;++d){if(u)f-=i(a[d].currentStyle.marginLeft)+ i(a[d].currentStyle.marginRight);else if(c=window.getComputedStyle(a[d],null))f-=i(c.paddingLeft)+i(c.paddingRight)+i(c.borderLeftWidth)+i(c.borderRightWidth)+i(c.marginLeft)+i(c.marginRight);a[d].style.width=f+"px";a[d].style.display="block";a[d].style.overflow="hidden";a[d].style.clear="both"}}function X(){if(!J||q.readyState==4)if(q.responseXML){var a=q.responseXML.getElementsByTagName("album");if(!a.length)return false;var d=a[0].getAttribute("lgPath").replace(/http:\/\/[^\/]*/,"");a=a[0].getElementsByTagName("img"); if(a.length){H.innerHTML="";var f=ia(a,ja),c=[],j=y?-2:-1,h=false;if(v!=undefined){v=v.toString().replace(/^\s+|\s+$/g,"").replace(/\s+/g," ");var b=v.split(" ");if(b.length>3&&(b[1]=="*"||b[3]=="*")){b[1]="*";b[3]="*"}if(v=="*"||b.length>1&&b[1]=="*")h=true;v=b.join(" ").replace(/\*/g,"0")}for(var t=b=0,$=f.length,L=y?2:1,M=$-L;b<$;b+=L,t++){var m=f[b],o=d+a[m+(y?1:0)].getAttribute("src"),n,N,l,s=aa;l=O;n=y?d+a[m].getAttribute("src")+"?ent="+B:P=="system"?d+"Thumbnail/"+a[m].getAttribute("src")+ "?ent="+B:(N=i(P))>0?"/Publisher/GetResizedImage.aspx?w="+N+"&h="+N+"&url="+encodeURIComponent(o)+"&ent="+B:o+"?ent="+B;if(n!=undefined){var k=document.createElement("img");k.setAttribute("src",n);if(u)var ka=k.width,la=k.height;var p=a[m].getAttribute("title").replace(/^\s+|\s+$/g,"").replace(/^\d+[\.\s]?\s*(.*)/,"$1");p&&ma&&k.setAttribute("alt",p);if(n=a[m].getAttribute("caption")){n=n.replace(/^\s+|\s+$/g,"").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');var w=n.match(/^title\->.*$|^caption\->.*$|^tooltip\->.*$/gmi); if(w)for(var Q=0;Q<w.length;++Q){var x=w[Q].split("->");if(x[0].toLowerCase()=="caption"){x.shift();n=x[0]}if(x[0].toLowerCase()=="title"){x.shift();p=x[0]}if(x[0].toLowerCase()=="tooltip"){x.shift();l=x[0]}}}w=a[m].getAttribute("link");if(o=I?o+"?ent="+B:w){var z=document.createElement("a"),C=a[m].getAttribute("target");C&&!I&&z.setAttribute("target",C);I&&z.setAttribute("rel",I);z.setAttribute("href",o);z.appendChild(k);z.style[u?"styleFloat":"cssFloat"]="left";m=z;if(n){if(n.match(/<a/i))s=false; n=n.replace(/(<a[^>]*)(href=["']["'])([^<]*<\/a>)/gi,'$1href="'+o+'"$3')}}else m=k;if(typeof l=="string"){o&&z.setAttribute("title",l);k.setAttribute("title",l)}else if(l){o&&z.setAttribute("title",p);k.setAttribute("title",p)}l=document.createElement("div");l.appendChild(m);l.style[u?"styleFloat":"cssFloat"]="left";if(R&&p){m=document.createElement("strong");if(S)m.style.display="none";if(w&&ba){o=document.createElement("a");o.setAttribute("href",w);C&&o.setAttribute("target",C);o.innerHTML=p;m.appendChild(o)}else m.innerHTML= p;l.appendChild(m)}if(T&&n){p=document.createElement("span");if(S)p.style.display="none";if(s&&w){s=document.createElement("a");s.setAttribute("href",w);C&&s.setAttribute("target",C);s.innerHTML=n;p.appendChild(s)}else p.innerHTML=n;l.appendChild(p)}if(U){l.setAttribute("id",U.toString()+t);l.id=U.toString()+t}if(ca&&b==M)l.className=ca;H.appendChild(l);var ea=function(){if(h&&c.length){var g=H,D=c.length,A,E=0;if(u){A=g.offsetWidth-(i(g.currentStyle.paddingLeft)+i(g.currentStyle.paddingRight));A-= i(g.currentStyle.borderLeftWidth)+i(g.currentStyle.borderRightWidth)}else{A=window.getComputedStyle(g,null);A=i(A.width)}for(g=0;g<D;g++)E+=c[g].offsetWidth;if(D==1){c[0].style.marginLeft=A/2-E/2+"px";c[0].style.visibility="visible"}else{E=(A-E)/(D-1);for(g=0;g<D;g++){c[g].style.marginRight=g<D-1?Math.floor(E*(g+1))-Math.floor(E*g)+"px":"0";c[g].style.marginLeft="0";c[g].style.visibility="visible";if(g==D-1)c[g].style[u?"styleFloat":"cssFloat"]="right"}}}na&&ha();typeof da=="function"&&da()};if(h){l.style.visibility= "hidden";c.push(l)}if(v!=undefined)l.style.margin=v;if(S&&(T||R))k.readyState!="complete"&&!k.complete?Y(k,"load",function(g){return function(){Z(g)}}(k)):Z(k);if(k.readyState!="complete"&&!k.complete)Y(k,"load",function(){if((j+=L)==M)ea()});else if((j+=L)==M)ea();if(u&&v!="*"){s=i(k.currentStyle.width)||k.offsetWidth-(i(k.currentStyle.borderLeftWidth)+i(k.currentStyle.borderRightWidth));if(s=Math.floor(s/ka*la))k.height=s}}}}}}if(!G||!V)return false;e||(e={});if(typeof e=="string"){var F=e;e={}}var v= e.margin||F,K=e.limit,P=e.thumbnails,I=e.addRel,na=e.lightbox,T=e.addCaption,aa=e.addCaptionLink,R=e.addTitle,ba=e.addTitleLink,O=e.addTitleAttr==undefined?false:e.addTitleAttr,ma=e.addAlt==undefined?true:e.addAlt,ja=e.shuffle;F=i(e.cacheTime!=undefined?e.cacheTime:180);var S=e.autoTextWidth,da=e.oncomplete,U=e.id,ca=e.addLastClass,r=e.filter;K||(K=999999999);if(F<0)F=0;if(aa)T=true;if(ba)R=true;if(I&&!O)O=true;var y=P=="custom",u=window.ActiveXObject&&parseInt(navigator.userAgent.toLowerCase().split("msie")[1], 10)||false,q,J=u&&u<7?false:true,B=F?Math.floor((new Date).getTime()/(F*1E3)):"0";G+=(G.indexOf("?")!=-1?"&":"?")+"rdm="+B;var H=document.getElementById(V);if(u)var fa=0,ga=setInterval(function(){if(++fa==45)H.style.width="auto";fa==55&&clearInterval(ga);if(H.offsetWidth>0){clearInterval(ga);W(G);!J&&q&&X()}},100);else W(G)};
