/**
* SRAX Anchor Mix v0.8 beta (build 7)
* Mix of AJAX & Standard Anchors - MASA
* http://www.fullajax.ru
* Copyright(c) 2008-2009, Ruslan Sinitskiy.
* http://fullajax.ru/#:license
**/
(function(E){var F=E.Default;F.ANCHOR={ANIM_SCROLL:1,RECURSIVE:0,prefix:"anchor",id:"_GLOBAL_"};var G=function(H){H=E.get(H);var D=0,I=0;while(H){D+=H.offsetLeft;I+=H.offsetTop;H=H.offsetParent}return{x:D,y:I}};function B(D,K,P){if(!F.ANCHOR.RECURSIVE){var M=G(D).y-document.body.scrollTop;var J=M&&F.ANCHOR.ANIM_SCROLL?10:1;M/=J;var H=setInterval(function(){scrollBy(0,M);if(!--J){clearInterval(H)}},100/J);return }if(!D||!D.parentNode){return }var L=D.parentNode;var O=G(L).y;var M=G(D).y-O+K;M-=L.scrollTop;var J=M&&F.ANCHOR.ANIM_SCROLL?10:1,I=M;M/=J;L.anim=setInterval(function(){L.scrollTop+=M;if(!--J){clearInterval(L.anim);if(L.parentNode){var N=I-L.scrollTop;B(L,N)}}},100/J)}function A(H,K,L){var J=E.get(H);if(!J){var D=document.getElementsByName(H);for(var I=0;I<D.length;I++){if(D[I].nodeName=="A"){J=D[I]}}}if(J){B(J,0,1);if(K){E.History.add(L||F.ANCHOR.id,H,F.ANCHOR.prefix)}return false}}E.Filter.on("beforewrap",function(I){var H=I.el;if(H.nodeName=="A"&&!H.anchored){var D=E.parseUri(H.href).anchor;if(D){H.onclick=function(){var K;if(H.options){K=H.options.id;H.href=H.href.replace("#"+D,"#:"+F.ANCHOR.prefix+":"+K+":"+D)}else{K=I.layer==document?null:I.layer.id}var J=I.ops?!I.ops.nohistory:1;return A(D,J,K)};H.anchored=1}}});var C=function(I){var K=E.getHash();var J=E.parseAxHash(E.History.previous,F.ANCHOR.prefix);var H=E.parseAxHash(K,F.ANCHOR.prefix);for(var L in H){var D=H[L];if(I?I.id==L:J[L]!=D){A(D)}}};E.linkEqual[F.ANCHOR.prefix+":"+F.ANCHOR.id+":"]="$";E.onReady(function(){E.History.prefixListener[F.ANCHOR.prefix]=C;C({id:F.ANCHOR.id});E.Html.onall("load",C);E.History.on("beforeadd",function(D){var H=D.hash.replaceAll("#:",":");if(!H.startWith("#")){H="#"+H}return H})})})(SRAX);