function Thumb(f,g,e,h){this.alt=(h=="undefined")?"iakke":h;this.path=f;this.onclick=function(){if(g!="#"){window.open(g)}}}function Slideshow(P,I){this.id=P;var H=5;var N=2;var C=null;var S=document.getElementById(P);var V=document.createElement("div");var Y=document.createElement("div");var W=0;var O=S.style.width.substr(0,S.style.width.indexOf("px",0));var R=S.style.height.substr(0,S.style.height.indexOf("px",0));var aa=0;var Z=0;var F=0;var U=new Array();var Q=new Array();Q[0]=document.createElement("img");Q[1]=document.createElement("img");Q[0].onload=D;Q[1].onload=D;Q[0].onerror=ab;Q[1].onerror=ab;Q[0].onabort=T;Q[1].onabort=T;Q[0].bLoaded=false;Q[1].bLoaded=false;Q[0].src="http://css.iakke.com/default/images/fotogallery_dx.png";Q[1].src="http://css.iakke.com/default/images/fotogallery_sx.png";Y.id="plane";Y.style.position="absolute";Y.style.padding="0px";Y.style.width=O+"px";Y.style.height=R+"px";Y.style.top=0;Y.style.left=0;V.id="container_crop";V.style.overflow="hidden";V.style.position="relative";V.style.width=O+"px";V.style.height=R+"px";V.appendChild(Y);S.appendChild(V);if((I!=null)&&(I!="undefined")){F=I.length;for(var J=0;J<I.length;J++){var L=document.createElement("img");var G="vertical-align:middle; border:"+N+"px solid #FFFFFF";L.src=I[J].path;L.onclick=I[J].onclick;if(ie4){L.style.setAttribute("cssText",G)}else{L.setAttribute("style",G)}L.onmouseover=function(){this.style.border=N+"px solid #FFAA00"};L.onmouseout=function(){this.style.border=N+"px solid #FFFFFF"};U.push(L);L.onload=D;L.onerror=ab;L.onabort=T;L.bLoaded=false}}function i(){var a=parseInt(Y.style.left.substr(0,Y.style.left.indexOf("px",0)));Y.style.left=(a>0)?"-"+(parseInt(W)/3)+"px":parseInt(a+H)+"px"}function M(){var a=parseInt(Y.style.left.substr(0,Y.style.left.indexOf("px",0)));Y.style.left=(a<=-((parseInt(W)/3)*2))?"-"+(parseInt(W)/3)+"px":parseInt(a-H)+"px"}function X(c){var b=new Image();b.src=c;var a=b.height;var d=b.width}this.addImages=function(a){aa=0;Z=0;F+=a.length;for(var c=0;c<a.length;c++){var d=document.createElement("img");var b="vertical-align:middle; border:"+N+"px solid #FFFFFF";d.onload=D;d.onerror=ab;d.onabort=T;d.bLoaded=false;d.src=a[c].path;d.onclick=a[c].onclick;if(ie4){d.style.setAttribute("cssText",b)}else{d.setAttribute("style",b)}d.onmouseover=function(){this.style.border=N+"px solid #FFAA00"};d.onmouseout=function(){this.style.border=N+"px solid #FFFFFF"};U.push(d)}};function K(){W=0;for(var d=0;d<U.length;d++){W+=parseInt(U[d].width+parseInt(N)+parseInt(N));Y.appendChild(U[d])}if(W>O){for(var f=0;f<2;f++){for(var d=0;d<U.length;d++){var g=document.createElement("img");var c="vertical-align:middle; border:"+N+"px solid #FFFFFF";g.src=U[d].src;g.onclick=U[d].onclick;if(ie4){g.style.setAttribute("cssText",c)}else{g.setAttribute("style",c)}g.onmouseover=function(){this.style.border=N+"px solid #FFAA00"};g.onmouseout=function(){this.style.border=N+"px solid #FFFFFF"};W+=g.width+N+N;Y.appendChild(g)}}}Y.style.width=W+"px";Y.style.left=(W>O)?"-"+(parseInt(W)/3)+"px":"0px";if(W>O){if(!ie4){var h=Q[0];h.style.left=parseInt(O-h.width)+"px"}else{var h=document.createElement("div");var b=Q[0];h.style.width=b.width+"px";h.style.left=parseInt(O-b.width)+"px";b.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";h.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b.src+"')";h.appendChild(b)}h.style.position="absolute";h.style.top="0px";h.onmouseover=function(){C=setInterval(i,10)};h.onmouseout=function(){clearInterval(C)};V.appendChild(h);if(!ie4){var a=Q[1];a.style.left="0px"}else{var a=document.createElement("div");var e=Q[1];a.style.width=e.width+"px";a.style.left="0px";e.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e.src+"')";a.appendChild(e)}a.style.position="absolute";a.style.top="0px";a.onmouseover=function(){C=setInterval(M,10)};a.onmouseout=function(){clearInterval(C)};V.appendChild(a)}}function E(){++Z;if(F&&(Z==F)){K()}}function D(){bLoaded=true;aa++;E()}function ab(){bError=true;alert("error loading image "+this.src)}function T(){bAbort=true;alert("abort loading")}};