// JavaScript Document var IeAlpha; var IsRuning; var FadeIn; IeAlpha = 100; function FadeImage(e, picarr2) { var nextpic, prevpic, posofpic; var avskaladURL = document.getElementById('bild').src; if(IsRuning != 1) { if(document.getElementById('bild').src.substring(avskaladURL.length-e.length, avskaladURL.length) != e) { IsRuning = 1; document.getElementById('bild').style.opacity = "1"; t=setInterval("fade('"+e+"')", 10); } posofpic = picarr2.ArrayPlats(e); if (posofpic >= picarr2.length - 1) { nextpic = 0; } else { nextpic = posofpic + 1; } if (posofpic <= 0) { prevpic = picarr2.length - 1; } else { prevpic = posofpic - 1; } document.getElementById('piclink_back').href = "javascript:FadeImage('" + picarr2[prevpic][0] + "', picarr);changeText('imgtext','" + picarr2[prevpic][1] + "');"; document.getElementById('piclink_forw').href = "javascript:FadeImage('" + picarr2[nextpic][0] + "', picarr);changeText('imgtext','" + picarr2[nextpic][1] + "');"; } } Array.prototype.ArrayPlats=function(o){ for(var i=0;i < this.length; i++) { if(this[i][0]==o) { return i; } } return -1; } function fade(e) { if (FadeIn != 1) { IeAlpha-=10; document.getElementById('bild').style.filter = "alpha(opacity=" + IeAlpha + ")"; currentAlpha = parseFloat(document.getElementById('bild').style.opacity); document.getElementById('bild').style.opacity = currentAlpha-0.1; } else { IeAlpha+=10; document.getElementById('bild').style.filter = "alpha(opacity=" + IeAlpha + ")"; currentAlpha = parseFloat(document.getElementById('bild').style.opacity); document.getElementById('bild').style.opacity = currentAlpha+0.1; if (parseFloat(document.getElementById('bild').style.opacity) == 1) { FadeIn = 0; clearInterval(t); IsRuning = 0; } if(IeAlpha == 100) { FadeIn = 0; clearInterval(t); IsRuning = 0; } } if (parseFloat(document.getElementById('bild').style.opacity) == 0) { document.getElementById('bild').src = e; FadeIn = 1; } if (IeAlpha == 0) { document.getElementById('bild').src = e; FadeIn = 1; } } function changeText(id, text){ document.getElementById(id).innerHTML = text; } function setStatusbar(txt) { self.status = txt } toggleDiv = function(id, onoff) { var elm = document.getElementById(id); if (onoff==1) { elm.style.display ="block"; } else if (onoff==0) { elm.style.display ="none"; } else { if (elm.style.display=="none") { elm.style.display ="block"; } else { elm.style.display ="none"; } } } function submitThisForm(e) { var resultat = testForm(e,attTestas) if (resultat) { document.getElementById("verifyFrm").value = "verified"; e.action = window.location; } return resultat; } var popWindow = new Array(4); for(var i=0; i < popWindow.length; i++){ popWindow[i] = new Array(2); } function MM_openBrWindow(theURL,winName,features) { var windowRef = findWindowRef(winName); var tmpWin; if (windowRef == null) { var arrayPos = getFreeSpace(); popWindow[arrayPos][0] = winName; popWindow[arrayPos][1] = window.open(theURL,winName,features); windowRef = popWindow[arrayPos][1]; var wWidth, wHeight; var strStart, strStop; strStart = features.indexOf('width='); strStop = (features.indexOf(',',strStart) > 0)?features.indexOf(',',strStart):features.length; wWidth = features.substring(strStart+'width='.length,strStop) strStart = features.indexOf('height='); strStop = (features.indexOf(',',strStart) > 0)?features.indexOf(',',strStart):features.length; wHeight = features.substring(strStart+'height='.length,strStop) if (Number(wWidth) && Number(wHeight)) { var windowX, windowY windowX = (screen.width/2) - (wWidth/2); windowY = (screen.height/2) - (wHeight/2); windowRef.moveTo(windowX,windowY); } } else { windowRef.focus(); } } function getFreeSpace(){ for(var i=0; i < popWindow.length; i++){ if(popWindow[i][0] == null || popWindow[i][1].closed){ return i } } } function findWindowRef(winName){ for(var i=0;i < popWindow.length; i++){ if(popWindow[i][0] == winName && popWindow[i][1] != null && !popWindow[i][1].closed){ return popWindow[i][1] } } return null; }