
jQuery(document).ready(function(){
	jQuery(".moreinfo").css("opacity", "0");							
	jQuery.localScroll({duration:600});
//--------------------------------------------------------------------------------------------
//Nav hover and click functions
//-------------------------------------------------------------------------------------------- 	
	jQuery("ul.main_nav a").hover(function() {
		jQuery(this).animate({ color: "#9A1DC1" }, 200);
	},function() {
    	jQuery(this).animate({ color: "#FFFFFF" }, 200);
	});
	var jQuerylinks = jQuery("#header a");
		jQuerylinks.click(function(){
		jQuerylinks.removeClass('current');
		jQuery(this).addClass('current');
	return false;
});
//--------------------------------------------------------------------------------------------
//Logo hover functions
//-------------------------------------------------------------------------------------------- 	
	jQuery("a#logo").hover(function() {
		jQuery(this).animate({ top: '0px' }, 200);
	},function() {
    	jQuery(this).animate({ top: '2px' }, 200);
	});
//--------------------------------------------------------------------------------------------
//Portfolio hover functions
//-------------------------------------------------------------------------------------------- 
	jQuery(".items li.thumb").hover(function() {
			jQuery(this).find('.moreinfo').stop()
					.animate({
						opacity: '0.90'
					}, 400);
			} , function() {
			jQuery(this).find('.moreinfo').stop()
					.animate({	
						 opacity: '0'
					}, 400);
	});
//--------------------------------------------------------------------------------------------
//Services hover functions
//-------------------------------------------------------------------------------------------- 
	jQuery(".table").hover(function () {
    		jQuery(this).find(".fade").stop().animate({
      		opacity: 0
      	}, 400);
      }, function () {
        jQuery(this).find(".fade").stop().animate({
          opacity: 1
        }, 400);
  });
//--------------------------------------------------------------------------------------------
//Fancybox functions
//-------------------------------------------------------------------------------------------- 
jQuery("a.zoom").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	100, 
		'speedOut'		:	100, 
		'overlayColor' : '#25062F',
		'overlayOpacity' : '0.8',
		'padding' : 10,
		'showCloseButton'	: false,
		'titlePosition' 		: 'inside',
		//'autoScale' : false,
		'titleFormat'		: formatTitle

	});
//custom menu functions for fancybox
function formatTitle(title, currentArray, currentIndex, currentOpts) {
    return '<div class="fancybox-color" id="title"><span><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="js/fancybox/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + ' ' + (currentIndex + 1) + ' / ' + currentArray.length + '</div>';
	}
//--------------------------------------------------------------------------------------------
//Input Labels and Validation
//-------------------------------------------------------------------------------------------- 
	jQuery("label.infield").inFieldLabels();
				jQuery("form").validate();	
//--------------------------------------------------------------------------------------------
//Contact Form
//-------------------------------------------------------------------------------------------- 
	jQuery("#contact-form").submit(function(){
				var str = jQuery(this).serialize();
				jQuery.ajax({
				   type: "POST",
				   url: "php/send.php",
				   data: str,
				   success: function(msg)
				   {
						jQuery("#formstatus").ajaxComplete(function(event, request, settings){
							if(msg == 'OK'){ // Message Sent? Show the 'Thank You' message and hide the form
								jQuery("#contact-form").slideUp("fast");
								result = '<div class="formstatusok">Your message has been sent. Thank you!</div>';
							}
							else{
								result = msg;
							}
							jQuery(this).html(result);
						});
					}
				
				 });
				return false;
	});
	
});//end doc rdy
