$(document).ready(function(){slidePortfolioIndex(5000,790,700);slidePortfolioCaption(500);$("ul.sf-menu").superfish({autoArrows:false,delay:400,animation:{opacity:'show',height:'show'},speed:'fast',autoArrows:false,dropShadows:false});$('ul.list li').each(function(){var a=$(this).children('a');var aClass=a.attr('rel');if(a.hasClass('active')){$('.'+aClass).css({'display':'block'});}else{$('.'+aClass).css({'display':'none'});}});$('ul.list li a').click(function(){var thisaClass=$(this).attr('rel');$(this).parent('li').parent('ul').children('li').each(function(){var a=$(this).children('a');var aClass=a.attr('rel');if(thisaClass==aClass){$('.'+aClass).show();a.attr('class','active');}else{$('.'+aClass).hide();a.attr('class','');}});return false;});});function slidePortfolioIndex($time,$full_image_width,$slide_time){$addCustom=$(".index_port_item.current").length;if($addCustom==0){$(".index_port_item:first").addClass("current");}
$totalPortfolio=($(".index_port_item").length)-1;$widthDivide=935-$full_image_width;$tileWidth=parseInt($widthDivide/$totalPortfolio);$caption_width=$full_image_width-63;$caption_width=$caption_width+'px';$full_image_width=$full_image_width+'px';$(".index_port_item").css("width",$tileWidth);$(".index_port_item.current").css("width",$full_image_width);$(".caption").css({width:$caption_width,opacity:0});if(typeof(isClicked)=='undefined'){var isClicked=0;}
$(".index_port_item").click(function(){isClicked=1;var classClicked=$(this).attr('class');if(classClicked!=='index_port_item current'){$(".index_port_item.current").removeClass("current").addClass("prev").stop().animate({width:$tileWidth},$slide_time-100);$(this).addClass("current").css("width",$tileWidth).stop().animate({width:$full_image_width},$slide_time);$(".index_port_item.prev").removeClass("prev");}});if(typeof(isHovered)=='undefined'){var isHovered=0;}
$(".index_port_item").hover(function(){isHovered=1;},function(){isHovered=0;});setInterval(function(){if(isHovered==0&&isClicked==0){nextPortfolioItem($full_image_width,$tileWidth,$slide_time);}},$time);}
function nextPortfolioItem($full_image_width,$tile_width,$slide_time){$current=$(".index_port_item.current");$next=$(".index_port_item.current").next();if($next.attr('class')==undefined){$next=$(".index_port_item:first");}else{}
$current.removeClass("current").css("width",$full_image_width).stop().animate({width:$tile_width},$slide_time-100);$next.addClass("current").css("width",$tile_width).stop().animate({width:$full_image_width},$slide_time);}
function slidePortfolioCaption($slide_time){$(".index_port_item").children('a').hover(function(){$(this).parents().children('.caption').stop().animate({opacity:1},$slide_time-100);},function(){$(this).parents().children('.caption').stop().animate({opacity:0},$slide_time);});}
