/*******************************************************************************

	CSS on Sails Framework
	Title: Exact Staff
	Author: XHTMLized (http://www.xhtmlized.com/)
	Date: June 2011

*******************************************************************************/

$(document).ready(function() {

	//
	Cufon.replace('#header dl dt, #navigation li, #footer .box h4, #content .clients-wrapper h4, #content > h1, #content > h2, #content > h3, #content .features-inner .feature h2, #content .testimonials-wrapper h4, #content .mainbox h4, #content .mainbox2 h4, #sidebar h2, #sidebar .job-seeker ul li a, #sidebar .subscribe fieldset > label', { fontFamily: 'MyriadPro-Regular', hover: true });
	Cufon.replace('#header .contact-social li, #header form ul li a', { fontFamily: 'MyriadPro-Semibold', hover: true });
	Cufon.replace('#content .feature-wrapper div h3 a', { fontFamily: 'MyriadPro-SemiboldCond', hover: true });
	//
	$("#navigation > li:not('active')").hover(
		function () {
			Cufon.replace($(this).children('span'), { fontFamily: 'MyriadPro-Regular', hover: true, color: '#00a447' });
		},
		function () {
			Cufon.replace($(this).children('span'), { fontFamily: 'MyriadPro-Regular', hover: true, color: '#4a4a4a' });
		}
	);
	//
	$("#content .feature-wrapper div").hover(
		function () {
			Cufon.replace($(this).children('h3').children('a'), { fontFamily: 'MyriadPro-SemiboldCond', hover: true, color: '#ff7f14' });
		},
		function () {
			Cufon.replace($(this).children('h3').children('a'), { fontFamily: 'MyriadPro-SemiboldCond', hover: true, color: '#4a4a4a' });
		}
	);

	//
	$("#navigation > li:has('ul')").addClass('sub');

	//
	$( "#sidebar .subscribe .checkbox" ).buttonset();

	//
	$('#sidebar .subscribe fieldset label').click(function(){
		return false;
	});

	//
	$('input[type="text"]').each(function() {
		var defaultValue = this.value;
		$(this).focus(function() {
			if(this.value == defaultValue) {
				this.value = '';
			}
		});
		$(this).blur(function() {
			if(this.value == '') {
				this.value = defaultValue;
			}
		});
	});

});

$(window).load(function() {

	//
	$('#slider').nivoSlider({
	effect: 'fade',
	pauseTime: 5000,
});
	//
	$('#content .clients-wrapper .clients').cycle({
		fx: 'scrollHorz',
		next: '#content .clients-wrapper .next',
		prev: '#content .clients-wrapper .prev'
	});

	//
	$('#content .testimonials-wrapper .testimonials').cycle({
		fx: 'scrollHorz',
		prev: '#content .testimonials-wrapper .prev',
		next: '#content .testimonials-wrapper .next'
	});



});

$(".toggle_title").toggle(
		function(){
			$(this).addClass('toggle_active');
			$(this).siblings('.toggle_content').slideDown("fast");
		},
		function(){
			$(this).removeClass('toggle_active');
			$(this).siblings('.toggle_content').slideUp("fast");
		}
	);


