	$(document).ready(function() { 
	
		$("#Form_Form").bind("keypress", function(e) {
		  if (e.keyCode == 13) return false;
		});
		
		$("#submitbutton").click(function() {
			$("#Form_Form").submit();
		});
		
		$(".checkbox").click(function() {
			
			$("#next1").hide();
			
			$("input.checkbox:checked").each(
				function() {
					$("#next1").show();
				}
			);		
			
		});
		
		$(".add-to-bag").click(function() {
			$(this).hide();			
		});		
		
		$("input#Form_Form_Agree").click(function() {
			
			$("#submitbutton").hide();
			
			$("input#Form_Form_Agree:checked").each(
				function() {
					$("#submitbutton").show();
				}
			);
		});

		$(".portfolio-item").hover(
			function () {
				$(this).children().children(".portfolio-item-overlay").fadeTo(400, 0.8, function(){});
			}, 
			function () {
				$("div.portfolio-item-overlay").hide();
			}
		);		
		
        $(".box-wt-beta .text input, .box-wt-beta .email input, .box-wt-beta .textarea textarea, .box-wt-beta input.text, #search input").click(function() {
                $(this).attr("value","");
        });
		
		$(".next-button").click(function() {
			$(this).parent().hide();
			$(this).parent().next("fieldset").show();
		});
		
		$(".previous-button").click(function() {
			$(this).parent().hide();
			$(this).parent().prev("fieldset").show();
		});		
					
		$("#feature-gallery").cycle({ 
			speed:  'slow', 
			timeout: 0, 
			next:   '.next', 
			prev:   '.prev'
		});

		$("#hero-slider").cycle({ 
			fx: 'scrollHorz',
			speed:  'slow', 
			timeout: 3000,
			pause: true
		});
		

		$("#feature-gallery-wrap").hover(
		  function () {
		    $("#feature-gallery-pagination").show();
		  }, 
		  function () {
		    $("#feature-gallery-pagination").hide();
		  }
		);

		$("#project-gallery").cycle({ 
			speed:  'slow', 
			timeout: 0, 
			next:   '.next', 
			prev:   '.prev'
		});

		$("#project-gallery-wrap").hover(
		  function () {
		    $("#project-gallery-pagination").show();
		  }, 
		  function () {
		    $("#project-gallery-pagination").hide();
		  }
		);

		/*
		function onBefore_project() { 
			var imgCount = $("div#project-gallery img").length;
			$('#current-count').html("0"+imgCount); 
		}
		
		function onAfter_project() { 
			$('#current-pos').html(this.alt);
		}			
		*/

        $('#image-gallery-thumbs-inner a').click(function(){
           $('#image-gallery-large img').remove();
           $('#loading').show();
            var href = $(this).attr('href')
            var img = new Image();
            $(img).load(function(){
                $('#image-gallery-large').append(img);
                $('#loading').hide();
            }).attr('src',href);
            return false;
        });				
		
		$("a.fancy").fancybox({
			'titleShow' : false
		});	

		$("div#product-slider-wrap").carousel({ pagination: false } );
		
		swapValue = [];
		$(".swap-value, input.nolabel, textarea.nolabel").each(function(i){
		   swapValue[i] = $(this).val();
		   $(this).focus(function(){
			  if ($(this).val() == swapValue[i]) {
				 $(this).val("");
			  }
			  $(this).addClass("focus");
		   }).blur(function(){
			  if ($.trim($(this).val()) == "") {
				 $(this).val(swapValue[i]);
			 $(this).removeClass("focus");
			  }
		   });
		});	

		$('.alumni-launch').popupWindow({ 
			height:700, 
			width:840,
			scrollbars: 1,
			resizable: 1,
			centerBrowser:1 
		});		
		
		//$(".alumni-launch").trigger('click');
		$("a.alumni-launch").trigger('click',function(){
			alert('test');
		});		

		$(".career-alpha h2 a").click(function() {
			$('.career-alpha-text:visible').slideToggle('fast');
			$(this).parent().siblings('.career-alpha-text').slideToggle('fast');
		});
		
	});
	
	function footer_post() {
		var offset = $("#footer").offset();
		
		if (offset.top <= 670) {
			$("#footer").css("position","absolute").css("top","670px");
		}	
	}

	Cufon.replace('#navigation li', {
		fontFamily: 'tradegothic',
		hover: true,
		hoverables: { a: true }
	});	
	
	Cufon.replace('.section-header h2', {
		fontFamily: 'helvetica',
		hover: true,
		hoverables: { a: true }
	});
