/*
	Any site-specific scripts you might have.
	Note that <html> innately gets a class of "no-js".
	This is to allow you to react to non-JS users.
	Recommend removing that and adding "js" as one of the first things your script does.
	Note that if you are using Modernizr, it already does this for you. :-)
*/

//jQuery.noConflict();
//jQuery(document).ready(function($){
	
$(document).ready(function() {	
								
	// Expand Panel
	$("#requestquote a").click(function(){
		$("div#panel").slideToggle("slow");
	});
	
	
	
	
	
	if($.cookie('TEXT_SIZE')) {
		$('body').addClass($.cookie('TEXT_SIZE'));	
	}
	$('.resizer a').click(function() {
		var textSize = $(this).parent().attr('class');
		$('body').removeClass('small medium large').addClass(textSize);
		$.cookie('TEXT_SIZE',textSize, { path: '/', expires: 10000 });
		return false;
	});
	
	
	
	
	
	
	
	
	
	
	$('.sub-menu').mouseleave(handleHover);
	
	function handleHover(e){
		Cufon.refresh();
	}
	
	$("a[rel='colorbox']").colorbox({transition:"elastic", width:"800px", height:"600px"});
	$("a[rel='colorbox2']").colorbox({transition:"elastic", width:"800px", height:"600px"});

	$('.slideshow')
		.after('<div id="cycleNav">')
		.cycle({ 
			fx:     	'fade',  
			timeout:  	4500,
			speed:  	1000, 
			pager:  	'#cycleNav', 
			next:   	'#next2', 
			prev:   	'#prev2',
			fastOnEvent: 500,
			pause: 		true
	});

	$('.slideshowSecond')
		.cycle({ 
			fx:     	'fade',  
			timeout:  	0,
			speed:  	1000, 
			fastOnEvent: 500,
			pause: 		true,
			pager:  	'#jCarouselUL',
			// callback fn that creates a thumbnail to use as pager anchor 
			pagerAnchorBuilder: function(idx, slide) { 
				return '<li><img src="' + $("img", slide).attr("src") + '" width="69" height="48" /></li>';
			}
	});
	
	$('#jCarouselUL').jcarousel({
		wrap: 'circular'
	});
	
	
	

});
