document.h9k=new Object; document.globalh9k=new Object; var globaltid=0; var movespeed=0.0015; // Steps per 1/1000 sec var fadespeed=0.2; // % per 1/1000 sec function GetGlobalDelta() { var now=new Date().getTime(); var ret=now-globaltid; globaltid=now; return ret; } function getElement(id) { return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; } function extractnumber(nr) { if (!nr) { return 0; } nr=parseInt(nr); if (isNaN(nr)) { return 0; } return nr; } function setstyle(node,txt) { if (!node || !txt) { return; } // Again IE dont handle things normaly, we need to set cssText for that sucker if (node.style && node.style.setAttribute) { node.style.setAttribute('cssText', txt); } else { node.setAttribute('style', txt); } } var _h9k_dragy=-1; var _h9k_dragys=-1; var _h9k_dragid=""; var _h9k_oldcursor=null; var _h9k_oldmousemove=null; var _h9k_oldmouseup=null; var _h9k_oldselectstart=null; function returnfalse(ev) { if (!ev) { ev=window.event; } ev.cancelBubble=true; if (ev.stopPropagation) { ev.stopPropagation(); } return false; } function h9k_scrollbar_onwheel2(ev) { if (!ev) { ev=window.event; } ev.cancelBubble=true; if (ev.stopPropagation) { ev.stopPropagation(); } evv=new Object; evv.wheelDelta=ev.wheelDelta; evv.detail=ev.detail; var p=ev.currentTarget; if (!p) { p=ev.srcElement; } var mid=(p.id).split("_scrollbar")[0] if (mid) { evv.currentTarget=getElement(mid); h9k_scrollbar_onwheel(evv); } } function h9k_scrollbar_onwheel(event){ var delta = 0; if (!event) { /* For IE. */ event = window.event; } if (event.wheelDelta) { delta = event.wheelDelta/120; if (window.opera) { if ( extractnumber(window.opera.version())<10) { delta = -delta; } } } else if (event.detail) { delta = -event.detail/3; } if (delta) { var p=event.currentTarget; if (!p) { p=event.srcElement; while(p && !p.onmousewheel){ p=p.parentNode; } } if (p) { if (delta<0) { delta=1; } else { delta=-1; } h9k_scrollbar_setscroll(p.id,delta,"delta"); } } if (event.preventDefault) { event.preventDefault(); } event.returnValue = false; } function h9k_scrollbar_hide(mid) { var p=getElement(mid); var pp=getElement(mid+"_scrollbar"); if (!p || !pp) { return; } if (pp.style.display!="none") { pp.style.display="none"; } } function h9k_scrollbar_show(mid) { var p=getElement(mid); var pp=getElement(mid+"_scrollbar"); if (!p || !pp) { return; } if (pp.style.display=="none") { pp.style.display="inline"; } } function h9k_scrollbar_setscroll(mid,pos,what) { var p=getElement(mid); var pp=getElement(mid+"_scrollbar"); var ppp=getElement(mid+"_scrollbar_handle"); if (!p || !pp || !ppp) { return; } var sh=p.scrollHeight; var h=p.clientHeight; var scrollh=h-1-1; var th=sh-h; var handpix=(scrollh/sh); var hh=Math.round(handpix*h); if (hh<16) { hh=16; } handpix=((scrollh-hh)/th); if (what) { if (what=="scroll"){ pos=Math.round(pos/handpix)+_h9k_dragys; } if (what=="click"){ if (pos<=extractnumber(ppp.style.top)) { pos=p.scrollTop-Math.round(h*0.9); } else { pos=p.scrollTop+Math.round(h*0.9); } } if (what=="delta"){ pos=p.scrollTop+pos*15; } } if (th<=0) { h9k_scrollbar_hide(mid); } else { h9k_scrollbar_show(mid); if (pos<0) { pos=0; } if (pos>th) { pos=th; } var hht=Math.round(0+handpix*pos); // pp.style.top=pos; pp.style.height=h+"px"; ppp.style.height=hh+"px"; ppp.style.top=hht+"px"; p.scrollTop=pos; } } function h9k_scrollbar_mousemove(ev) { if (!ev) { ev=window.event; } ev.cancelBubble=true; if (ev.stopPropagation) { ev.stopPropagation(); } var d=ev.clientY-_h9k_dragy; h9k_scrollbar_setscroll(_h9k_dragid,d,"scroll"); } function h9k_scrollbar_mouseup(ev) { document.onmouseup=_h9k_oldmouseup; _h9k_oldmouseup=null; document.onmousemove=_h9k_oldmousemove; _h9k_oldmousemove=null; document.onselectstart=_h9k_oldselectstart; _h9k_oldselectstart=null; document.documentElement.style.cursor=_h9k_oldcursor; _h9k_oldcursor=null; _h9k_dragid=null; _h9k_dragys=0; } function h9k_scrollbar_remove(mid) { var p=getElement(mid); if (!p) { return; } var pp=getElement(mid+"_scrollbar"); if (!pp) { return; } p.scrollTop=0; // h9k_scrollbar_setscroll(mid,0,"click"); h9k_scrollbar_hide(mid); if (p.removeEventListener) { p.removeEventListener('DOMMouseScroll', h9k_scrollbar_onwheel, false); } p.onmousewheel=null; p.parentNode.parentNode.removeChild(pp); } function h9k_scrollbar_add(mid) { var p=getElement(mid); if (!p) { return; } var pp=getElement(mid+"_scrollbar"); if (pp) { h9k_scrollbar_setscroll(mid,0,"delta"); return; } if (p.addEventListener) { p.addEventListener('DOMMouseScroll', h9k_scrollbar_onwheel, false); } p.onmousewheel=h9k_scrollbar_onwheel; var posx=p.parentNode.offsetLeft+p.parentNode.offsetWidth; if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ posx-=8; } var posy=p.parentNode.offsetTop+1; // Add a scrollbar... var md=document.createElement("div"); setstyle(md,"-moz-user-select: none; display: none; overflow: hidden; position: absolute; left: "+posx+"px; top: "+posy+"px; height: 0px; width: 20px;"); md.setAttribute('id',p.id+"_scrollbar"); md.ondragstart=function() { return false; } md.onmousedown=function() { return false; } md.onselectstart=function() { return false; } if (md.addEventListener) { // Ops, when moved into site and poped it on the outside, this fix is needed for FF also :( md.addEventListener('DOMMouseScroll', h9k_scrollbar_onwheel2, false); } md.onmousewheel=function(ev) { // IE dont do the normal event, just make a fake one so everyone will be happy if (!ev) { ev=window.event; } ev.cancelBubble=true; if (ev.stopPropagation) { ev.stopPropagation(); } evv=new Object; evv.wheelDelta=ev.wheelDelta; evv.detail=ev.detail; evv.currentTarget=getElement(p.id); h9k_scrollbar_onwheel(evv); }; md.onclick=function(ev) { if (!ev) { ev=window.event; } var y=-1; if (ev.offsetY) { y=ev.offsetY; } if (ev.layerY) { y=ev.layerY; } h9k_scrollbar_setscroll(p.id,y,"click"); }; var ed=document.createElement("div"); setstyle(ed, "border: solid black 1px; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -o-border-radius: 4px; -khtml-border-radius: 4px; background: url('/common/menu/50black.png'); overflow: hidden; position: absolute; top: 12px; left: 4px; height: 0px; width: 12px; color: red;"); ed.setAttribute('id',p.id+"_scrollbar_handle"); ed.onmousedown=function(ev) { if (!ev) { ev=window.event; } ev.cancelBubble=true; if (ev.stopPropagation) { ev.stopPropagation(); } _h9k_oldmouseup=document.onmouseup; document.onmouseup=h9k_scrollbar_mouseup; _h9k_oldmousemove=document.onmousemove; document.onmousemove=h9k_scrollbar_mousemove; _h9k_oldselectstart=document.onselectstart; document.onselectstart=returnfalse; _h9k_oldcursor=document.documentElement.style.cursor; document.documentElement.style.cursor='s-resize'; if (!_h9k_oldcursor) { _h9k_oldcursor=""; } if (_h9k_oldcursor=="") { _h9k_oldcursor="auto"; } _h9k_dragys=extractnumber(getElement(p.id).scrollTop); _h9k_dragy=ev.clientY; _h9k_dragid=p.id; return false; }; ed.onclick=function(ev) { if (!ev) { ev=window.event; } ev.cancelBubble=true; if (ev.stopPropagation) { ev.stopPropagation(); } } ei=document.createElement("img"); setstyle(ei,'position: absolute; top: 50%; margin-top: -5px; height: 10px; width: 12px;'); ei.setAttribute('src','/common/menu/scrollbar_hmark.png'); ed.appendChild(ei); md.appendChild(ed); p.parentNode.parentNode.appendChild(md); setTimeout('h9k_scrollbar_setscroll("'+(p.id)+'",0,"delta")',1); } var old_sizex=0; var old_sizey=0; var stopall=1; function resetpos() { var p=getElement("boxes"); var x=0; var y=0; if (typeof( window.innerWidth) == 'number' ){ x=window.innerWidth; y=window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { x = document.documentElement.clientWidth; y = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { x = document.body.clientWidth; y = document.body.clientHeight; } if (x!=old_sizex || y!=old_sizey) { old_sizex=x; old_sizey=y; p.style.left=Math.max(0,((x-1100)*0.5)); p.style.top=Math.max(0,((y-620)*0.5)); setTimeout(resetpos,100); } } var current_background=""; var boxes=[]; var boxdir=1; var new_page=""; var page_output=""; var page_timer; function activatepage() { var m1=getElement("loadmenu"); var m2=getElement("realmenu"); m1.style.display="none"; m2.style.display="block"; showpage(new_page); setInterval(scanlocation, 50); } function showpage(page) { document.location="#"+page; } var oldlocation=""; function scanlocation() { if (location.hash != oldlocation) { clearTimeout(page_timer); boxdir=0; slidenow=-1; popupclose(); stopall=1; GetGlobalDelta(); if (document.h9k.ongetchange && document.h9k.ongetchange!=undefined){ var preget_old=oldlocation.split("?"); var preget_new=location.hash.split("?"); if (preget_new && preget_old){ if (preget_new[0] && preget_old[0]){ if (preget_new[0]==preget_old[0]) { if (preget_new[1]){ if (preget_new[1]==undefined){ preget_new[1]=""; } } else { preget_new[1]=""; } oldlocation=location.hash; document.h9k.ongetchange(preget_new[1]); return; } } } } oldlocation=location.hash; new_page=oldlocation.substr(1); if (document.h9k.shutdown && document.h9k.shutdown!=undefined){ document.h9k.shutdown(); } GetGlobalDelta(); setTimeout("StartBoxHide(0)",100); } } function showpage_old(page) { clearTimeout(page_timer); boxdir=0; slidenow=-1; new_page=page; popupclose(); setTimeout("StartBoxHide(0)",100); } function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } var xmlhttp=null; function loadpage() { if (xmlhttp) { xmlhttp.abort(); } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { // Ops! alert("You dont support Ajax... we must fix this..."); return false; } var geturl=getpageurl(new_page); // alert("Loading"+geturl); xmlhttp.onreadystatechange=ajax_stateChanged; xmlhttp.open("GET",geturl,true); xmlhttp.send(null); page_timer=setTimeout(ShowPageloadingtext,4000); // startpage(new_page); // slideimage(); // StartBoxShow(); } function ShowPageloadingtext() { var p=getElement("pageloadingtext"); if (p) { p.style.display="inline"; } } function ajax_stateChanged() { if (xmlhttp.readyState==4) { clearTimeout(page_timer); var p=getElement("pageloadingtext"); if (p) { p.style.display="none"; } if (xmlhttp.status==200) { var p=getElement("preparse"); p.innerHTML=xmlhttp.responseText; setTimeout("parsepagetoboxes(0)",50); } else if (xmlhttp.status==0) { // Aborted request, skip this... } else { var out; out ='
'; out+='
'; out+='HTTP Responce: '+xmlhttp.status+' Sorry, but can\'t load this page.'; out+='
'; var p=getElement("preparse"); p.innerHTML=out; setTimeout("parsepagetoboxes(0)",50); } } } function getpageurl(page) { var p="/site/pages/news.php"; var sp=page.split("?"); if (sp[0]=="news") { p="/site/pages/news.php"; } else if (sp[0]=="news2") { p="/site/pages/news2.php"; } else if (sp[0]=="band") { p="/site/pages/the band.php"; } else if (sp[0]=="gigs") { p="/site/pages/the gigs.php"; } else if (sp[0]=="records") { p="/site/pages/the records.php"; } else if (sp[0]=="record") { p="/site/pages/records.php"; } else if (sp[0]=="videos") { p="/site/pages/the videos.php"; } else if (sp[0]=="pics") { p="/site/pages/the pics.php"; } else if (sp[0]=="shop") { p="/site/pages/the shop.php"; } if (sp.length==2){ p+="?"+sp[1]; } return p; } function parsepagetoboxes(inp) { boxes=[]; var p=getElement("preparse"); // We need to clear this... var p2=getElement("boxesmain"); // Get inner first div for (var i=0;i1) { size=1; } if (size<0) { size=0; } var p=getElement("real_"+smth); if (!p) { return; } var x=boxes[smth]["x"]; var y=boxes[smth]["y"]; var w=boxes[smth]["w"]; var h=boxes[smth]["h"]; var how=boxes[smth]["how"].split("_"); if (how[0]=="move") { // ------------MOVE------------------- var cx=x; var cy=y; var p2=getElement(smth); if (how[1]=="right") { cx+=((1100-x)*(1-size)); if ((cx+w)>=1100) { w=1101-cx; } } if (how[1]=="left") { cx-=((x+w)*(1-size)); if (cx<0) { p2.style.left=cx; w+=cx; cx=0; } else { p2.style.left=0; } } if (how[1]=="down") { cy+=Math.floor(((574-y)*(1-size))); if ((cy+h)>574) { h=574-cy; } } if (how[1]=="up") { cy-=Math.floor(((y+w+6)*(1-size))); if (cy<26){ p2.style.top=(cy-26); h+=(cy-26); cy=26; } else { p2.style.top=0; } } p.style.left=cx; p.style.top=cy; if (w<0) { w=0; } if (h<0) { h=0; } p.style.width=w; p.style.height=h; } else if (how[0]=="glide") { // ------------GLIDE------------------ orgs=how[1].split(":"); var ox=parseInt(orgs[0]); var oy=parseInt(orgs[1]); var ow=parseInt(orgs[2]); var oh=parseInt(orgs[3]); var nx=parseInt(x+((ox-x)*size)); var ny=parseInt(y+((oy-y)*size)); var nw=parseInt(w+((ow-w)*size)); var nh=parseInt(h+((oh-h)*size)); p.style.left=nx; p.style.top=ny; p.style.width=nw; p.style.height=nh; } else if (how[0]=="autosize") { // ------------AUTOSIZE--------------- var p2=getElement(smth+"_autosize"); var p3=getElement(smth); if (how[1]=="y") { var wh=p2.offsetHeight+12; if (wh>=h) { wh=h; h9k_scrollbar_add(smth);//p3.style.overflow="auto"; } else { h9k_scrollbar_remove(smth);//p3.style.overflow="hidden"; } h=wh; h=Math.floor(h*size); if (h>6) { p3.style.height=h-6; } else { p3.style.height=0; } } else if (how[1]=="y2") { var wh=p2.offsetHeight+6; if (wh>=h) { wh=h; h9k_scrollbar_add(smth);//p3.style.overflow="auto"; } else { h9k_scrollbar_remove(smth);//p3.style.overflow="hidden"; } var th=wh; th=Math.floor(th*size); if (th>6) { p3.style.height=th-6; } else { p3.style.height=0; } y+=(h-th); h=th; } else if (how[1]=="x") { var ww=p2.offsetWidth+6; if (ww>=w) { ww=w; p3.style.overflow="auto"; } else { p3.style.overflow="hidden"; } w=ww; w=Math.floor(w*size); if (w>6) { p3.style.width=w-6; } else { p3.style.width=0; } } p.style.left=x; p.style.top=y; p.style.width=w; p.style.height=h; h9k_scrollbar_setscroll(smth,0,"delta"); } else if (how[0]=="zoom") { // ------------ZOOM------------------- var p2=getElement(smth); if (how[1]==undefined) { how[1]='xy'; } if (how[1]=='yx') { how[1]='xy'; } var cx=x; var nw=w; var cy=y; var nh=h; if (how[1]=='x' || how[1]=='xy') { cx=x+(w*0.5); nw=w*size; cx-=(nw*0.5); p2.style.left=-((w-nw)*0.5); } if (how[1]=='y' || how[1]=='xy') { cy=y+(h*0.5); nh=h*size; cy-=(nh*0.5); p2.style.top=-((h-nh)*0.5); } p.style.left=cx; p.style.top=cy; p.style.width=nw; p.style.height=nh; } else if (how[0]=="fade") { // ------------FADE------------------- var op=0; if (size>0.5) { // op=(size-0.5)*2; } else { // op=0; } op=size; if (p.filters && p.filters.alpha){ p.filters.alpha.opacity=op*100; } else if (p.style.opacity) { p.style.opacity=op; } p.style.left=x; p.style.top=y; p.style.width=w; p.style.height=h; } } function doautosize(smth) { var p=getElement("real_"+smth); if (!p) { return; } var x=boxes[smth]["x"]; var y=boxes[smth]["y"]; var w=boxes[smth]["w"]; var h=boxes[smth]["h"]; var how=boxes[smth]["how"].split("_"); if (how[0]=="autosize") { var nh=h; var nw=w; var nx=x; var ny=y; var p2=getElement(smth+"_autosize"); var p3=getElement(smth); if (how[1]=="y") { var wh=p2.offsetHeight+12; if (wh>=h) { wh=h; h9k_scrollbar_add(smth);//p3.style.overflow="auto"; } else { h9k_scrollbar_remove(smth);//p3.style.overflow="hidden"; } var nh=parseInt(p.style.height); if (wh>nh) { nh+=20; if (nh>wh) { nh=wh; } else { setTimeout("doautosize('"+smth+"')",50); } } else if (wh=h) { wh=h; h9k_scrollbar_add(smth);//p3.style.overflow="auto"; } else { h9k_scrollbar_remove(smth);//p3.style.overflow="hidden"; } var nh=parseInt(p.style.height); if (wh>nh) { nh+=20; if (nh>wh) { nh=wh; } else { setTimeout("doautosize('"+smth+"')",50); } } else if (wh=w) { ww=w; p3.style.overflow="auto"; } else { p3.style.overflow="hidden"; } var nw=parseInt(p.style.width); if (ww>nw) { nw+=20; if (nw>ww) { nw=ww; } else { setTimeout("doautosize('"+smth+"')",50); } } else if (ww1) { boxes[smth]["now"]=1; } else { d=0; } SizeBox(smth); } if (boxdir==-1){ // Vi ska minska boxes[smth]["now"]-=(deltatid*movespeed); if (boxes[smth]["now"]<0) { boxes[smth]["now"]=0; } else { d=0; } SizeBox(smth); } } if (d==0) { clearTimeout(page_timer); page_timer=setTimeout("ShowBoxes("+inp+")",50); } else { if (boxdir==-1) { if (inp && inp!=undefined && inp!=0){ if (document.h9k.onputpage && document.h9k.onputpage!=undefined){ boxdir=0; document.h9k.onputpage(inp); return; } } setupcoverpage(); //------------------ LOAD IT!!!!!! ------------------ loadpage(); } boxdir=0; } } function setupcoverpage() { boxes=[]; var p=getElement("boxesmain"); var bg=p.style.background.split(")")[0].split("(")[1]; if (bg.charAt(0)=='"' || bg.charAt(0)=="'") { bg=bg.substr(1,bg.length-2); } var out='
'; if (document.h9k.fakecoveradd && document.h9k.fakecoveradd!=undefined) { out+=document.h9k.fakecoveradd; } out+='
'; p.innerHTML=out; } var slidenow=0; function slideimage() { slidenow=0; clearTimeout(page_timer); if (document.h9k.startup && document.h9k.startup!=undefined){ document.h9k.startup(); } stopall=0; GetGlobalDelta(); page_timer=setTimeout(slideimagenow,10); } function slideimagenow() { var deltatid=GetGlobalDelta(); if (slidenow==-1) { return; } var p=getElement("boxesmain2"); slidenow+=deltatid*fadespeed; if (p.filters && p.filters.alpha){ p.filters.alpha.opacity=100-slidenow; } else if (p.style.opacity) { p.style.opacity=(100-slidenow)/100; } if (slidenow<100){ clearTimeout(page_timer); page_timer=setTimeout(slideimagenow,50); } else { StartBoxShow(); } } function showit(what) { var hm=""; for (smth in what) { hm+=smth+" = "+what[smth]+"\n"; } alert(hm); } function openpopupmenu(menud,contd) { pid=getElement('popup'); piid=getElement('popup_inner'); miid=getElement('popup_menu'); if (pid && piid && miid) { piid.innerHTML=contd; miid.innerHTML=menud; miid.style.display="block"; pid.style.top=(old_sizey-410)*0.5; pid.style.left=(old_sizex-605)*0.5; pid.style.display='inline'; var pik=getElement('popupkiller'); if (pik) { pik.style.display="inline"; } } } function openpopup(contid) { pid=getElement('popup'); piid=getElement('popup_inner'); miid=getElement('popup_menu'); cid=getElement(contid); if (pid && piid && miid && cid && cid.innerHTML) { miid.innerHTML=""; piid.innerHTML=cid.innerHTML; miid.style.display="none"; pid.style.top=(old_sizey-410)*0.5; pid.style.left=(old_sizex-605)*0.5; pid.style.display='inline'; var pik=getElement('popupkiller'); if (pik) { pik.style.display="inline"; } } } function popupclose() { getElement('popup').style.display='none'; var pik=getElement('popupkiller'); if (pik) { pik.style.display="none"; } } function openpopupdata(cont) { pid=getElement('popup'); piid=getElement('popup_inner'); miid=getElement('popup_menu'); if (pid && piid && miid) { miid.innerHTML=""; piid.innerHTML=cont; miid.style.display="none"; pid.style.top=(old_sizey-410)*0.5; pid.style.left=(old_sizex-605)*0.5; pid.style.display='inline'; var pik=getElement('popupkiller'); if (pik) { pik.style.display="inline"; } } } function popupshow(nr) { var p=getElement("popup_menu"); for (var i=0;i