(function($){$.fn.getTwitter=function(options){var o=$.extend({},$.fn.getTwitter.defaults,options);$(this).hide();if(o.showHeading){$(this).append('<h2>'+o.headingText+'</h2>');}
$(this).append('<ul id="twitter_update_list"><li></li></ul>');$("ul#twitter_update_list").hide();var pl=$('<p id="'+o.preloaderId+'">'+o.loaderText+'</p>');$(this).append(pl);if(o.showProfileLink){$(this).append('<a id="profileLink" href="http://twitter.com/'+o.userName+'">http://twitter.com/'+o.userName+'</a>');}
$(this).show();$.getScript("http://twitter.com/javascripts/blogger.js");$.getScript("http://twitter.com/statuses/user_timeline/"+o.userName+".json?callback=twitterCallback2&count="+o.numTweets,function(){$(pl).remove();if(o.slideIn){$("ul#twitter_update_list").slideDown(1000);}
else{$("ul#twitter_update_list").show();}
$("ul#twitter_update_list li:first").addClass("firstTweet");$("ul#twitter_update_list li:last").addClass("lastTweet");});};$.fn.getTwitter.defaults={userName:null,numTweets:5,preloaderId:"preloader",loaderText:"Loading tweets...",slideIn:false,showHeading:false,headingText:"Latest Tweets",showProfileLink:true};})(jQuery);jQuery.fn.fancyZoom=function(options){var options=options||{};var directory=options&&options.directory?options.directory:'/media/images/zoom';var zooming=false;if($('#zoom').length==0){var ext=$.browser.msie?'gif':'png';var html='<div id="zoom" style="display:none; z-index:200;"> \
                  <table id="zoom_table" style="border-collapse:collapse; width:100%; height:100%;"> \
                    <tbody> \
                      <tr> \
                        <td class="tl" style="background:url('+directory+'/tl.'+ext+') 0 0 no-repeat; width:20px height:20px; overflow:hidden;"> \
                        <td class="tm" style="background:url('+directory+'/tm.'+ext+') 0 0 repeat-x; height:15px; overflow:hidden;"> \
                        <td class="tr" style="background:url('+directory+'/tr.'+ext+') 100% 0 no-repeat; width:20px height:20px; overflow:hidden;"> \
                      </tr> \
                      <tr> \
                        <td class="ml" style="background:url('+directory+'/ml.'+ext+') 0 0 repeat-y; width:20px; overflow:hidden;"> \
                        <td class="mm" style="background:#fff; vertical-align:top; padding:10px;"> \
                          <div id="zoom_content"> \
                          </div> \
                        </td> \
                        <td class="mr" style="background:url('+directory+'/mr.'+ext+') 100% 0 repeat-y;  width:20px; overflow:hidden;"> \
                      </tr> \
                      <tr> \
                        <td class="bl" style="background:url('+directory+'/bl.'+ext+') 0 100% no-repeat; width:20px height:25px; overflow:hidden;"> \
                        <td class="bm" style="background:url('+directory+'/bm.'+ext+') 0 100% repeat-x; height:25px; overflow:hidden;"> \
                        <td class="br" style="background:url('+directory+'/br.'+ext+') 100% 100% no-repeat; width:20px height:25px; overflow:hidden;"> \
                      </tr> \
                    </tbody> \
                  </table> \
                  <a href="#" title="Close" id="zoom_close" style="position:absolute; top:0; left:0;"> \
                    <img src="'+directory+'/closebox.'+ext+'" alt="Close" style="border:none; margin:0; padding:0;"> \
                  </a> \
                </div>';$('body').append(html);$('html').click(function(e){if($(e.target).parents('#zoom:visible').length==0)hide();});$(document).keyup(function(event){if(event.keyCode==27&&$('#zoom:visible').length>0)hide();});$('#zoom_close').click(hide);}
var zoom=$('#zoom');var zoom_table=$('#zoom_table');var zoom_close=$('#zoom_close');var zoom_content=$('#zoom_content');var middle_row=$('td.ml,td.mm,td.mr');this.each(function(i){$($(this).attr('href')).hide();$(this).click(show);});return this;function show(e){if(zooming)return false;zooming=true;var content_div=$($(this).attr('href'));var zoom_width=options.width;var zoom_height=options.height;var width=window.innerWidth||(window.document.documentElement.clientWidth||window.document.body.clientWidth);var height=window.innerHeight||(window.document.documentElement.clientHeight||window.document.body.clientHeight);var x=window.pageXOffset||(window.document.documentElement.scrollLeft||window.document.body.scrollLeft);var y=window.pageYOffset||(window.document.documentElement.scrollTop||window.document.body.scrollTop);var window_size={'width':width,'height':height,'x':x,'y':y}
var width=(zoom_width||content_div.width())+60;var height=(zoom_height||content_div.height())+60;var d=window_size;var newTop=Math.max((d.height/2)-(height/2)+y,0);var newLeft=(d.width/2)-(width/2);var curTop=e.pageY;var curLeft=e.pageX;zoom_close.attr('curTop',curTop);zoom_close.attr('curLeft',curLeft);zoom_close.attr('scaleImg',options.scaleImg?'true':'false');$('#zoom').hide().css({position:'absolute',top:curTop+'px',left:curLeft+'px',width:'1px',height:'1px'});fixBackgroundsForIE();zoom_close.hide();if(options.closeOnClick){$('#zoom').click(hide);}
if(options.scaleImg){zoom_content.html(content_div.html());$('#zoom_content img').css('width','100%');}else{zoom_content.html('');}
$('#zoom').animate({top:newTop+'px',left:newLeft+'px',opacity:"show",width:width,height:height},250,null,function(){if(options.scaleImg!=true){zoom_content.html(content_div.html());}
unfixBackgroundsForIE();zoom_close.show();zooming=false;})
return false;}
function hide(){if(zooming)return false;zooming=true;$('#zoom').unbind('click');fixBackgroundsForIE();if(zoom_close.attr('scaleImg')!='true'){zoom_content.html('');}
zoom_close.hide();$('#zoom').animate({top:zoom_close.attr('curTop')+'px',left:zoom_close.attr('curLeft')+'px',opacity:"hide",width:'1px',height:'1px'},250,null,function(){if(zoom_close.attr('scaleImg')=='true'){zoom_content.html('');}
unfixBackgroundsForIE();zooming=false;});return false;}
function switchBackgroundImagesTo(to){$('#zoom_table td').each(function(i){var bg=$(this).css('background-image').replace(/\.(png|gif|none)\"\)$/,'.'+to+'")');$(this).css('background-image',bg);});var close_img=zoom_close.children('img');var new_img=close_img.attr('src').replace(/\.(png|gif|none)$/,'.'+to);close_img.attr('src',new_img);}
function fixBackgroundsForIE(){if($.browser.msie&&parseFloat($.browser.version)>=7){switchBackgroundImagesTo('gif');}}
function unfixBackgroundsForIE(){if($.browser.msie&&$.browser.version>=7){switchBackgroundImagesTo('png');}}}
var mediaURL="/media/images11/";var screenshots=["screen1.png","screen2.png","screen3.png"];var currentScreenshot=-1;function updateScreenshot(itemInScreenshotArray){currentScreenshot=itemInScreenshotArray
$("#page_button_"+itemInScreenshotArray+"").addClass("active")
var screenshotPath=mediaURL+screenshots[itemInScreenshotArray];$(function(){var img=new Image();$(img).load(function(){$(this).stopAnimatePNG();$(this).css('display','none');$('#screenshot-full').html(this);$(this).fadeIn();}).error(function(){}).attr('src',screenshotPath);});};function changeScreenshot(newScreenshot){if(currentScreenshot!=newScreenshot)
{$("#screenshot-full").fadeOut("fast",function(){$("#page_button_"+currentScreenshot+"").removeClass("active");$(this).html("");$(this).show();$(this).animatePNG("/media/images11/progress_small_grey.png",32,32,11,{fps:20,horizontal:false,x:150,y:150});$(this).children().hide();$(this).children().fadeIn("slow");updateScreenshot(newScreenshot)});};};var currentSVNStep=0;var SVNSteps=["checkout.png","edit.png","commit.png","share.png"];function switchSVNStep(step){var openingEl=$("#svnstep-"+step).children("p");var openEl=$("#svnstep-"+currentSVNStep+"").children("p");var height=openEl.height();openingEl.height("0px");openingEl.animate({height:height+"px"},{duration:"fast",step:function(now,fx){var currentHeight=Math.floor(fx.now);openEl.css({height:(height-currentHeight+fx.unit)},now);openingEl.css({height:(currentHeight+fx.unit)},now);}});currentSVNStep=step;$(".button-step-small").removeClass("black");$(".button-step-small").removeClass("green");$('.button-step-small').each(function(){var identifier=$(this).parent().attr("id").split("-")[1]
if(identifier==step){$(this).addClass("green");}else{$(this).addClass("black");}});changeSVNImage(step);};function updateSVNImage(itemInSVNStepArray){currentSVNStep=itemInSVNStepArray
var SVNStepPath=mediaURL+SVNSteps[itemInSVNStepArray];$(function(){var img=new Image();$(img).load(function(){$('.image-wrapper').stopAnimatePNG();$(this).css('display','none');$('.image-wrapper').html(this);$(this).fadeIn();}).error(function(){}).attr('src',SVNStepPath);});};function changeSVNImage(newSVNStep){$(".image-wrapper").fadeOut("fast",function(){$(".image-wrapper").html("");$(this).show();$(".image-wrapper").animatePNG("/media/images11/progress_small_grey.png",32,32,11,{fps:20,horizontal:false,x:150,y:150});$(this).children().hide();$(this).children().fadeIn("slow");updateSVNImage(newSVNStep)});};$(document).ready(function(){switchSVNStep(0);$(".button-step-small").click(function(){var step=$(this).parent().attr("id").split("-")[1];if(step!=currentSVNStep){switchSVNStep(step);}});var pagination=""
for(i=0;i<screenshots.length;i++)
{if(i==0){pagination+="<li class=\"page_button active first\" onClick=\"changeScreenshot("+i+")\" id=\"page_button_"+i+"\"></li>"}else{pagination+="<li class=\"page_button\" onClick=\"changeScreenshot("+i+")\" id=\"page_button_"+i+"\"></li>"}}
$(".stepper-big").html(pagination);$("#screenshot-wrapper .screenshot").hover(function(){$(".magnify").stop(true,false).fadeIn("fast");$(".magnify").animate({opacity:"1"},{queue:false,duration:250});},function(){$(".magnify").animate({opacity:"0"},{queue:false,duration:250});})
$("#screenshot-wrapper .screenshot").bind("click",function(){$(".black-bg").fadeIn("fast");$("#screenshot-modal-wrapper").fadeIn("fast");if(navigator.userAgent.match(/iPad|iPhone/)){$("#screenshot-modal-wrapper").css({"top":($(window).scrollTop()+30)+"px","margin-top":"0px"});}
if(currentScreenshot==-1){changeScreenshot(0);}else{changeScreenshot(currentScreenshot);};});$(".black-bg").click(function(){$(this).fadeOut("fast");$("#screenshot-modal-wrapper").fadeOut("fast");});$(".close-screenshot-modal-wrapper").click(function(){$(".black-bg").fadeOut("fast");$("#screenshot-modal-wrapper").fadeOut("fast");});$(".download").click(function(){$("#dlpop").fadeIn(300);$("#dlpop").append("<iframe src=\"/download\" width=\"0px\" height=\"0px\" style=\"display:none;\"></iframe>");setTimeout(function(){$(".black-bg").fadeIn(500);},300)});$("#dlbutton,.black-bg").click(function(){$("#dlpop").fadeOut(0);$(".black-bg").fadeOut(50);});});
