/*-----------------------------------------------------------------------
Preload CSS Background Images
------------------------------------------------------------------------*/

$(function() {
 //$.preloadCssImages(); 
});

/*-----------------------------------------------------------------------
Form Default Values
------------------------------------------------------------------------*/

$(function() {	   
 $('input[title!=""], select[title!=""], textarea[title!=""]').hint('focus'); 
});

/*-----------------------------------------------------------------------
Featured Clients
------------------------------------------------------------------------*/

$(function() {
	
	$('#feature-clients').cycle({ 
		fx: 'scrollUp',
        timeout: 5000,
		pause: true,
		next: '#fn-next a',
		prev: '#fn-prev a',
        speed:   1100,
        startingSlide: 0
    });
	
});

/*-----------------------------------------------------------------------
Showcase Clients
------------------------------------------------------------------------*/

$(function() {		   
						   
	$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) { 
     
	$(pager).find('a').removeClass('active') 
        .filter('a:eq('+currSlideIndex+')').addClass('active'); 
    }; 
	
	$('#showcase-clients').cycle({ 
		fx: 'scrollUp',
        timeout: 0,
		pause: true,
		next: '#pn-next a',
		prev: '#pn-prev a',
		height: '240px',
		pager: '#pager-numbers',
        speed:   1100,
        startingSlide: 0
    });
	
    $('#pn-one a').click(function() {$('#showcase-clients').cycle(0); return false;});	
    $('#pn-two a').click(function() {$('#showcase-clients').cycle(1); return false;});
	$('#pn-three a').click(function() {$('#showcase-clients').cycle(2); return false;});
	$('#pn-four a').click(function() {$('#showcase-clients').cycle(3); return false;});
	$('#pn-five a').click(function() {$('#showcase-clients').cycle(4); return false;});
	$('#pn-six a').click(function() {$('#showcase-clients').cycle(5); return false;});

	
});

/*-----------------------------------------------------------------------
Selected Client
------------------------------------------------------------------------*/

$(function() {		   
						   
	$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) { 
     
	$(pager).find('a').removeClass('active') 
        .filter('a:eq('+currSlideIndex+')').addClass('active'); 
    }; 
	
	$('#featured-client').cycle({ 
		fx: 'scrollUp',
        timeout: 0,
		pause: true,
		next: '#pn-next a',
		prev: '#pn-prev a',
		height: '368px',
		pager: '#pager-numbers',
        speed:   1100,
        startingSlide: 0
    });
	
    $('#pn-one a').click(function() {$('#featured-client').cycle(0); return false;});	
    $('#pn-two a').click(function() {$('#featured-client').cycle(1); return false;});
    $('#pn-three a').click(function() {$('#featured-client').cycle(2); return false;});	
    $('#pn-four a').click(function() {$('#featured-client').cycle(3); return false;});
    $('#pn-five a').click(function() {$('#featured-client').cycle(4); return false;});	
    $('#pn-six a').click(function() {$('#featured-client').cycle(5); return false;});
    $('#pn-seven a').click(function() {$('#featured-client').cycle(6); return false;});	
    $('#pn-eight a').click(function() {$('#featured-client').cycle(7); return false;});
    $('#pn-nine a').click(function() {$('#featured-client').cycle(8); return false;});	
    $('#pn-ten a').click(function() {$('#featured-client').cycle(9); return false;});
	
});

/*-----------------------------------------------------------------------
External Website
------------------------------------------------------------------------*/

$(function() {
	$('a.external').click(function() {
		window.open(this.href);
		return false;
	});
});
