var c_mainImgW=478,c_mainImgH=256,c_mainImgOpacity=0.6,c_width=800,c_height=400,c_fadeDur=1500,c_offsets=[[0.048,0.005],[0.119,0.125],[0.073,0.245]],c_hFudgePx=10,c_vFudgePx=5,c_imgScale=0.875,haveCanvas=document.createElement("canvas").getContext,isIE=!window.addEventListener;function pageSetup(){try{gebi("sb_form_q").focus()}catch(e){}SB_FH.init();ILP.init();window.onresize=SB_FH.railResize;var imgs=gebt("img",gebi("sw_main"));for(var i=0;i<imgs.length;i++){var img=imgs[i];if(img.getAttribute("_src"))img.src=img.getAttribute("_src")}}ILP={init:function(){var me=ILP;if(!me.cont){me.cont=gebi("imageSearch");me.groups=gebc("ilp_grp");for(var i=0;i<me.groups.length;i++){var group=me.groups[i],links=gebt("a",group);if(links&&links.length>0){var omd=links[0].onmousedown;for(var j=1;j<links.length;j++)if(!links[j].onmousedown)links[j].onmousedown=omd}me.fadeInGroupLink(group,i);group.onmouseover=new Function("ILP.highlight("+i+");");group.onmouseout=new Function("ILP.highlight(null);")}}},getGroups:function(){if(!ILP.groups)ILP.init();return ILP.groups},loadMainImage:function(img){var me=ILP;gebt("img",img)[0].onload=null;img.firstChild.className="ilp_ld";img.style.position="absolute";x=c_width/2-img.offsetWidth/2;y=c_height/2-img.offsetHeight/2;img.style.left=x+"px";img.style.top=y+"px";opacity(img,0);img.style.visibility="visible";me.loadRefl();animate(function(t){opacity(img,t*c_mainImgOpacity);if(ILP.refl)opacity(ILP.refl,t*(c_mainImgOpacity-0.2))},c_fadeDur)},loadRefl:function(){var me=ILP;if(haveCanvas){var mainImgCont=gebi("ilp_main"),img=gebt("img",mainImgCont)[0],canvas=dce("canvas");canvas.width=mainImgCont.offsetWidth;canvas.height=mainImgCont.offsetHeight;canvas.style.position=mainImgCont.style.position;canvas.style.top=mainImgCont.style.top;canvas.style.left=mainImgCont.style.left;canvas.style.marginTop=mainImgCont.offsetHeight-1+"px";opacity(canvas,0);var ctx=canvas.getContext("2d");ctx.strokeStyle="#999";ctx.fillStyle="#fff";ctx.fillRect(0,0,canvas.width,canvas.height);ctx.strokeRect(0,0,canvas.width,canvas.height);ctx.save();ctx.translate(0,canvas.height+5);ctx.scale(0.5,-0.5);ctx.drawImage(img,0,0,2*img.width,2*img.height-47,10,10,2*(canvas.width-10),2*canvas.height-10);ctx.restore();ctx.globalCompositeOperation="destination-out";var grad=ctx.createLinearGradient(0,0,0,0.25*canvas.height);grad.addColorStop(1,"rgba(255, 255, 255, 1.0)");grad.addColorStop(0,"rgba(255, 255, 255, 0.2)");ctx.fillStyle=grad;ctx.rect(0,0,canvas.width,canvas.height);ctx.fill();me.cont.appendChild(canvas);me.refl=canvas}else{refl=gebi("ilp_main").cloneNode(true);refl.style.marginTop=gebi("ilp_main").offsetHeight-1+"px";refl.style.filter="FlipV progid:DXImageTransform.Microsoft.Alpha(opacity=0, style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy=25)";refl.id="ilp_main_refl";gebi("imageSearch").appendChild(refl);me.refl=refl}},fadeInGroupLink:function(group,i){var me=ILP,link=group.firstChild;if(isIE){var clone=link.cloneNode(true);clone.style.display="none";clone.style.visibility="visible";clone.style.background="transparent";link.parentNode.insertBefore(clone,link.nextSibling)}opacity(link,0);link.style.visibility="visible";animate(function(t){opacity(me.getGroups()[i].firstChild,t)},c_fadeDur,function(){if(isIE){var node=me.getGroups()[i].firstChild;node.nextSibling.style.display="inline";node.parentNode.removeChild(node)}})},loadImage:function(img,imgIndex){var me=ILP,quadStr=img.parentNode.parentNode.className,quad=parseInt(quadStr.substring(quadStr.length-1));if(isNaN(quad))return;var loadFunc=haveCanvas?me.loadImageCanvas:me.loadImageIE,el=loadFunc(img,imgIndex,quad);animate(function(t){el.style.opacity=t;if(el.filters)el.filters.item(1).opacity=t*100},c_fadeDur)},positionImage:function(img,imgIndex,quad){var vertPos=quad<2?"top":"bottom",horzPos=quad%2==0?"left":"right",hFudge=Math.floor(Math.random()*c_hFudgePx),vFudge=Math.floor(Math.random()*c_vFudgePx);img.style[vertPos]=c_height*c_offsets[imgIndex][0]+vFudge+"px";img.style[horzPos]=c_width*c_offsets[imgIndex][1]+hFudge+"px"},loadImageIE:function(img,imgIndex,quad){var me=ILP;me.positionImage(img,imgIndex,quad);opacity(img,0);img.parentNode.className="ilp_ld";img.style.filter="progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand') progid:DXImageTransform.Microsoft.Alpha(opacity=0)";img.style.opacity=0;rad=Math.random()*0.15-0.075;costheta=Math.cos(rad);sintheta=Math.sin(rad);if(img.filters){img.filters.item(0).M11=costheta;img.filters.item(0).M12=-sintheta;img.filters.item(0).M21=sintheta;img.filters.item(0).M22=costheta}return img},loadImageCanvas:function(img,imgIndex,quad){var me=ILP,imgWidth=Math.floor(img.width*c_imgScale),imgHeight=Math.floor(img.height*c_imgScale);img.style.display="none";var canvas=dce("canvas");canvas.width=imgWidth+40;canvas.height=imgHeight+40;me.positionImage(canvas,imgIndex,quad);var canvas2=canvas.cloneNode(true);canvas2.className="c_hl";img.parentNode.appendChild(canvas);img.parentNode.appendChild(canvas2);var rotation=Math.random()*0.15-0.075,drawImg=function(ctx,rot,doubleBorder){ctx.rotate(rot);ctx.strokeStyle="#999";ctx.fillStyle="#fff";ctx.fillRect(15,15,imgWidth+10,imgHeight+10);ctx.strokeRect(15,15,imgWidth+10,imgHeight+10);if(doubleBorder)ctx.strokeRect(14,14,imgWidth+12,imgHeight+12);ctx.drawImage(img,20,20,imgWidth,imgHeight)};drawImg(canvas.getContext("2d"),rotation,false);drawImg(canvas2.getContext("2d"),rotation,true);opacity(canvas,0);return canvas},highlight:function(groupIndex){var me=ILP,groups=me.getGroups(),group=groups[groupIndex];for(var i=0;i<groups.length;i++){var g=groups[i];if(g==group){if(!g.className.match(/ ilp_grp_over/))g.className+=" ilp_grp_over"}else g.className=g.className.replace(/ ilp_grp_over/,"")}}};function ild(img,i){opacity(img,0);img.parentNode.className="ilp_ld";ILP.loadImage(img,i)}function ild_main(img){ILP.loadMainImage(img.parentNode.parentNode)}function dims(el,parent){d={};d.top=el.offsetTop;d.left=el.offsetLeft;d.width=el.offsetWidth;d.height=el.offsetHeight;d.scrollLeft=el.offsetParent?el.offsetParent.scrollLeft:0;d.scrollTop=el.offsetParent?el.offsetParent.scrollTop:0;d.relTop=d.relLeft=0;parent=parent||document.body;while(el&&el.offsetParent){d.relTop+=el.offsetTop;d.relLeft+=el.offsetLeft;if(el.offsetParent==parent)break;else el=el.offsetParent}return d}function opacity(el,lv){if(el.filters)try{var o=el.filters.item("DXImageTransform.Microsoft.Alpha");o.opacity=lv*100}catch(e){el.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+lv*100+")"}el.style.opacity=lv}function gebi(id,node){if(node==null)node=document;return node.getElementById(id)}function gebt(tag,node){if(node==null)node=document;return node.getElementsByTagName(tag)}function gebc(cl,node,tag){if(node==null)node=document;if(tag==null)tag="*";var els=new Array,tags=gebt(tag,node),tcl=" "+cl+" ",i,j;for(i=0,j=0;i<tags.length;i++){var test=" "+tags[i].className+" ";if(test.indexOf(tcl)!=-1)els[j++]=tags[i]}return els}function dce(t,cls,id){var el=document.createElement(t);if(cls)el.className=cls;if(id)el.id=id;return el}function eventCancel(e){if(!e)e=window.event;if(e){e.cancelBubble=true;if(!isIE){e.stopPropagation();e.preventDefault()}}}function eventAttach(ev,fcn,el){if(!el)el=window;if(el.attachEvent)el.attachEvent("on"+ev,fcn);else if(el.addEventListener)el.addEventListener(ev,fcn,false)}function eventDetach(event,fcn,el){if(!el)el=window;if(el.detachEvent)el.detachEvent("on"+event,fcn);else if(el.removeEventListener)el.removeEventListener(event,fcn,false)}function animate(callback,duration,after){if(duration==null)duration=1000;var t={};t.start=(new Date).getTime();t.end=t.start+duration;t.after=after;t.timerId=setInterval(function(){var now=(new Date).getTime(),linearPos=1-(t.end-now)/(t.end-t.start);if(linearPos>1)linearPos=1;var pos=linearPos;callback(pos);if(now>=t.end){clearInterval(t.timerId);if(t.after!=null)setTimeout(t.after,1)}},16);return t}function cancelAnim(timer){if(timer&&timer.timerId)clearInterval(timer.timerId)}function MM_si_T(a){if(document.images){var IGqs=a.match(/&IG=/)?"":"&IG="+_G.IG;(new Image).src=_G.gpUrl+IGqs+a}return true}SB_FH={init:function(ol){var me=SB_FH;me.main=gebi("sw_main");me.expPane=gebi("sc_expPane");me.nav=gebi("sw_nav");me.overlay=ol;if(me.active()){if(me.expPane){eventAttach("mouseover",SB_FH.ep_over,me.expPane);eventAttach("mouseout",SB_FH.ep_out,me.expPane)}me.railResize()}},active:function(){return SB_FH.main},railResize:function(){var me=SB_FH;if(me.active()){var h=Math.max(document.documentElement.offsetHeight-me.main.offsetTop-28,460);me.main.style.height=h+"px";var tocDims=dims(me.nav);if(me.expPane){h=Math.max(document.documentElement.offsetHeight-tocDims.height-tocDims.relTop-1,0);me.expPane.style.height=h+"px";if(me.overlay){me.overlay.style.height=me.expPane.style.height;me.overlay.style.top=tocDims.height+"px"}}}},ep_over:function(event){var me=SB_FH;if(me.expPane.className!="sc_scrl")me.expPane.className="sc_scrl";return false},ep_out:function(event){var me=SB_FH;event=event||window.event;var to=event.toElement?event.toElement:event.relatedTarget;while(to&&to.parentNode){if(to.id=="sc_expPane")return false;to=to.parentNode}var st=me.expPane.scrollTop;me.expPane.className="";me.expPane.scrollTop=st;return false}}