function Thumb(a,d,b,c){this.alt=(c=="undefined")?"iakke":c;this.path=a;this.onclick=function(){if(d!="#"){window.open(d)}}}function Slideshow(n,s){this.id=n;var t=5;var p=2;var y=null;var k=document.getElementById(n);var g=document.createElement("div");var d=document.createElement("div");var f=0;var o=k.style.width.substr(0,k.style.width.indexOf("px",0));var l=k.style.height.substr(0,k.style.height.indexOf("px",0));var b=0;var c=0;var v=0;var h=new Array();var m=new Array();m[0]=document.createElement("img");m[1]=document.createElement("img");m[0].onload=x;m[1].onload=x;m[0].onerror=a;m[1].onerror=a;m[0].onabort=j;m[1].onabort=j;m[0].bLoaded=false;m[1].bLoaded=false;m[0].src="http://css.iakke.com/default/images/fotogallery_dx.png";m[1].src="http://css.iakke.com/default/images/fotogallery_sx.png";d.id="plane";d.style.position="absolute";d.style.padding="0px";d.style.width=o+"px";d.style.height=l+"px";d.style.top=0;d.style.left=0;g.id="container_crop";g.style.overflow="hidden";g.style.position="relative";g.style.width=o+"px";g.style.height=l+"px";g.appendChild(d);k.appendChild(g);if((s!=null)&&(s!="undefined")){v=s.length;for(var r=0;r<s.length;r++){var B=document.createElement("img");var u="vertical-align:middle; border:"+p+"px solid #FFFFFF";B.src=s[r].path;B.onclick=s[r].onclick;if(ie4){B.style.setAttribute("cssText",u)}else{B.setAttribute("style",u)}B.onmouseover=function(){this.style.border=p+"px solid #FFAA00"};B.onmouseout=function(){this.style.border=p+"px solid #FFFFFF"};h.push(B);B.onload=x;B.onerror=a;B.onabort=j;B.bLoaded=false}}function z(){var i=parseInt(d.style.left.substr(0,d.style.left.indexOf("px",0)));d.style.left=(i>0)?"-"+(parseInt(f)/3)+"px":parseInt(i+t)+"px"}function A(){var i=parseInt(d.style.left.substr(0,d.style.left.indexOf("px",0)));d.style.left=(i<=-((parseInt(f)/3)*2))?"-"+(parseInt(f)/3)+"px":parseInt(i-t)+"px"}function e(D){var E=new Image();E.src=D;var i=E.height;var C=E.width}this.addImages=function(F){b=0;c=0;v+=F.length;for(var D=0;D<F.length;D++){var C=document.createElement("img");var E="vertical-align:middle; border:"+p+"px solid #FFFFFF";C.onload=x;C.onerror=a;C.onabort=j;C.bLoaded=false;C.src=F[D].path;C.onclick=F[D].onclick;if(ie4){C.style.setAttribute("cssText",E)}else{C.setAttribute("style",E)}C.onmouseover=function(){this.style.border=p+"px solid #FFAA00"};C.onmouseout=function(){this.style.border=p+"px solid #FFFFFF"};h.push(C)}};function q(){f=0;for(var G=0;G<h.length;G++){f+=parseInt(h[G].width+parseInt(p)+parseInt(p));d.appendChild(h[G])}if(f>o){for(var E=0;E<2;E++){for(var G=0;G<h.length;G++){var D=document.createElement("img");var H="vertical-align:middle; border:"+p+"px solid #FFFFFF";D.src=h[G].src;D.onclick=h[G].onclick;if(ie4){D.style.setAttribute("cssText",H)}else{D.setAttribute("style",H)}D.onmouseover=function(){this.style.border=p+"px solid #FFAA00"};D.onmouseout=function(){this.style.border=p+"px solid #FFFFFF"};f+=D.width+p+p;d.appendChild(D)}}}d.style.width=f+"px";d.style.left=(f>o)?"-"+(parseInt(f)/3)+"px":"0px";if(f>o){if(!ie4){var C=m[0];C.style.left=parseInt(o-C.width)+"px"}else{var C=document.createElement("div");var I=m[0];C.style.width=I.width+"px";C.style.left=parseInt(o-I.width)+"px";I.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";C.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+I.src+"')";C.appendChild(I)}C.style.position="absolute";C.style.top="0px";C.onmouseover=function(){y=setInterval(z,10)};C.onmouseout=function(){clearInterval(y)};g.appendChild(C);if(!ie4){var J=m[1];J.style.left="0px"}else{var J=document.createElement("div");var F=m[1];J.style.width=F.width+"px";J.style.left="0px";F.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";J.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+F.src+"')";J.appendChild(F)}J.style.position="absolute";J.style.top="0px";J.onmouseover=function(){y=setInterval(A,10)};J.onmouseout=function(){clearInterval(y)};g.appendChild(J)}}function w(){++c;if(v&&(c==v)){q()}}function x(){bLoaded=true;b++;w()}function a(){bError=true;alert("error loading image "+this.src)}function j(){bAbort=true;alert("abort loading")}};
