tries = 0; imageName = ""; imageDb = null; scaled = -1; availWidth = 844; origW = 0; firstScale = true; going = true; pageType = 0; prevImage = ""; nextImage = ""; notBig = true; firstE = true; ignoreOne = false; secondScale = true; xScrollAmount = 0; yScrollAmount = 0; rWaiting = false; currentPage = 1; maxPage = 1; row = -2; prevRow = -1; rows = null; targetY = 0; floatXtra = 0; lastUrl = ""; opened = false; pageUrl = 0; allowCheckup = true; atLastCheckup = -1; okCheckups = 0; lastScrollPos = -1; firstX = true; detectUserScroll = false; scaleTries = 0; function setAvailWidth() { if (!isNaN(''+document.body.offsetWidth)) { availWidth = document.body.offsetWidth>1101 ? document.body.offsetWidth-200 : (document.body.offsetWidth>966 ? 931 : document.body.offsetWidth-35); } } function imageWork() { if (document.getElementById("abot")!=null && typeof(bb)!="undefined") { setAvailWidth(); imageName = document.location.href.substring(0, document.location.href.lastIndexOf('.')); imageName = unescape(imageName.substring(imageName.lastIndexOf('/')+1)).replace(/\%23/g, "#").replace(/\%25/g, "%"); document.title = imageName +" "+ document.title.substring(document.title.lastIndexOf(':')); mL = (availWidth-986)/2; if (mL<0) { document.getElementById("atopr").style.paddingLeft = 5; mL = 0; } document.getElementById("atop").style.marginLeft = mL; mL = (availWidth-728)/2; document.getElementById("abot").style.marginLeft = mL>0 ? mL : 0; mL = (availWidth-300)/2; document.getElementById("con").style.marginLeft = mL>0 ? mL : 0; imageDb = bb.split(aa); orient(); if (document.getElementById("img")!=null && document.getElementById("II")!=null) { document.getElementById("imgName").innerHTML = insertSpaces(imageName).replace(/[ ]{2}/g, "  ") + ' 100%'; if (document.getElementById("low")!=null) { document.getElementById("low").getElementsByTagName("a")[0].href = unescape(document.getElementById("low").getElementsByTagName("a")[0].href).replace(/\%/g, "%2525").replace(/\#/g, "%2523"); } document.getElementById('shortcutsDesc').innerHTML = "
R = Random Image
A/D (or Left/Right) = Change Image

"; document.getElementById('scaleLink').innerHTML = '[Toggle Scale]  Shortcuts...

'; document.getElementById("img").style.width = availWidth; document.getElementById("II").onclick = function (evt) {scale();}; scale(); pageType = 2; } else if (document.getElementById("captchaInput")!=null) { document.title = "*** "+ document.title; document.getElementById("captchaInput").focus(); pageType = 3; } } else if (document.getElementById("thebo")!=null) { showPath(false); if (document.getElementById("empty")!=null) { document.getElementById("empty").innerHTML = 'Please select one of the categories above.'; } else { prev = '<'; next = 'Next >>'; if (document.title.indexOf('PAGE')==0) { row = -1; oF = document.title.indexOf(' of '); currentPage = document.title.substring(5, oF) * 1; maxPage = document.title.substring(oF+4, document.title.lastIndexOf(':')-1) * 1; if (currentPage>1) { prev = '<'; } if (currentPageNext >>'; } lOc = document.location.href.indexOf('#'); if (lOc!=-1) { findImage = unescape(document.location.href.substring(lOc+1)).toLowerCase(); div = document.createElement('div'); text = document.createTextNode(findImage); div.appendChild(text); findImage2 = div.innerHTML; if (findImage.indexOf('.')!=-1 && findImage.length>4) { rows = document.getElementById("list").getElementsByTagName("tr"); for (i=0;i <\/s>/g,''); if (rowHtml.indexOf('
'+findImage+'')!=-1 || rowHtml.indexOf('href="'+findImage+'.')!=-1 || rowHtml.indexOf('
'+findImage2+'')!=-1 || rowHtml.indexOf('href="'+findImage2+'.')!=-1) { row = i; setTimeout("focusOnRow(-2);", 50); setTimeout("focusOnRow(-2);", 200); setTimeout("focusOnRow(-1);", 500); break; } } } } } document.getElementById('pageLinks').innerHTML += '
 '+prev+'   Rnd   '+next+' 
'; floatXtra = 2; floatFloater(); document.getElementById('floater').style.display = 'block'; } pageType = 1; } else { keepWaiting(); } } function insertSpaces(imageName) { imageNameFinal = ''; cnt = 0; for (i=0;i0) { prevImage = imageDb[i-1].replace(/%/g, "%2525").replace(/#/g, "%2523"); prev = ''+prev+''; } if (i+1'+next+''; } if (document.getElementById('low')!=null) { lql = getLowQualityLevel(imageDb[i]); if (lql>=7) { document.getElementById('low').style.backgroundColor = "#ff4444"; } else if (lql>=5) { document.getElementById('low').style.backgroundColor = "#dd0000"; } else if (lql>=3) { document.getElementById('low').style.backgroundColor = "#880000"; } document.getElementById("II").title = "Note: This is a low quality version, click the file name below the image for the original file."; } break; } } imageNumber = i+1; pageNumber = Math.floor((imageNumber-1)/50)+1; main = prev+'   Random   '+next; pageUrl = pageNumber +'.html#'+ escape(imageName); document.getElementById('controls').innerHTML = '
'+main+'
 
'+imageNumber+' / '+imageDb.length +'   Page '+pageNumber+'
 '+main.replace('< Prev','<').replace('Random','Rnd').replace('Next Image >>','Next >>')+' 
'; floatFloater(); document.getElementById('floater').style.display = 'block'; showPath(true); } function showPath(fore) { if (document.getElementById('path')!=null || fore==false) { document.getElementById('path').innerHTML = (fore?'
':'') + parsePath(document.title.substring(document.title.lastIndexOf(':')+2).toUpperCase()) + (fore?'':'

'); } else { setTimeout("showPath(true);", 100); } } function parsePath(path) { isIndex = document.title.indexOf("INDEX")==0; isPage = document.title.indexOf("PAGE")==0; cats = path.split('/'); finalPath = 'HOME'; for (i=0; i0) { finalPath += ' > '+cats[i]+''; } } if (!isPage && !isIndex) { finalPath +=' > (IMAGE)'; } return finalPath; } function floatFloater() { document.getElementById('floater').style.top = document.body.scrollTop+document.body.clientHeight-32-floatXtra; document.getElementById('floater').style.left = document.body.scrollLeft+document.body.clientWidth-162; setTimeout("floatFloater();", 75); } function randomWait() { if (typeof(bb)!="undefined") { imageDb = bb.split(aa); rWaiting = false; randomImage(); } else { setTimeout("randomWait();", 100); } } function getGoing() { going = true; setTimeout("going = false;", 3000); } function randomImage() { if (!going && document.getElementById('empty')==null && !rWaiting) { if (typeof(bb)=="undefined") { rWaiting = true; f = document.createElement('script'); f.setAttribute("type","text/javascript"); f.setAttribute("src", "i.js"); document.getElementsByTagName("head")[0].appendChild(f); setTimeout("randomWait();", 50); } else { getGoing(); document.location.href = makeLink(imageDb[Math.floor(Math.random()*imageDb.length)].replace(/#/g, "%2523")); } } } restoreStr = ""; function keys() { if (document.getElementById("shortcutsDesc").innerHTML.indexOf('legend.gif')==-1) { restoreStr = ""+ document.getElementById("shortcutsDesc").innerHTML; doKeys(); } else { document.getElementById("shortcutsDesc").innerHTML = restoreStr; } } function doKeys() { document.getElementById("shortcutsDesc").innerHTML = '
Site Keyboard Shortcuts:


'; } function scale() { obj = document.getElementById("II"); if (firstScale){ tryS = 100 * ((55-scaleTries)/55); if (obj.widthavailWidth){ skalan=availWidth/breddNu; scaled=1; } }else{ skalan=origW/breddNu; scaled=0; } firstScale = false; obj.width=breddNu*skalan; obj.height=hojdNu*skalan; notBig = obj.width<=availWidth+5; document.getElementById("img").style.width = availWidth; document.getElementById("imageScale").innerHTML = ' ' + Math.round(100*(obj.width/origW)) + '%'; } function turnPage(next) { if (next && currentPage1) { document.location.href = --currentPage +".html"; return true; } return false; } function doScroll() { xTarget = document.body.scrollLeft; yTarget = document.body.scrollTop; if (yScrollAmount!=0) { if ((yScrollAmount>0 && yScrollAmount<10) || (yScrollAmount>-10 && yScrollAmount<0)) { portion = yScrollAmount; } else if (yScrollAmount>0) { portion = yScrollAmount<20 ? 10 : Math.round(yScrollAmount/2); } else { portion = yScrollAmount>-20 ? -10 : Math.round(yScrollAmount/2); } yTarget += portion; yScrollAmount -= portion; } if (xScrollAmount!=0) { if ((xScrollAmount>0 && xScrollAmount<10) || (xScrollAmount>-10 && xScrollAmount<0)) { portion = xScrollAmount; } else if (xScrollAmount>0) { portion = xScrollAmount<20 ? 10 : Math.round(xScrollAmount/2); } else { portion = xScrollAmount>-20 ? -10 : Math.round(xScrollAmount/2); } xTarget += portion; xScrollAmount -= portion; } window.scrollTo(xTarget, yTarget); if (xScrollAmount!=0 || yScrollAmount!=0) { setTimeout("doScroll();", 20); } } function addScroll(x, y) { xScrollAmount += x; yScrollAmount += y; if (xScrollAmount==x && yScrollAmount==y) { doScroll(); } } function openImage(leftImage) { cells = rows[row].getElementsByTagName("td"); for (i=(leftImage?0:1);i')+4); floatXtra += 10; document.getElementById("shrtct").style.height = floatXtra+"px"; document.getElementById("shrtct").style.backgroundColor = "#eeeeee"; document.getElementById("shrtct").innerHTML += (floatXtra>12?'
':'')+''+(theName.length>18?theName.substring(0,15)+'...':theName)+''; lastUrl = theUrl; } break; } if (!leftImage && cells.length==1) { lastUrl = ""; } } function paintRow(rowNumber, rowColor, textColor, linkStyle, linkColor) { rows[rowNumber].style.backgroundColor = rowColor; cells = rows[rowNumber].getElementsByTagName("td"); for (i=0;i0) { row--; } targetY = rowMiddle(row); upper = document.body.scrollTop+yScrollAmount; lower = document.body.scrollTop+yScrollAmount + document.body.clientHeight; middle = document.body.scrollTop+yScrollAmount + (lower-upper)/2; if (type>-1 && ((targetYlower && row!=0))) { oldRow = row; oldTargetY = targetY; closest = -1; for (i=0;i50) { allowCheckup = false; } else if (!detectUserScroll) { setTimeout("detectUserScroll = true;", 1000); } } if (type>-1 || (targetY!=atLastCheckup && allowCheckup)) { paintRow(row, "#ffdd77", "#886600", "italic", "#000000"); addScroll(0, Math.round(targetY-middle)); if (prevRow!=-1 && prevRow!=row) { paintRow(prevRow, "", "", "", ""); } prevRow = row; if (type==-1 && allowCheckup) { lastScrollPos = document.body.scrollTop+yScrollAmount; atLastCheckup = targetY; okCheckups = 0; setTimeout("focusOnRow(-1);", 500); } } else if (type==-1 && allowCheckup && okCheckups<40) { setTimeout("focusOnRow(-1);", 1000); okCheckups++; } if (type>-1) { allowCheckup = false; } } document.onkeydown=function(e){ if (pageType==1 || pageType==2) { if (!e) { e=window.event; } key = e.keyCode; if (ignoreOne) { ignoreOne = false; } else if (key==81) { if (pageType==2 && !firstScale) { if (secondScale) { document.getElementById("II").style.position = "relative"; document.getElementById("II").style.zIndex = 3; secondScale = false; } scale(); } else if (pageType==1 && row!=-2) { focusOnRow(0); openImage(true); } } else if (key==82) { randomImage(); } else if (key==69) { if (pageType==2 && !going) { target = document.getElementById('con').offsetTop-document.body.clientHeight; if (target>document.body.scrollTop) { window.scrollTo(document.body.scrollLeft, target+5); } else if (!firstE) { document.location.href = imageName.replace(/\%/g, "%2525").replace(/\#/g, "%2523") +".htm"; getGoing(); } firstE = document.getElementById("low")==null; } else if (pageType==1 && row!=-2) { focusOnRow(0); openImage(false); } } else if (!going && (key==65 || (key==37 && (pageType==1 || (notBig && !firstScale))))) { if (pageType==1) { if (turnPage(false)) { getGoing(); } } else if (prevImage!="") { document.location.href = makeLink(prevImage); getGoing(); } } else if (!going && (key==68 || (key==39 && (pageType==1 || (notBig && !firstScale))))) { if (pageType==1) { if (turnPage(true)) { getGoing(); } } else if (nextImage!="") { document.location.href = makeLink(nextImage); getGoing(); } } else if (key==17 || key==18) { ignoreOne = true; } else if (key==87) { if (pageType==1 && row!=-2) { focusOnRow(2); } else { addScroll(0, -300); } } else if (key==83) { if (pageType==1 && row!=-2) { focusOnRow(1); } else { addScroll(0, 300); } } else if (key==67) { if (pageType==1 && !going && row!=-2) { if (lastUrl=="") { focusOnRow(0); openImage(false); } if (lastUrl!="") { document.location.href = lastUrl; getGoing(); } } else { addScroll(300, 0); } } else if (key==90) { if (pageType==1 && !going && row!=-2) { if (lastUrl=="") { focusOnRow(0); openImage(true); } document.location.href = lastUrl; getGoing(); } else { addScroll(-300, 0); } } else if (key==88) { if (document.getElementById("img")!=null && !firstScale) { addScroll(1+(document.getElementById('high')!=null?document.getElementById('high').offsetLeft:document.getElementById('low').offsetLeft)+document.getElementById("II").width/2-document.body.clientWidth/2-document.body.scrollLeft-xScrollAmount, 67+document.getElementById("II").height/2-document.body.clientHeight/2-document.body.scrollTop-yScrollAmount); } else if (!firstX) { addScroll(document.body.scrollWidth/2-document.body.clientWidth/2-document.body.scrollLeft-xScrollAmount, document.body.scrollHeight/2-document.body.clientHeight/2-document.body.scrollTop-yScrollAmount); } firstX = false; } else if (key==70 && pageType==2 && !going) { document.location.href = pageUrl; getGoing(); } else if (!going && pageType==2 && (key<37 || key>40) && key!=32 && key!=116 && !(key>=33 && key<=36)) { doKeys(); } if (key!=69) { firstE = true; } if (key!=88) { firstX = true; } } } setTimeout("going = false;", 400);