var load_youtube = function (video_id) {
	var youtube_embed = '<div style="text-align: right;"><a class="simplemodal-close" href="#" style="color: #fff;">Close Window</a></div><iframe width="640" height="510" src="http://www.youtube.com/embed/' + video_id + '?autoplay=1" frameborder="0" allowfullscreen></iframe>';
	$.modal(youtube_embed, { overlayClose: true });
	return false;
};

jQuery(document).ready(function($) {
	
	function init(){
		setupSwitcher();
		setupConnect();
	}

	function setupSwitcher() {
		$('#switcher li a').mouseover(function(){
			if(!$(this).hasClass('active')) {
				$(this).animate({ marginTop: 0, marginBottom: 0, paddingTop: 5, paddingBottom: 5 }, 100, function() {  });
			}
		});

		$('#switcher li a').mouseout(function(){
			if(!$(this).hasClass('active')) {
				$(this).animate({ marginTop: 4, marginBottom: 2, paddingTop: 2, paddingBottom: 2 }, 100, function() { });
			}
		});
	}
	
	function setupConnect() {
		$("#connect ul.connect_with_us").css({ 
			display: 'none'
		});
		$('#connect').mouseenter(function(){
			//$(this).animate({ height: 100 }, 200, function() { });
			$("#connect ul").stop(false, true);
			$("#connect ul").slideDown('fast');
		});
		$('#connect').mouseleave(function(){
			//$(this).animate({ height: 20 }, 200, function() { });
			$("#connect ul").stop(false, true);
			$("#connect ul").slideUp(400);
		});
	}

	init();
	
	var default_values = new Array();

	$("input.default-value").focus(function() {
		$(this).removeClass('grayed');
		if (!default_values[this.id]) {
			default_values[this.id] = this.value;
        }
        if (this.value == default_values[this.id]) {
			this.value = '';
        }
        $(this).blur(function() {
			if (this.value == '') {
				this.value = default_values[this.id];
				$(this).addClass('grayed')
			}
        });
	});
	
	Cufon.replace('.cufon-link', { hover: true });
	Cufon.replace('.cufon');
});
