/*
  animateHover
 */
jQuery(function(){jQuery('ul.hover_block li').hover(function(){jQuery(this).find('img').animate({bottom:'0px'},{queue:false,duration:200})},function(){jQuery(this).find('img').animate({bottom:'-70px'},{queue:false,duration:800})});jQuery('ul.hover_block2 li').hover(function(){jQuery(this).find('img').animate({top:'0px'},{queue:false,duration:200})},function(){jQuery(this).find('img').animate({top:'-70px'},{queue:false,duration:800})})});

/*
	jQuery Coda-Slider v1.1 - http://www.ndoherty.com/coda-slider
	
	Copyright (c) 2007 Niall Doherty
	
	Inspired by the clever folks at http://www.panic.com/coda
	Many thanks to Gian Carlo Mingati. Coda-Slider is a heavily modified version of his slideViewer, which can be found at  http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html
	
	Requirements:
	-  jQuery 1.2 ... available via  http://www.jquery.com
	-  jQuery easing plugin (1.2) ... available via  http://gsgd.co.uk/sandbox/jquery/easing/
	- jQuery easing compatability plugin ... available via  http://gsgd.co.uk/sandbox/jquery/easing/
	- CSS included in index.html
*/
jQuery(function(){jQuery("div.csw").prepend("<p class='loading'>LOADING</p>")});var j=0;jQuery.fn.codaSlider=function(settings){settings=jQuery.extend({easeFunc:"easeInOut",easeTime:500,toolTip:false},settings);return this.each(function(){var container=jQuery(this);container.find("p.loading").remove();container.removeClass("csw").addClass("stripViewer");var panelWidth=container.find("div.panel").width();var panelCount=container.find("div.panel").size();var stripViewerWidth=panelWidth*panelCount;container.find("div.panelContainer").css("width",stripViewerWidth);var navWidth=panelCount*8;if(location.hash&&parseInt(location.hash.slice(1))<=panelCount){var cPanel=parseInt(location.hash.slice(1));var cnt=-(panelWidth*(cPanel-1));jQuery(this).find("div.panelContainer").css({left:cnt})}else{var cPanel=1};container.each(function(i){jQuery(this).before("<div class='stripNavL' id='stripNavL"+j+"'><a href='#'>Left</a><\/div>");jQuery(this).after("<div class='stripNavR' id='stripNavR"+j+"'><a href='#'>Right</a><\/div>");jQuery(this).before("<div class='stripNav' id='stripNav"+j+"'><ul><\/ul><\/div>");jQuery(this).find("div.panel").each(function(n){jQuery("div#stripNav"+j+" ul").append("<li class='tab"+(n+1)+"'><a href='#"+(n+1)+"'>"+jQuery(this).attr("title")+"<\/a><\/li>")});jQuery("div#stripNav"+j+" a").each(function(z){navWidth+=jQuery(this).parent().width();jQuery(this).bind("click",function(){jQuery(this).addClass("current").parent().parent().find("a").not(jQuery(this)).removeClass("current");var cnt=-(panelWidth*z);cPanel=z+1;jQuery(this).parent().parent().parent().next().find("div.panelContainer").animate({left:cnt},settings.easeTime,settings.easeFunc)})});jQuery("div#stripNavL"+j+" a").click(function(){if(cPanel==1){var cnt=-(panelWidth*(panelCount-1));cPanel=panelCount;jQuery(this).parent().parent().find("div.stripNav a.current").removeClass("current").parent().parent().find("li:last a").addClass("current")}else{cPanel-=1;var cnt=-(panelWidth*(cPanel-1));jQuery(this).parent().parent().find("div.stripNav a.current").removeClass("current").parent().prev().find("a").addClass("current")};jQuery(this).parent().parent().find("div.panelContainer").animate({left:cnt},settings.easeTime,settings.easeFunc);location.hash=cPanel;return false});jQuery("div#stripNavR"+j+" a").click(function(){if(cPanel==panelCount){var cnt=0;cPanel=1;jQuery(this).parent().parent().find("div.stripNav a.current").removeClass("current").parent().parent().find("a:eq(0)").addClass("current")}else{var cnt=-(panelWidth*cPanel);cPanel+=1;jQuery(this).parent().parent().find("div.stripNav a.current").removeClass("current").parent().next().find("a").addClass("current")};jQuery(this).parent().parent().find("div.panelContainer").animate({left:cnt},settings.easeTime,settings.easeFunc);location.hash=cPanel;return false});jQuery("a.cross-link").click(function(){jQuery(this).parents().find(".stripNav ul li a:eq("+(parseInt(jQuery(this).attr("href").slice(1))-1)+")").trigger('click')});jQuery("div#stripNav"+j).css("width",navWidth);if(location.hash&&parseInt(location.hash.slice(1))<=panelCount){jQuery("div#stripNav"+j+" a:eq("+(location.hash.slice(1)-1)+")").addClass("current")}else{jQuery("div#stripNav"+j+" a:eq(0)").addClass("current")}});j++})};

/* codaSlider custom */
jQuery(window).bind("load",function(){jQuery("div#slider1").codaSlider()});

