$(document).ready(function () {
 
 
	Cufon.replace('h1');Cufon.replace('h2');Cufon.replace('h3', {
	hover: true
});
Cufon.replace('#popup h3');Cufon.replace('#popup h4');Cufon.replace('#popup h5');
		



var settings = {
		hijackInternalLinks: false,
		animateTo:false
	};
	 
	var pane = $('.copy');
	pane.jScrollPane(settings);
	var api = pane.data('jsp');
	
	
	
// add back link to services	
//if ( $('#our-services .copy').hasClass('main')){//alert('main');
//}else{//alert('sub');
// $('#our-services .copy p:last').after('<div class="sub style="clear:both"><p style="margin-top:2em"><a href="our-services.html">Back</a></p></div>');}





// anchors
var urlParts = location.href.split("?"); // split the URL into pieces at '?'s
if (urlParts.length >1 )  // if there is more than one piece
{ var goto = urlParts[urlParts.length - 1];
api.scrollToElement($("#" + goto)  ,true);
}

//}  
 
	

(function($) {
	$.fn.customFadeIn = function(speed, callback) {
		$(this).fadeIn(speed, function() {
			if(!$.support.opacity)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	$.fn.customFadeOut = function(speed, callback) {
		$(this).fadeOut(speed, function() {
			if(!$.support.opacity)
				$(this).get(0).style.removeAttribute('filter');
			if(callback != undefined)
				callback();
		});
	};
	$.fn.customFadeTo = function(speed,to,callback) {
		return this.animate({opacity: to}, speed, function() {
			if (to == 1 && jQuery.browser.msie)
				this.style.removeAttribute('filter');
			if (jQuery.isFunction(callback))
				callback();
		});
	};
})(jQuery);


$('#special1').hide();
 
$('#header').delay('1000').slideDown("slow");
$('#special1').delay('5000').slideDown("slow");
$('#special2').delay('5000').slideUp("slow");


//$("#header").delay('1000').animate( { height:"111"}, 1000 );




$(".facebook img").animate({ opacity: 0.4 }, 0);
 



		
		$(".facebook img").each(function() {
            $(this).hover(function() {
            
                $(this).stop().animate({ opacity: 1.0 }, 300);
                
            },
           function() {
  
               $(this).stop().animate({ opacity: 0.7 }, 300);
          
        });

   
	});




});
