$(document).ready(function(){
	
	
	/*Smooth preloader for longer load times
	/ ====================================================================================
	/This must include after quicksand
	*/
	if ( $.browser.webkit || $.browser.mozilla || $.browser.msie && $.browser.version  > 8  ) {
		$("#main,#footer-content").maxxSmoothPreloader();
	};
	
	
	
	/*Some Effect
	/ ====================================================================================
	*/
	
	/*Pretty Photo*/
	$("*[rel^='prettyPhoto']").prettyPhoto();
	
	/*preview Overlay*/
	$(".video-preview,.image-preview").mPreviewOverlay();

	$(".social-network li a img").css({opacity:.5});
	$(".social-network li a").hover(function(){
		$("img",this).stop().animate({
			opacity:1,
			marginTop:'0px'
		},300);	
	},function(){
		$("img",this).stop().animate({
			opacity:.5,
			marginTop:'5px'
		},300);	
	});
	
	/*Valid Form*/
	$("#contact-form").validate();
	
	/*auto align layout
	/ ====================================================================================
	*/
	
	$(".list-blog-entry li:odd").addClass("odd");
	$("#sidebar .ads a:even,.list-blog-entry li:even").addClass("even");
	$(".services.three-column").countThree({className:"last-child-of-line"});
	$("ul.zigzag li:last-child,ul.simple-drop-down-menu ul li:last-child").css({borderBottom:"none"});
	$(".three-column .block:last-child").addClass("last-child");
	
	/*Empty text-box
	/ ====================================================================================
	*/
	$("input:text,input:password").css({color:'#CCC'});
	$("input:text,input:password").emptyTextBox();
	
	/*Scoll to comment
	/ ====================================================================================
	*/
	$(".add-comment").click(function(){
		var offsets = $("#add-comment-form").offset();		
		$("html,body").animate({scrollTop:offsets.top - 80}, 800);
		return false;
	});
	
	/*Nivo slider
	/ ====================================================================================
	*/
	$("#slider").nivoSlider();
	/*Slide button effect*/
	$(".twen .nivo-directionNav a.nivo-nextNav").delay(1000).animate({right:187});
	$(".twen .nivo-directionNav a.nivo-prevNav").delay(1000).animate({left:187});
	$(".twen .nivo-directionNav").hoverIntent({
		timeout: 300,
		over: function () {	$("a.nivo-nextNav").animate({right:152});$("a.nivo-prevNav").animate({left:152});},
		out: function () {	$("a.nivo-nextNav").animate({right:187});$("a.nivo-prevNav").animate({left:187});}
	})
	/*Slide overlay .Remove the below line if you dont want the slice overlay*/
	$(".nivoSlider").find("a.nivo-imageLink").append("<div class='slide-overlay'></div>");	
	

	$(".ten .nivo-directionNav a.nivo-nextNav").delay(1000).animate({right:335});
	$(".ten .nivo-directionNav a.nivo-prevNav").delay(1000).animate({left:335});
	$(".ten .nivo-directionNav").hoverIntent({
		timeout: 300,
		over: function () {	$("a.nivo-nextNav").animate({right:300});$("a.nivo-prevNav").animate({left:300});},
		out: function () {	$("a.nivo-nextNav").animate({right:335});$("a.nivo-prevNav").animate({left:335});}
	})





	/*Equal Heights
	/ ====================================================================================
	*/
	$("ul.display-short li").equalHeights();
	$(".services .block .content").equalHeights();
	$(".entry .block .content").equalHeights();
	$(".uniform").equalHeights();

	
});

// Javascript originally by Patrick Griffiths and Dan Webb.
// http://htmldog.com/articles/suckerfish/dropdowns/
sfHover = function() {
   var sfEls = document.getElementById("navbar").getElementsByTagName("li");
   for (var i=0; i<sfEls.length; i++) {
      sfEls[i].onmouseover=function() {
         this.className+=" hover";
      }
      sfEls[i].onmouseout=function() {
         this.className=this.className.replace(new RegExp(" hover\\b"), "");
      }
   }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);





	
