﻿// Functions specific to a site.

(function($) {
	$(document).ready(function() {
		// Place document manipulation code here
		Cufon.replace('h1,.didyouknow');

		var showText='Show';
		var hideText='Hide';
		
		var is_visible = false;
		
		$('.toggle').hide();
		$('a.toggleLink').click(function() {		
			is_visible = !is_visible;
			
			$(this).parent().next('.toggle').toggle('slow');
			return false;
		});

	}); 
})(jQuery);

$(document).ready(function() {

});

Cufon.replace(".home-title, .home-subtitle, .home-overview", { fontFamily: 'Lucida Sans Unicode' }); 


jQuery('#home-banner')
.before('<div id="banner-tabs"><ul>') 
.cycle({ 
    fx:     'fade', 
    speed:  '800', 
    timeout: 4000, 
	autostop: 1, 
    pager:  '#banner-tabs ul',
	pagerEvent: 'mouseover', 
	pagerAnchorBuilder: function(idx, slide) {
		var anchor = '';
		anchor = '<li><a href="#" id="btn-cycle-' + (idx + 1) + '">' + (idx + 1) + '</a></li>';
		return anchor;
	}

});

function pagerLink() {
	location.href = $(this).attr('href');
}
function createLinks(query, href) {
	$(query).attr('href', href).click(pagerLink);
}
createLinks("#btn-cycle-2", '/industry-applications/aquaculture-tank-systems.html');
createLinks("#btn-cycle-3", '/industry-applications/agriculture.html');
createLinks("#btn-cycle-4", '/industry-applications/vehicle-wash-walls.html');
createLinks("#btn-cycle-5", '/industry-applications/industrial.html');
createLinks("#btn-cycle-6", '/industry-applications/food-processing.html');
createLinks("#btn-cycle-7", '/industry-applications/bio-mass-wastewater-tanks.html');
createLinks("#btn-cycle-8", '/industry-applications/concrete-storage-tanks.html');

/*$("#btn-cycle-2").attr('href', '/industry-applications/aquaculture-tank-systems.html').click(pagerLink);
$("#btn-cycle-3").attr('href', '/industry-applications/agriculture.html').click(pagerLink);
$("#btn-cycle-4").attr('href', '/industry-applications/vehicle-wash-walls.html').click(pagerLink);
$("#btn-cycle-5").attr('href', '/industry-applications/industrial.html').click(pagerLink);
$("#btn-cycle-6").attr('href', '/industry-applications/food-processing.html').click(pagerLink);
$("#btn-cycle-7").attr('href', '/industry-applications/bio-mass-wastewater-tanks.html').click(pagerLink);
$("#btn-cycle-8").attr('href', '/industry-applications/concrete-storage-tanks.html').click(pagerLink);*/
