
jQuery(function($){$container=$("#main"),$content_nav=$('#container nav'),$content_nav_links=$content_nav.find('li [data-source]'),$path=window.location.pathname.replace(/(\/(.*)\/)/,''),$page_height=$container.find("div").outerHeight(true),$sdk_footer=$("#sdk-footer"),$buy_menu=$('nav .buy ul');$descriptions={'overview':'Design &amp; create a beautiful website on your Mac in minutes. RapidWeaver is a web design application for Mac OS X and can publish to any FTP server or MobileMe','features':'RapidWeaver is a powerful website creation application for Mac. Read more about the amazing features it has to offer.','advanced':'RapidWeaver for Mac has many advanced features meaning you can design and create powerful websites in minutes.'};$path=$path!=""?$path:'overview';window.onpopstate=function(event){document.title=event.state;$path=window.location.pathname.replace(/(\/(.*)\/)/,'');$path=$path!=""?$path:'overview';global.updatePage();};$buy_menu.css('display','none');$('nav .buy > a').click(function(e){e.preventDefault();if($buy_menu.hasClass('show')){$buy_menu.removeClass('show');setTimeout(function(){$buy_menu.css('display','none');},300);}else{$buy_menu.css('display','block');setTimeout(function(){$buy_menu.addClass('show');},0);}});$container.delegate('.zoom','click',function(e){e.preventDefault();if($(this).parent(".stack")){$.fancybox(['http://assets1.realmacmedia.com/websites/_resources/rapidweaver/images/screenshots/001_Welcome.jpg','http://assets2.realmacmedia.com/websites/_resources/rapidweaver/images/screenshots/002_document.jpg','http://assets3.realmacmedia.com/websites/_resources/rapidweaver/images/screenshots/003_resources.jpg','http://assets1.realmacmedia.com/websites/_resources/rapidweaver/images/screenshots/004_blog.jpg','http://assets2.realmacmedia.com/websites/_resources/rapidweaver/images/screenshots/005_website.jpg','http://assets3.realmacmedia.com/websites/_resources/rapidweaver/images/screenshots/006_bookmarks.jpg',],{'type':'image','transitionIn':'elastic','transitionOut':'elastic',overlayOpacity:0.3,overlayColor:'#000'});}else{$(this).fancybox({'transitionIn':'elastic','transitionOut':'elastic',overlayOpacity:0.3,overlayColor:'#000',});}});(function video(){function renderVideoTemplate(attrs){var html=$.data(document.body,'video')||'',template='template-video',video;attrs=attrs||{};if(!html){if((/ie[678]/).test(document.body.className)){template='template-fallback';}
video=document.createElement('video');html=$.trim(document.getElementById(template).innerHTML);$.data(document.body,'video',html);}
html=html.replace(/\{([^\}]+)\}/gi,function(match,tag){var attr=attrs[tag];return(typeof attr==='string'||typeof attr==='number')?attr:match;});return html;}
$('img[data-video-source]').live('click',function(){var template_data,$video;$video=$.data($container,this.src);if(!$video){template_data={width:this.width,height:this.height,poster:this.src,id:'video',source:this.getAttribute('data-video-source').replace(/.[\w]{2,4}$/,''),fallback:this.getAttribute('data-video-fallback')};$video=$(renderVideoTemplate(template_data));$video.prependTo($("#tour"));$.data($container,this.src,$video);}
$video.show();$(this).hide();if($video[0].parentNode&&$video[0].play){$video[0].play();}});})();$content_nav_links.bind("click",function(event){event.preventDefault();$path=$(this).attr('data-source');if(!$('#'+$path).length){$.ajax({url:'/_resources/rapidweaver/html/'+$path+'.php',success:function(html){$(innerShiv("<div>"+html+"</div>",false)).attr("id",$path).appendTo($container);global.updatePage();_gauges.push(['track']);}});}else{global.updatePage();}
if(event.target.nodeName=='A'){document.title='Web Design Software for Mac - RapidWeaver - '+$path.replace(/^\w/,function($0){return $0.toUpperCase();});if(typeof history.pushState==='function'){window.history.pushState(document.title,document.title,event.target.href);}}});});$(document).ready(function(){global.updatePage();});global={}
global.updatePage=function(){$new_content=$("#"+$path),$height=$new_content.outerHeight(true);if(video=document.getElementById('video')){video.pause();}
if($path=='advanced'){$sdk_footer.show();}else{$sdk_footer.hide();}
$new_content.show().css({'opacity':1,'z-index':1,'display':'block'});$content_nav_links.filter('.current').removeClass('current');$content_nav_links.filter('[data-source='+$path+']').addClass('current');$container.find("div:not(#"+$path+")").css({'opacity':0,'z-index':0,'display':'none'});document.getElementsByName('description')[0].setAttribute('content',$descriptions[$path])};window.innerShiv=(function(){var d,r;return function(h,u){if(!d){d=document.createElement('div');r=document.createDocumentFragment();}
var e=d.cloneNode(true);e.innerHTML=h;if(u===false)return e.childNodes;var f=r.cloneNode(true),i=e.childNodes.length;while(i--)f.appendChild(e.firstChild);return f;}}());
