$(document).ready(function(){

/* 	SLIDER 1								 */

	$('.location_image_container.for_1').cycle({ 
    	fx: 'scrollHorz', 
    	pause: true,
    	speed: 700,
    	pauseOnPagerHover: true,
    	timeout: 12000
	});
	
	$('.next_btn.for_1').click(function(){
	
		$('.location_image_container.for_1').cycle('next');
		
		return false;
	});
	
	$('.prev_btn.for_1').click(function(){
	
		$('.location_image_container.for_1').cycle('prev');
	
		return false;
	});
	
/* 	SLIDER 2								 */

	$('.location_image_container.for_2').cycle({ 
    	fx: 'scrollHorz', 
    	pause: true,
    	speed: 700,
    	pauseOnPagerHover: true,
    	timeout: 22000
	});
	
	$('.next_btn.for_2').click(function(){
	
		$('.location_image_container.for_2').cycle('next');
		
		return false;
	});
	
	$('.prev_btn.for_2').click(function(){
	
		$('.location_image_container.for_2').cycle('prev');
	
		return false;
	});
	

/* 	SLIDER 3								 */

	$('.location_image_container.for_3').cycle({ 
    	fx: 'scrollHorz', 
    	pause: true,
    	speed: 700,
    	pauseOnPagerHover: true,
    	timeout: 22000
	});
	
	$('.next_btn.for_3').click(function(){
	
		$('.location_image_container.for_3').cycle('next');
		
		return false;
	});
	
	$('.prev_btn.for_3').click(function(){
	
		$('.location_image_container.for_3').cycle('prev');
	
		return false;
	
	});

/* 	SLIDER 4								 */

	$('.location_image_container.for_4').cycle({ 
    	fx: 'scrollHorz', 
    	pause: true,
    	speed: 700,
    	pauseOnPagerHover: true,
    	timeout: 22000
	});
	
	$('.next_btn.for_4').click(function(){
	
		$('.location_image_container.for_4').cycle('next');
		
		return false;
	});
	
	$('.prev_btn.for_4').click(function(){
	
		$('.location_image_container.for_4').cycle('prev');
	
		return false;
	
	});
	
/* 	OUR WORK DELEGATE 						*/
	
	$("#our_work_holder").delegate('li', 'mouseover mouseout', function(e) {
		if(e.type == 'mouseover') {
			$(this).find('img').stop().fadeTo('fast', 0.5);
		} 
		if(e.type == 'mouseout') {
			$(this).find('img').stop().fadeTo('fast', 1);
		}
	});
	
/* 	NEWSLETTER CLEAR OUT 					*/
	
	$('.input_01').focus(function(){
	
		if($(this).val() == 'enter your email address') {
			
			$(this).val('');
			
		}
	
	});
	
	$('.input_01').blur(function(){
	
		if($(this).val() == '') {
			
			$(this).val('enter your email address');
			
		}
	
	});
	
/* 	PROCESS DIAGRAM TOOL TIP 				*/

	$('.process_diagram ul li').not('.process_one_of_a_kind').tooltip({
 				
		track: true,
		delay: 0,
		showURL: false,
		extraClass : "testing",
		top : -15,
		left : 5,
		fade: 250,
		fixPNG : true,
		showBody: " - ",
		bodyHandler : function(){
			
			return $('.' + $(this).find('a').attr('href')).html();
			
		}
		
	});
	
	$('.process_diagram ul li').not('.process_one_of_a_kind').find('a').click(function(){
		
		return false;
	
	})
	
/*	WHAT WE DO SCROLL				 	 */
	
	$(".top_scroll").click(function() {
		$('html, body').animate({scrollTop: '0px'}, 800);
		return false;
	});
	
	$("#questions li a").click(function() {
		var $p = $(this).position();
		var $p_x = String($p.top + 'px');
		$('html, body').animate({scrollTop: $p_x}, 800);
		return false;
	});
	
/* 	Fancybox Initalize						*/	
	$(".fb_image").fancybox();

/*  Product Zoomer 							*/
	$('.jqzoom').jqzoom({
        zoomType: 'innerzoom',
        preloadImages: false,
        alwaysOn:false,
        zoomWidth: 338,
        preloadText: 'Zoom is loading...',
        title: false
    });
    
/* 	Hide the bar when moused over a product */
	$(".product_thumb").delegate('.thumb_holder', 'mouseover mouseout', function(e) {
		if(e.type == 'mouseover') {
			$(".thumb_link").hide();
		} else {
			$(".thumb_link").show();
		}
	});    
});
/* 	Main Slideshow						 */
function start_slideshow(){
	
	$('.banner .banner_img').cycle({ 
    	fx: 'scrollHorz', 
    	speed: 1000,
    	pause: true,
    	pauseOnPagerHover: true,
    	timeout: 4000,
    	pager:  '.banner_pagination ul', 
		pagerAnchorBuilder: function(idx, slide) { 
	        return '<li><a href="#">' + (idx + 1) + '</a></li>'; 
	    } 
	});
	
	$('.next_arrow').click(function(){
	
		$('.banner .banner_img').cycle('next');
		
		return false;
	});
	
	$('.prev_arrow').click(function(){
	
		$('.banner .banner_img').cycle('prev');
	
		return false;
	});
	
}
