var seadragonViewer,seadragonViewerContainer,backgroundImages=["bghome-newproducts2012-3","bghome-bluesky","bghome-valentines2012","bghome-dom-feb2012","bghome-r8-2","bghome-watch"],backgroundTexts=["<div id='content01' class='story-item' style='width: 640px; bottom: 120px; left: 230px;'><h1 class='highlight' style='color:#ED1E24'>Update Now!</h1><h1>2012.3 Versions Released</h1><p>Bunkspeed\u2019s product line matures with the 2012.3 release. With a focus on new importers, the import pipeline, Boost and Queue, automatic updating, animation improvements, and stability along with many other improvements, this is the best version yet. Contact <a href='mailto:sales@bunkspeed.com'>sales@bunkspeed.com</a> for more information about upgrading or find the download links in the <a href='http://forum.bunkspeed.com/showthread.php?162-Bunkspeed-2012.3-Product-Now-Available!&p=660#post660'>forum</a>.</p><a href='/software' style='background-color:#ED1E24' class='info share unselectable' title='Click for more info'>&nbsp;</a></div>","<div id='content02' class='story-item' style='width: 680px; bottom: 120px; left: 260px;'><h1 class='highlight' style='color:#FA6B06'>Blue Sky CGI Soars</h1><h1>With help from Bunkspeed</h1><p style='padding-bottom:0px;'>Blue Sky CGI are recent additions to the Bunkspeed family, however, you wouldn\u2019t guess that after looking at their stunning work. By adding Bunkspeed Pro Suite to their toolbox, they were able to leverage the intuitive work-flow and pro level features along with their photographic expertise to bring CGI to new heights.</p><div class='credits'><span>Designs, models and renderings by <a href='http://www.cgibluesky.com/' target='_blank'>Blue Sky CGI</a><span></div><a class='unselectable logo' title='Blue Sky CGI Website' style='background-image:url(\"/Content/images/bghome-bluesky/blueskylogo.png\");height:52px;width:680px;background-position:15px 7px;padding-top:20px;cursor:pointer;' href='http://www.cgibluesky.com' target='_blank'>&nbsp;</a><a href='http://blog.bunkspeed.com/?p=1081' class='info unselectable' style='background-color:#FA6B06' title='Click for more info'>&nbsp;</a><a onclick='toggleCredits()' class='share' style='background-color:#FA6B06' title='Click to show image credits'>+</a></div>","<div id='content03' class='story-item' style='width: 650px; bottom: 120px; right: 300px;'><h1 class='highlight' style='color:#C8302F'>Love is in the air</h1><h1 style='color:#fff'>Ruby Red beyond perfect.</h1><p>Getting ready for Valentines Day, Michael Nanut must be a busy guy. He still found time to spread the Bunkspeed love. With no technical rendering settings, intuitive interfaces and powerful features, how do you want to visualize the products you love?</p><div class='credits'><span>Models and renderings by <a href='http://www.diamondwave.com/' target='_blank'>Michael Nanut</a><span></div><a href='/shop/compare' class='info unselectable' style='background-color:#C8302F' title='Click for more info'>&nbsp;</a><a class='share' onclick='toggleCredits()' style='background-color:#C8302F' title='Click to show image credits'>+</a></div>","<div id='content04' class='story-item' style='width: 715px; bottom: 120px; left: 250px;'><div style='background-image:url(\"/Content/images/designers/feb-2012/tom-murray.png\");background-repeat:no-repeat;padding-left:225px;'><h1 class='highlight' style='color:#FC7C28'>Designer</h1><h1>Thomas Murray</h1><p>Thomas has been using his avid modeling skills and animation techniques to rise in rank at Stanley Black and Decker. With a concrete background in Industrial Design, an ever expanding design sense and Bunkspeed MOVE, see what can be created.</p><div class='credits' style='width:490px;'><span>Models and renderings by <a href='http://www.studioclues.com/' target='_blank'>Thomas Murray</a><span></div></div><a href='/home/designer' class='info unselectable' style='background-color:#FC7C28;' title='Click for more info'>&nbsp;</a><a class='share' onclick='toggleCredits()' style='background-color:#FC7C28;' title='Click to show image credits'>+</a></div>","<div id='content05' class='story-item' style='width: 590px; bottom: 120px; left: 230px;'><h1 class='highlight' style='color:#7FD4FF;'>Warning:</h1><h1>This is not a photograph.</h1><p>&quot;Our mission is to create 3D digital rendering solutions that communicate the vision, passion, and emotion of design, enabling faster and more insightful decisions.&quot; We invite you to experience the essence of Bunkspeed, under our new skin. Use your mouse wheel to zoom in &amp; out of the background image, and drag your left mouse button to pan.</p><div class='credits'><span>Rendered by Bunkspeed, model from <a href='http://www.3D02.com/' target='_blank'>www.3D02.com</a><span></div><a href='/company/about' style='background-color:#7FD4FF' class='info unselectable' title='Click for more info'>&nbsp;</a><a onclick='toggleCredits()' class='share' style='background-color:#7FD4FF' title='Click to show image credits'>+</a> </div>","<div id='content06' class='story-item' style='width: 620px; bottom: 100px; right: 200px;'><h1 class='highlight' style='color:#fff'>Feature Story</h1><h1 style='color:#FF002A'>Devon Tread 1 Timepiece</h1><blockquote>&quot;It is so intuitive, I thought I was doing something wrong.&quot;</blockquote><p>Designer Jason Wilbur redefined the idea of the watch and changed the game. His masterpiece came to be known as the Devon Tread 1, a luxury timepiece that immediately established leading-edge vision and commanded artistry when the concept was introduced to the public in April 2010.</p><div class='credits'><span>Rendered by Bunkspeed, model from Jason Wilbur<span></div><a href='/home/blog' class='info unselectable' style='background-color:#FF002A' title='Click for more info'>&nbsp;</a><a class='share' onclick='toggleCredits()' style='background-color:#FF002A' title='Click to show image credits'>+</a></div>"],currentBackgroundIndex=0,isNavigationHidden=false;function BunkspeedWebsiteInit(){initializeViewer();var c=getUrlVars();if(c.length>0){var b=c.s;if(b!=null){var a=parseInt(b);if(!isNaN(a)&&a>=0&&a<backgroundImages.length)currentBackgroundIndex=a}}$(document).keydown(function(a){if(a.keyCode==37){handlePreviousImageClick();return false}if(a.keyCode==39){handleNextImageClick();return false}return true});openBackgroundImage(backgroundImages[currentBackgroundIndex]);$(window).resize(handleWindowSizeChanged);handleDocumentSizeChanged();makeUnselectable()}function initializeViewer(){if(seadragonViewer!=null)return;seadragonViewer=new Seadragon.Viewer("seadragon-background-container");seadragonViewer.addEventListener("open",handleWindowSizeChanged);seadragonViewerContainer=$("#seadragon-background-container");seadragonViewerContainer.height($(window).height());setupBackgroundCounters();Seadragon.Config.debugMode=false;Seadragon.Config.maxZoomPixelRatio=1.5;Seadragon.Config.minZoomImageRatio=1;Seadragon.Config.autoHideControls=false;$("div#full-screen-container").click(function(){if(isNavigationHidden){$(this).text("Hide navigation").removeClass("nav-hidden");$("#navigation-top").fadeIn();$("#navigation-left").fadeIn();$("#navigation-right").fadeIn();$("#main-content").fadeIn();$("#downloadProducts-menu-container").fadeIn();$("#hint-container").fadeIn();$("footer").fadeIn();setImageText(currentBackgroundIndex)}else{$(this).text("Show navigation").addClass("nav-hidden");$("#navigation-top").fadeOut();$("#navigation-left").fadeOut();$("#navigation-right").fadeOut();$("#main-content").fadeOut();$("#downloadProducts-menu-container").fadeOut();$("#hint-container").fadeOut();$("footer").fadeOut()}isNavigationHidden=!isNavigationHidden})}function openBackgroundImage(a){seadragonViewer.openDzi("/Content/images/"+a+"/dzc_output.xml");setPrevNextImagePreview(currentBackgroundIndex);!isNavigationHidden&&setImageText(currentBackgroundIndex)}function setupBackgroundCounters(){$("ul.background-counter-container").each(function(c){for(var a=0;a<backgroundImages.length;a++){var b="goto-background-"+c+"-"+a,d="<li id='"+b+"' class='current'>&nbsp;</li>",e="<li id='"+b+"'>&nbsp;</li>";$(this).append(a==currentBackgroundIndex?d:e)}});$("ul.background-counter-container li").click(function(){var a=$(this).attr("id").split("-");if(a.length>0){var b=parseInt(a[a.length-1]);if(currentBackgroundIndex!=b){currentBackgroundIndex=b;openBackgroundImage(backgroundImages[currentBackgroundIndex]);location.hash=currentBackgroundIndex==0?"":"#s="+currentBackgroundIndex}}return false});$("#background-previous-container").click(handlePreviousImageClick);$("#background-next-container").click(handleNextImageClick)}function handlePreviousImageClick(){if(--currentBackgroundIndex<0)currentBackgroundIndex=backgroundImages.length-1;openBackgroundImage(backgroundImages[currentBackgroundIndex]);location.hash=currentBackgroundIndex==0?"":"#s="+currentBackgroundIndex}function handleNextImageClick(){if(++currentBackgroundIndex>=backgroundImages.length)currentBackgroundIndex=0;openBackgroundImage(backgroundImages[currentBackgroundIndex]);location.hash=currentBackgroundIndex==0?"":"#s="+currentBackgroundIndex}function setPrevNextImagePreview(a){var b=a+1>=backgroundImages.length?0:a+1,c=a-1<0?backgroundImages.length-1:a-1;$("span#seadragon-next-thumb").css("background-image","url('/Content/images/"+backgroundImages[b]+"/thumb.jpg')");$("span#seadragon-previous-thumb").css("background-image","url('/Content/images/"+backgroundImages[c]+"/thumb.jpg')");$("ul.background-counter-container").each(function(){var b=a+1;$(this).children("li.current").removeClass("current");$(this).children("li:nth-child("+b+")").addClass("current")})}function setImageText(a){var b="";if(a>=0&&a<backgroundTexts.length)b=backgroundTexts[a];$("#main-content").hide().html(b).fadeIn()}var isRightNavCollapsed=false;function handleDocumentSizeChanged(){$("#seadragon-background-container").height($(window).height());var d=$("#background-next-container"),c=$("#main-content").children(":first"),a=c.offset().top-c.children(".highlight").height(),b=d.offset().top+10;if(a<=b&&!isRightNavCollapsed){$("#seadragon-next-thumb").hide();$("#navigation-right").addClass("collapsed");isRightNavCollapsed=true}else if(a>b&&isRightNavCollapsed){$("#seadragon-next-thumb").show();$("#navigation-right").removeClass("collapsed");isRightNavCollapsed=false}}function handleWindowSizeChanged(){try{handleDocumentSizeChanged();if(seadragonViewer.source==null)return;var c=seadragonViewer.source.dimensions,e=seadragonViewer.viewport.getContainerSize(),b=c.x/c.y,d=c.y/c.x,a=e.x/e.y,h=Math.max(0,1-a/b)/2,g=Math.min(1,a/b),i=Math.max(0,1-b/a)*d/2,f=Math.min(1,b/a)*d,j=new Seadragon.Rect(h,i,g,f);seadragonViewer.viewport.fitBounds(j,true);seadragonViewer.viewport.ensureVisible();Seadragon.Debug.log("x = "+h+"; y = "+i+"; h = "+f+"; w = "+g)}catch(k){console.log(k)}}function makeUnselectable(){$(".unselectable").each(function(){if($.browser.msie){$(this).each(function(){this.ondrag=function(){return false}});$(this).each(function(){this.onselectstart=function(){return false}})}else $.browser.opera&&$(this).attr("unselectable","on")})}function getUrlVars(){for(var a=[],b,c,f=window.location.search.slice(window.location.search.indexOf("?")+1).split("&"),g=window.location.hash.slice(window.location.hash.indexOf("#")+1).split("&"),d=0;d<f.length;d++){b=f[d].split("=");a.push(b[0]);a[b[0]]=b[1]}for(var e=0;e<g.length;e++){c=g[e].split("=");a.push(c[0]);a[c[0]]=c[1]}return a}function showDialog(a,c){var b=$("<div></div>").html(c).dialog({autoOpen:false,title:a});b.dialog("open");return false}function toggleCredits(){$(".credits").toggle()}
