jQuery(function( $ ){
	
// 	$('a[rel*=greybox]').greybox(); 
	
	function loadGreyBox() {
		$('a[rel*=greybox]').click(function(){
			$('.media_roller').hide();
			$.get($(this).attr("href"), function(data){
		  		$('#greybox_content').html(data);
		  		$('#greybox').fadeIn();
			});
			return false;
		});
		
		$('.podcast_embed').click(function(){
			$('.media_roller').hide();
			$('#greybox_content').html('<embed src="'+$(this).attr("href")+'" type="application/x-shockwave-flash" width="960" height="558" allowscriptaccess="always" allowfullscreen="true"></embed>');
	  		$('#greybox').fadeIn();
			return false;
		});
		
		$('a[rel*=greyiframe]').click(function(){
			$('.media_roller').hide();
			$('#greybox_content').html('<iframe src="'+$(this).attr("href")+'" width="935" height="540" scrolling="no" frameborder="0"></iframe>');
	  		$('#greybox').fadeIn();
			return false;
		});
		
		$('#greybox_close a').click(function(){
			$('#greybox_content').html("");
			$('#greybox').fadeOut();
			$('.media_roller').show();
		});
	}
	
	loadGreyBox();

	/* CONTACT FORM */
	$('#add_contact_form INPUT').focus(function(){
		if(($(this).val()=="Email")||($(this).val()=="First Name")||($(this).val()=="Last Name")||($(this).val()=="Email")||($(this).val()=="Zip Code")){
			$(this).val('');
		}
		/*
$('#add_contact_form INPUT').css({
			"background":"url(../img/mccartt_buttons.png) no-repeat left top",
			"color":"#b2d4eb"
		});
		$(this).css({
			"background":"url(../img/mccartt_buttons.png) no-repeat left bottom",
			"color":"#002b5c"
		});
*/
	});
	var form_options = {
		beforeSubmit: function(){
			fail = false;
			if($('#ContactFirstName').val() == ""){fail = true;}
			if($('#ContactLastName').val() == ""){fail = true;}
			if($('#ContactZip').val() == ""){fail = true;}
			if($('#ContactEmail').val() == ""){fail = true;}
			if(fail){
				alert('Please fill out all the fields.');
				return false;
			}
		},
		success: function(){
			//alert('Thanks for submitting your information!');
			$('#add_contact_form').html('Thanks for submitting your information!');
		}
	};
	$('#add_contact_form').ajaxForm(form_options);
	$('#add_contact_form a.submit').click(function() {
		$(this).parents("form").submit();
		return false;
	});
	$('#twitter_feed').getTwitter({
		userName: "tom_mechler",
		numTweets: 1,
		loaderText: "",
		slideIn: false,
		showHeading: false,
		showProfileLink: false
	});});
