$(document).ready(function(){
	// add mouseovers for tiles
	$('.tiles li')
		.hover(function() {
			$(this).find('img').stop().animate({ opacity: .2 }, 'medium');
		}, function() {
			$(this).find('img').stop().animate({ opacity: 1}, 'medium');
	});
	//
	function BeforeCycle(curr,next,opts) { 
		//$('ul#feature').hide();
		$('.content').hide();
	} 	
	function AfterCycle(curr,next,opts) { 
		$('.content')
		.hide()
		//.fadeIn(1200)
		.animate({
			height: 'toggle'
		  }, {
			duration: 2500, 
			specialEasing: {
			  height: 'easeOutQuint'
			}, 
			complete: function() {
			 // $(this).after('<div>done!</div>');
			}
		  });
	} 
		$('ul#feature')
			.cycle({ 
				before:  BeforeCycle, 
				after:  AfterCycle, 
				fx: 'fade', 
				easeIn: 'easeInQuint', 
				easeOut: 'easeOutQuint', 
				timeout:  10000,
				cleartype: true,
				cleartypeNoBg: true,
				speedIn:  1000, 
				speedOut:  500
			}			
		);	
	//		
	$('#signUp #cons_email').focus(function () {
		$(this).addClass('uFocus');
		if( $(this).val()=='Email*' ) {
			$(this).val('');
		}
	});
	$('#signUp #cons_zip_code').focus(function () {
		$(this).addClass('uFocus');
		if( $(this).val()=='Zip/Postal code*' ) {
			$(this).val('');
		}
	});
	$('#signUp #cons_first_name').focus(function () {
		$(this).addClass('uFocus');
		if( $(this).val()=='First name' ) {
			$(this).val('');
		}
	});
	//restore login form text
	$('#signUp #cons_email').blur(function () {
		$(this).removeClass('uFocus');
		if( $(this).val()=='') {
			$(this).val('Email*');
		}
	});
	$('#signUp #cons_zip_code').blur(function () {
		$(this).removeClass('uFocus');
		if( $(this).val()=='') {
			$(this).val('Zip/Postal code*');
		}
	});
	// font replacement
	  Cufon.replace('h1 , h2 , h3', {
		  hover: true
	  });
	  Cufon.replace('ul#primary-links li a', {
		  hover: true
	  });
	  Cufon.replace('ul#feature li h3', {
		  hover: false
	  });
	  Cufon.replace('ul#feature li p.fact', {
		  hover: false
	  });
	//
	//var what = $('ul#primary-links a').text();
	//$('ul#primary-links a').text(what + 'test');
    // reload cufon on carousel wrap
    $('#caro_1').jcarousel({
    	wrap: 'circular',
		easing: 'easeOutQuint',
		animation: 'slow'//,
     // itemVisibleInCallback: {onBeforeAnimation: ItemVisibleInCallback}
    });
	// tweets
/*	$(".tweet").tweet({
		username: "girlup",
		join_text: "auto",
		avatar_size: 50,
		count: 3,
		auto_join_text_default: "we said,",
		auto_join_text_ed: "we",
		auto_join_text_ing: "we were",
		auto_join_text_reply: "we replied to",
		auto_join_text_url: "we were checking out",
		loading_text: "loading tweets..."
	 });*/
	
	
	//search form: focus elements
	$('#cons_searchterm').focus(function () {
		$(this).addClass('uFocus');
		if( $(this).val()=='Search' ) {
			$(this).val('');
		}
	});
	//restore login form text
	$('#cons_searchterm').blur(function () {
		$(this).removeClass('uFocus');
		if( $(this).val()=='') {
			$(this).val('Search');
		}
	});
	
	

});


