/*
 * written by Alen Grakalic (http://cssglobe.com)
 */
 
this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$(".gallery-001 a.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$("a.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

jQuery(document).ready(function(){ 
	
jQuery("a[href$='.pdf'], a[href^='http://'], ._blank").click(function(){
	var newwindow = window.open(this.href, '_blank');
	newwindow.focus();
	return false;
});


jQuery('#mast-head, #mast-head-production, #mast-head-rental-sales').cycle({ 
	fx:     'scrollLeft', 
	speed:  500,
	pager:  '#nav', 
	timeout: 5000
});

jQuery("#button, #submit").hover(
      function () {
        jQuery(this).addClass("hover");
      }, 
      function () {
        jQuery(this).removeClass("hover");
      }
);


jQuery(".cta-button span").css("opacity","0");
jQuery(".cta-button span").hover(
      function () {
        jQuery(this).stop().animate({
				opacity: 1
			}, "slow");
      }, 
      function () {
        jQuery(this).stop().animate({
				opacity: 0
			}, "slow");
      }
);

jQuery("#top-navigation ul").superfish({
		animation:   {opacity:'slideUp',height:'show'}
});	

jQuery('.gallery-001 a, .gallery-002 a').lightBox({fixedNavigation:true});
imagePreview();

}); 


