$(function(){var totalPanels=$(".scrollContainer").children().size();var regWidth=$(".panel").css("width");var regImgWidth=$(".panel img").css("width");var regTitleSize=$(".panel h2").css("font-size");var regParSize=$(".panel p").css("font-size");var regTopMargin=20;var movingDistance=100;var curWidth=125;var curImgWidth=125;var currTopMargin=0;var curTitleSize="20px";var curParSize="15px";var curDivclass="currentBox";var $panels=$('#slider .scrollContainer > div');var $container=$('#slider .scrollContainer');var $synopsys=$('.inside > div');$panels.css({'float':'left','position':'relative'});$("#slider").data("currentlyMoving",false);$container.css('width',($panels[0].offsetWidth*$panels.length)+100).css('left',"40px");var scroll=$('#slider .scroll').css('overflow','hidden');function returnToNormal(element){$(element).animate({width:regWidth,marginTop:regTopMargin}).find("img").animate({width:regImgWidth}).end().find("h2").animate({fontSize:regTitleSize}).end().find("p").animate({fontSize:regParSize});};function growBigger(element){$(element).animate({width:curWidth,marginTop:currTopMargin},function(){displayInfo();}).find("img").animate({width:curImgWidth,marginTop:currTopMargin}).end().find("h2").animate({fontSize:curTitleSize}).end().find("p").animate({fontSize:curParSize});var next=true?curPanel+1:curPanel-1;}
function displayInfo(){$('#panel_'+curPanel).addClass("current-panel");$('#synopsis_'+curPanel).css("display","block");$('#description_'+curPanel).css("display","block");}
function change(direction){if((direction&&!(curPanel<totalPanels))||(!direction&&(curPanel<=1))){return false;}
if(($("#slider").data("currentlyMoving")==false)){$("#slider").data("currentlyMoving",true);var next=direction?curPanel+1:curPanel-1;var leftValue=$(".scrollContainer").css("left");var movement=direction?parseFloat(leftValue,1)-movingDistance:parseFloat(leftValue,1)+movingDistance;$(".scrollContainer").stop().animate({"left":movement},function(){$("#slider").data("currentlyMoving",false);});returnToNormal("#panel_"+curPanel);var previuesPanel=(next-1);var previuesNextPanel=(previuesPanel+1);$(".synopsis").css("display","none");$(".description").css("display","none");$('#panel_'+previuesPanel).removeClass("current-panel");$('#panel_'+previuesNextPanel).removeClass("current-panel");$('#panel_'+curPanel).removeClass("current-panel");$('#panel_'+previuesPanel).removeClass("distance");$('#panel_'+previuesNextPanel).removeClass("distance");$('#panel_'+curPanel).removeClass("distance");growBigger("#panel_"+next);curPanel=next;$("#panel_"+(curPanel+1)).unbind();$("#panel_"+(curPanel+1)).click(function(){change(true);});$("#panel_"+(curPanel-1)).unbind();$("#panel_"+(curPanel-1)).click(function(){change(false);});$("#panel_"+curPanel).unbind();}}
function callback(){alert('Callbacked!');}
growBigger("#panel_1");var curPanel=1;var para=(curPanel+1);var mbrapa=(curPanel+1);$("#panel_"+(curPanel+1)).click(function(){change(true);});$("#panel_"+(curPanel-1)).click(function(){change(false);});$(".right").click(function(){change(true);});$(".left").click(function(){change(false);});$(window).keydown(function(event){switch(event.keyCode){case 13:$(".right").click();break;case 32:$(".right").click();break;case 37:$(".left").click();break;case 39:$(".right").click();break;}});});