/*
 * jQuery Easing Compatibility v1 - http://gsgd.co.uk/sandbox/jquery.easing.php
 *
 * Adds compatibility for applications that use the pre 1.2 easing names
 *
 * Copyright (c) 2007 George Smith
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */
jQuery.extend(jQuery.easing,{easeIn:function(x,t,b,c,d){return jQuery.easing.easeInQuad(x,t,b,c,d)},easeOut:function(x,t,b,c,d){return jQuery.easing.easeOutQuad(x,t,b,c,d)},easeInOut:function(x,t,b,c,d){return jQuery.easing.easeInOutQuad(x,t,b,c,d)},expoin:function(x,t,b,c,d){return jQuery.easing.easeInExpo(x,t,b,c,d)},expoout:function(x,t,b,c,d){return jQuery.easing.easeOutExpo(x,t,b,c,d)},expoinout:function(x,t,b,c,d){return jQuery.easing.easeInOutExpo(x,t,b,c,d)},bouncein:function(x,t,b,c,d){return jQuery.easing.easeInBounce(x,t,b,c,d)},bounceout:function(x,t,b,c,d){return jQuery.easing.easeOutBounce(x,t,b,c,d)},bounceinout:function(x,t,b,c,d){return jQuery.easing.easeInOutBounce(x,t,b,c,d)},elasin:function(x,t,b,c,d){return jQuery.easing.easeInElastic(x,t,b,c,d)},elasout:function(x,t,b,c,d){return jQuery.easing.easeOutElastic(x,t,b,c,d)},elasinout:function(x,t,b,c,d){return jQuery.easing.easeInOutElastic(x,t,b,c,d)},backin:function(x,t,b,c,d){return jQuery.easing.easeInBack(x,t,b,c,d)},backout:function(x,t,b,c,d){return jQuery.easing.easeOutBack(x,t,b,c,d)},backinout:function(x,t,b,c,d){return jQuery.easing.easeInOutBack(x,t,b,c,d)}});

/*
 * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
 *
 * Uses the built In easIng capabilities added In jQuery 1.1
 * to offer multiple easIng options
 *
 * Copyright (c) 2007 George Smith
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */


jQuery.extend(jQuery.easing,{easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}});

/* navSprite */
jQuery(function(){jQuery("ul#mainNav span").css("opacity","0");jQuery("ul#mainNav span").hover(function(){jQuery(this).stop().animate({opacity:1},'300')},function(){jQuery(this).stop().animate({opacity:0},'300')})});

/* tooltip Tipsy */
(function(jQuery){jQuery.fn.tipsy=function(opts){opts=jQuery.extend({fade:false,gravity:'n'},opts||{});var tip=null,cancelHide=false;this.hover(function(){jQuery.data(this,'cancel.tipsy',true);var tip=jQuery.data(this,'active.tipsy');if(!tip){tip=jQuery('<div class="tipsy"><div class="tipsy-inner">'+jQuery(this).attr('title')+'</div></div>');tip.css({position:'absolute',zIndex:1000});jQuery(this).attr('title','');jQuery.data(this,'active.tipsy',tip)}var pos=jQuery.extend({},jQuery(this).offset(),{width:this.offsetWidth,height:this.offsetHeight});tip.remove().css({top:0,left:0,visibility:'hidden',display:'block'}).appendTo(document.body);var actualWidth=tip[0].offsetWidth,actualHeight=tip[0].offsetHeight;switch(opts.gravity.charAt(0)){case'a':tip.css({top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}).addClass('tipsy-home');break;case'b':tip.css({top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}).addClass('tipsy-work');break;case'c':tip.css({top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}).addClass('tipsy-personal');break;case'd':tip.css({top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}).addClass('tipsy-contact');break;case'e':tip.css({top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}).addClass('tipsy-index')}if(opts.fade){tip.css({opacity:0,display:'block',visibility:'visible'}).animate({opacity:1})}else{tip.css({visibility:'visible'})}},function(){jQuery.data(this,'cancel.tipsy',false);var self=this;setTimeout(function(){if(jQuery.data(this,'cancel.tipsy'))return;var tip=jQuery.data(self,'active.tipsy');if(opts.fade){tip.stop().fadeOut(function(){jQuery(this).remove()})}else{tip.remove()}},100)})}})(jQuery);

/*tooltip custom*/
jQuery(function(){jQuery('.tooltip-1').tipsy({fade:true});jQuery('.tooltip-1').tipsy({gravity:'a'});jQuery('.tooltip-2').tipsy({fade:true});jQuery('.tooltip-2').tipsy({gravity:'b'});jQuery('.tooltip-3').tipsy({fade:true});jQuery('.tooltip-3').tipsy({gravity:'c'});jQuery('.tooltip-4').tipsy({fade:true});jQuery('.tooltip-4').tipsy({gravity:'d'});jQuery('.tooltip-5').tipsy({fade:true});jQuery('.tooltip-5').tipsy({gravity:'e'})});

/*sliding panel */
jQuery(document).ready(function(){jQuery("#open").click(function(){jQuery("div#panel").slideDown("200")});jQuery("#close").click(function(){jQuery("div#panel").slideUp("400")});jQuery("#toggle a").click(function(){jQuery("#toggle a").toggle()})});
