/*$(document).ready( function(){
  $('.rounded').corners();
});*/


//work info
$(document).ready(function() {
$('.infoBtn a').click(function() {
     var id = $(this).attr('id');
     $('#panel' + id).slideToggle("slow");
     $(this).toggleClass("active"); 
	 return false;
});

}); 


$(document).ready(function () {
  $.localScroll();
  $("#mainNav").makeFloat({x:"current",y:"current",Speed:"normal"});
       
	$('#mainNav a').click(function () {
		var clicked = $(this);
		$('#mainNav a').removeClass('selected');      
		clicked.addClass('selected');
        return false;
	});
		
});

/*$(document).ready(function() { 
$('#featured, #featured2') 
.before('<div id="gal">') 
.cycle({ 
    fx:     'fade', 
    speed:  '1000', 
    timeout: 0, 
    pager:  '#gal' 
});
});*/

//tooltips
/*$(document).ready(function(){	
		
		$("li").easyTooltip();
		$("img#next").easyTooltip({
			tooltipId: "tooltip",
			content: '<p>NEXT</p>'
		});
	});*/

//form
$(document).ready(function() { 
var options = { 
target: '#alert',
}; 
$('#contactForm').ajaxForm(options); 
}); 

$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
  
};


//serial scroll
$.easing.easeOutQuart = function (x, t, b, c, d) {
			return -c * ((t=t/d-1)*t*t*t - 1) + b;
		};

jQuery(function( $ ){
						
		
	// back links
	/*$('span.back').click(function(){
		$(this).parents('div.photos').scrollTo( 'li:eq(0)', 800 );
		//$(this).parents('div.section').find('span.message').text( this.title );
		return false;
	});*/
    
	// Reset all scrollable panes to (0,0) on refresh
	//$('#logo').scrollTo( 0 );
	//$.scrollTo( 0 );

    //serialscroll
	$('div.slider').serialScroll({
		target:'div.portfolio, div.photos',
		items:'li',
		prev:'#navigation a.prev',
		next:'#navigation a.next',
		offset:0, //when scrolling to photo, stop 60 before reaching it (from the left)
		start:0, //as we are centering it, start at the 2nd
		duration:1200,
		force:true,
		stop:true,
		lock:false,
		cycle:true, //don't pull back once you reach the end
		easing:'easeOutQuart', //use this easing equation for a funny effect
		jump: true //click on the images to scroll to them
	});
	
	 //allow links in scrolling content
      $('.portfolio li a').click(function(e){
         e.stopPropagation();
      });
	
}); //end serial scroll
		

	//change photo gallery
	/*$(function () {
    $('.sectionNav a').click(function () {
        var target = $(this.hash);
        var hash = this.hash;
        
        if (target.length) {
            var targetOffset = target.offset().top;
            $('html,body').animate({scrollTop: targetOffset}, 600);
            return false;
		}
	});
});*/
	
//main nav
/*$(function () {
    $('#mainNav a').click(function () {
        var target = $(this.hash);
        var hash = this.hash;
		var clicked = $(this);
		
        if (target.length) {
            var targetOffset = target.offset().top;
            $('html,body').animate({scrollTop: targetOffset}, 600);
			 $('#mainNav a').removeClass('selected');      
			 clicked.addClass('selected');
            return false;
		}
	});
});*/
