// JavaScript Document

$(document).ready (function () { $(".slide-out-div").css ("display", "block"); });

$(document).ready (function () {
							 
							// this sets the "off" state
	jQuery(".social img").css("opacity", 1.0);
		
	// this adds hover to full opacity:
	jQuery(".social img").hover( 
		// hover state
		function() {
			jQuery(this).css("opacity", 0.3);
		
		},
		// back to off
		function() {
		
			jQuery(this).css("opacity", 1.0);
		
		});
							 
							 
});

/* Slide out contact */
 $(function(){
             $('.slide-out-div').tabSlideOut({
                 tabHandle: '.handle',                              //class of the element that will be your tab
                 pathToTabImage: 'http://jackibruniquel.com/blog/wp-content/themes/minimalism/images/contact.png',          //path to the image for the tab (optionaly can be set using css)
                 imageHeight: '116px',                               //height of tab image
                 imageWidth: '22px',                               //width of tab image    
                 tabLocation: 'left',                               //side of screen where tab lives, top, right, bottom, or left
                 speed: 300,                                        //speed of animation
                 action: 'click',                                   //options: 'click' or 'hover', action to trigger animation
                 topPos: '0px', 
                 fixedPosition: true                          
             });
         });

/* Contact 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;
  });
};

