// JavaScript Document
/* Horizontal Scroll by Marco Rosella http://www.centralscrutinizer.it/en/design/js-php/horizontal-tiny-scrolling */

window.onload=function(){HtinyScrolling.init();scrollTips.init()};var HtinyScrolling={speed:50,maxStep:150,brakeK:3,hash:null,currentBlock:null,requestedX:0,init:function(){var B=document.getElementsByTagName("a");for(var A=0,C;C=B[A];A++){if((C.href&&C.href.indexOf("#")!=-1)&&((C.pathname==location.pathname)||("/"+C.pathname==location.pathname))&&(C.search==location.search)){C.onclick=this.initScroll}}},getElementXpos:function(B){var A=0;while(B.offsetParent){A+=B.offsetLeft;B=B.offsetParent}return A},getScrollLeft:function(){if(document.all){return(document.documentElement.scrollLeft)?document.documentElement.scrollLeft:document.body.scrollLeft}else{return window.pageXOffset}},getWindowWidth:function(){if(window.innerWidth){return window.innerWidth}if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth}},getDocumentWidth:function(){if(document.width){return document.width}if(document.body.offsetWidth){return document.body.offsetWidth}},initScroll:function(B){var A;if(!B){var B=window.event}if(B.target){A=B.target}else{if(B.srcElement){A=B.srcElement}}HtinyScrolling.hash=A.href.substr(A.href.indexOf("#")+1,A.href.length);HtinyScrolling.currentBlock=document.getElementById(HtinyScrolling.hash);if(!HtinyScrolling.currentBlock){return }HtinyScrolling.requestedX=HtinyScrolling.getElementXpos(HtinyScrolling.currentBlock);HtinyScrolling.scroll(A);return false},scroll:function(A){var C=HtinyScrolling.getScrollLeft();if(HtinyScrolling.requestedX>C){var B=Math.round((HtinyScrolling.getDocumentWidth()-(C+HtinyScrolling.getWindowWidth()))/HtinyScrolling.brakeK);B=Math.min(Math.round((HtinyScrolling.requestedX-C)/HtinyScrolling.brakeK),B);var D=Math.max(2,Math.min(B,HtinyScrolling.maxStep))}else{var D=-Math.min(Math.abs(Math.round((HtinyScrolling.requestedX-C)/HtinyScrolling.brakeK)),HtinyScrolling.maxStep)}window.scrollTo(C+D,0);if(Math.abs(C-HtinyScrolling.requestedX)<=1||HtinyScrolling.getScrollLeft()==C){window.scrollTo(HtinyScrolling.requestedX,0);if(typeof XULDocument!="undefined"){location.hash=HtinyScrolling.hash}if(window.opera){mark.change_colors(HtinyScrolling.hash,30,3500,"#aaaaaa","#fffbea")}mark.change_opacity(HtinyScrolling.hash);HtinyScrolling.hash=null}else{setTimeout(HtinyScrolling.scroll,HtinyScrolling.speed)}}};var scrollTips={dx:null,init:function(){if(window.addEventListener){window.addEventListener("DOMMouseScroll",this.mouseScroll,false)}else{window.onmousewheel=document.onmousewheel=this.mouseScroll}var A=document.getElementById("right-arrow");A.onmouseover=function(){this.dx=setInterval("scrollTips.arrowScroll(1)",100);return false};A.onmouseout=function(){clearInterval(this.dx);return false};var B=document.getElementById("left-arrow");B.onmouseover=function(){this.dx=setInterval("scrollTips.arrowScroll(0)",100);return false};B.onmouseout=function(){clearInterval(this.dx);return false}},mouseScroll:function(A){if(!A){var A=window.event}if(window.opera){delta=event.wheelDelta/120;delta=-delta}if(A.wheelDelta<=0||A.detail>=0){window.scrollBy(80,0)}else{window.scrollBy(-80,0)}},arrowScroll:function(A){if(A==1){window.scrollBy(70,0)}else{window.scrollBy(-70,0)}}};var mark={valop:100,req:0,make_hex:function(C,B,A){C=C.toString(16);if(C.length==1){C="0"+C}B=B.toString(16);if(B.length==1){B="0"+B}A=A.toString(16);if(A.length==1){A="0"+A}return"#"+C+B+A},change_colors:function(J,B,A,L,C){var F=Math.round(B*(A/1000));var O=A/F;var S=O;var G=0;if(L.length<7){L+=L.substr(1,3)}if(C.length<7){C+=C.substr(1,3)}var K=parseInt(L.substr(1,2),16);var Q=parseInt(L.substr(3,2),16);var D=parseInt(L.substr(5,2),16);var E=parseInt(C.substr(1,2),16);var I=parseInt(C.substr(3,2),16);var P=parseInt(C.substr(5,2),16);var H,N,R,M;while(G<F){H=Math.floor(K*((F-G)/F)+E*(G/F));N=Math.floor(Q*((F-G)/F)+I*(G/F));R=Math.floor(D*((F-G)/F)+P*(G/F));M=this.make_hex(H,N,R);setTimeout("mark.set_img_bgcolor('"+J+"','"+M+"')",S);G++;S=O*G}setTimeout("mark.set_img_bgcolor('"+J+"','"+C+"')",S)},set_img_bgcolor:function(C,B){if(document.getElementById(C).getElementsByTagName("img")[0]){var A=document.getElementById(C).getElementsByTagName("img")[0];A.style.backgroundColor=B}else{return }},get_img_bgcolor:function(D){var B=document.getElementById(D).getElementsByTagName("img")[0];while(B){var C;if(window.getComputedStyle){C=window.getComputedStyle(B,null).getPropertyValue("background-color")}if(B.currentStyle){C=B.currentStyle.backgroundColor}if((C!=""&&C!="transparent")||B.tagName=="BODY"){break}B=B.parentNode}if(C==undefined||C==""||C=="transparent"){C="#FFFFFF"}var A=C.match(/rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/);if(A){C=this.make_hex(parseInt(A[1]),parseInt(A[2]),parseInt(A[3]))}return C},change_opacity:function(B){if(/^post/.test(B)){var A=document.getElementById(B);if(mark.valop>10&&mark.req==0){mark.valop-=10;mark.set_opacity(A,mark.valop);if(mark.valop==10){mark.req=1}}else{if(mark.valop<100&&mark.req==1){mark.valop+=10;mark.set_opacity(A,mark.valop);if(mark.valop==100){mark.req=2}}}if(mark.req!=2){setTimeout("mark.change_opacity('"+B+"')",50)}else{mark.set_opacity(A,9999);mark.req=0;return }}},set_opacity:function(A,B){A.style.opacity="0."+B;A.style.filter="alpha(opacity="+B+")"}};

// The Arrows
document.writeln('<a href="javascript://" id="left-arrow"></a>\n<a href="javascript://" id="right-arrow"></a>');
