$(document).ready(function () {
	
	/////////////////////////// WORK THUMBNAIL ROLLOVER COLOUR CHANGE
	$('.jobContainer').hover(function() {  
			$(this).find('.jobCopyContainer').stop().animate({ color:'#333333' }, 250);
			$(this).find('.plusIcon').stop().fadeTo(250, 1);
			$('.jobThumbContainer').stop().fadeTo(250, 0.3);
			$(this).find('.jobThumbContainer').stop().fadeTo(250, 1);
		},function() {  
			$(this).find('.jobCopyContainer').stop().animate({ color:'#999999' }, 350); 
			$(this).find('.plusIcon').stop().fadeTo(350, 0);
			$('.jobThumbContainer').stop().fadeTo(350, 1); 
			$(this).find('.jobThumbContainer').stop().fadeTo(350, 1);  
	});  
	
	/////////////////////////// THUMBNAIL ROLLOVER FADE
	$('.thumbContainer').hover(
		function() {
			$(this).stop().fadeTo(250, 0.6);
		},
		function() {
			$(this).stop().fadeTo(300, 1);
		}
	);
		
	/////////////////////////// CLEAR NEWSLETTER SIGNUP INPUT FIELD 
		$(function(){
			$('input[title], textarea[title]').each(function() {
				if($(this).val() === '') {
					$(this).val($(this).attr('title'));	
				}
				
				$(this).focus(function() {
					if($(this).val() == $(this).attr('title')) {
						$(this).val('').addClass('focused');	
					}
				});
				$(this).blur(function() {
					if($(this).val() === '') {
						$(this).val($(this).attr('title')).removeClass('focused');	
					}
				});
			});
		});
		
    /////////////////////////// FORM: NEWSLETTER SIGNUP
    $('#contactForm').ajaxForm(function(data) {
	    if (data==1){
	    	$('#successContact').fadeIn(500);
	        $('#bademailContact').fadeOut(300);
	        $('#contactForm').resetForm();
	        $('#contactForm').hide();
	    }
	    else if (data==2) $('#badserverContact').fadeIn("slow");
	    else if (data==3) {
	        $('#bademailContact').fadeIn("slow");
	        $('#contactFormEmail').focus();
	    }
    });
	
	twttr.anywhere(function (T) {
    	T.linkifyUsers();
    	T.hovercards();
  	});
  	
  	/////////////////////////// FORM: ANTI-SPAM
    $.get("http://strayjewellery.com/wp-content/themes/stray/token.php",function(txt){
	  $(".secure").append('<input type="hidden" name="ts" value="'+txt+'" />');
	});
    
});
