/* US Concrete Precast Group Plugins */

$(document).ready(function(){
   	
   	Cufon.replace('#main-nav li', {textShadow: '0 -1px #333333'});
	Cufon.replace('.current', {textShadow: '0 1px #FF1446'});
	Cufon.replace('.ribbon', {textShadow: '0 -1px #333333'});
	Cufon.replace('.block-head', {textShadow: '0 1px #FFFFFF'});
	Cufon.replace('.product-showcase h2, .product-wrap h3');

	// Home Page Scroller
   	   	$('#scroller').before('<div id="scroll-nav">').cycle({ 
   			fx:     	'fade', 
   			speed:   	1000, 
   			timeout: 	8000,
   			delay: 		-3000,
   			pause: 		1,
   			pager: 		'#scroll-nav'
   		});

	// Tabs
	var tabContainers = $('#tabs > div');
    $('#tabs-nav a').click(function () {
        tabContainers.hide().filter(this.hash).fadeIn('slow');

        $('#tabs-nav a').removeClass('active');
        $(this).addClass('active');

        return false;
    }).filter(':first').click();
		
	// Carousel 2
	$('#carousel').infiniteCarousel({
		displayProgressBar: false,
		padding: '5px'
	});
	  
	// Pretty Photo
	$('#carousel a').prettyPhoto({
		theme:'dark_rounded'
	});
	
	// Tool Tip
	$('.tooltip').tipTip({
		maxWidth: "auto", 
		edgeOffset: 10
	});
	
	// IE 6 Dropdown cructh
	$('.nav-sub li').mouseover(function(){
		$(this).addClass("hover");
	}).mouseout(function(){
		$(this).removeClass("hover");
	});
	
	// Drawing Matrix
	$('#dwg-matrix tbody tr').mouseover(function(){
		$(this).addClass("hover");
	}).mouseout(function(){
		$(this).removeClass("hover");
	});
	
	// Dynamic Filtering
	$('#dwg-filter li a').click(function() {
	$(this).css('outline','none');
	$('#dwg-filter .active').removeClass('active');
	$(this).parent().addClass('active');

	var filterVal = $(this).text().toLowerCase().replace(/ /ig,'-');
	
	if(filterVal == 'all') {
		$('#dwg-matrix tbody tr').fadeIn('slow').removeClass('hidden');
	} else {
			$('#dwg-matrix tbody tr').each(function() {
				if(!$(this).hasClass(filterVal)) {
					$(this).fadeOut('normal').addClass('hidden');
				} else {
					$(this).fadeIn('slow').removeClass('hidden');
				}
			});
	}
		return false;
	}); // end portfolio filter
	
	
   	// Search focus remove
	$('#search-site').focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});
	
	// List splitter
	$('.split').easyListSplitter({ colNumber: 2 });

}); // end doc ready

