	$(document).ready(
		function(){
		
			
			/* -- home links hover */
			$("ul#home-links li a").hover(function(){
				$(this).addClass('hovered', 1000);
			},function(){
				$(this).removeClass('hovered', 1000);
			});
			
			
			/* -- header fade in */
			
			$("#header-photo").hide();
			$("#header-photo").fadeIn(1500);
			$("#footer-nysh").hide();
			$("#footer-nysh").fadeIn(2500);
			
			
			/* -- header photos -- */
			
			$('#header-photo').innerfade({
				animationtype: 'fade',
				speed: 1000,
				timeout: 7500,
				type: 'sequence',
				containerheight: '422px'
			});
			
			/* -- start rotator -- */
			$('.slideshow').divSlideShow({
				width:1000, 
				height:422, 
				arrow:'split', 
				leftArrowClass:'dss-arrow', 
				rightArrowClass:'dss-arrow', 
				controlHoverClass: 'dss-active',
				controlActiveClass: 'dss-active',
				delay:5000, 
				loop:100
			} );
			
			
			/* -- services background move -- */
			var clientInterval = 2500;
			function clientAnimate() { 
				$("#left-clients").animate({ backgroundPositionY: '-=160px' }, clientInterval, 'linear'); 
			}
			clientAnimate(); 
			$("#left-clients").everyTime(clientInterval, function (){ clientAnimate(); }); 

			/* -- events box -- */
			$("#view-all-events").click(
				function(){
					$("#eventsBox").fadeIn(500);
					$("body").addClass("no-overflow");
				}
			);
			$("#close-all-events").click(
				function(){
					$("#eventsBox").fadeOut(500);
					$("body").removeClass("no-overflow");
				}
			);


			/* -- newsletter input -- */
			$("#mce-EMAIL").focus(
				function(){
					$("#mce-EMAIL").removeClass("newsletter_email_idle");
					$("#mce-EMAIL").addClass("newsletter_email_focus");
					$("#mce-EMAIL").val("");
				}
			);
			$('#mce-EMAIL').blur(function()
			{
			    if($('#mce-EMAIL').val().length === 0 ) {
			        $("#mce-EMAIL").removeClass("newsletter_email_focus");
					$("#mce-EMAIL").addClass("newsletter_email_idle");
					$("#mce-EMAIL").val("E-mail");
			    }
			});
			

			
		}
	);
	
	/* custom lightbox - npc */
	
	$(document).ready(
		function(){
			var lightbox_html = $("#lightbox_content").html();
			var lightbox_servvid_html = '<iframe src="http://player.vimeo.com/video/30711927?title=0&amp;byline=0&amp;portrait=0&amp;autoplay=1" width="601" height="338" style="border: 0;"></iframe>';
			$("#lightbox_content").html('');
			$("#lightbox_open").click(
				function(){
					$("#lightbox_overlay").fadeIn(500);
					$("#lightbox_wrapper").delay(500).fadeIn(500);
					$("#lightbox").delay(500).fadeIn(500);
					$("body").addClass("no-overflow");
					$("#lightbox").delay(500).html(lightbox_html);
				}
			);
			
			$("#lightbox_serv_open").click(
				function(){
					$("#lightbox_overlay").fadeIn(500);
					$("#lightbox_wrapper").delay(500).fadeIn(500);
					$("#lightbox").delay(500).fadeIn(500);
					$("body").addClass("no-overflow");
					$("#lightbox").delay(500).html(lightbox_servvid_html);
				}
			);

			
			$("#lightbox_close").click(
				function(){
					$("#lightbox_overlay").delay(500).fadeOut(500);
					$("#lightbox_wrapper").fadeOut(500);
					$("body").removeClass("no-overflow");
					$("#lightbox").html('');
				}
			);
		}
		
		
	);
	
	$(document).ready(
		function(){
			$('#contact_form input').focus(function()
			{
				$(this).removeClass("Blur");
			    $(this).addClass("focus");
			    $(this).val("");
			});
			
			$('#contact_form blur').focus(function()
			{
			    if($("input", this).val().length === 0 ) {
			        $(this).removeClass("focus");
					$(this).addClass("blur");
			    }
			});
			$('#contact_message').focus( function() { $('#contact_message').val(""); } )
		}
	);
	
	
	/* contact form */
	function showContact() { 
		$('html, body').animate({scrollTop: 0}, 500); 
		$('#contact-wrapper').delay(750).slideToggle(500); 
	}
	
	$('#contact_form input').blur(function() {
	    if($("input", this).val().length === 0 ) {
	        $("input", this).removeClass("focus");
			$("input", this).addClass("blur");
			$("input", this).val("E-mail");
	} });
	
	
	function submitContact() {
		  
		var error = false;  
	    var name = $('#contact_name').val(); 
	    var email = $('#contact_email').val();   
	    var message = $('#contact_message').val();  
		
		if(name.length == 0){  
			var error = true;  
		}
		if(email.length == 0 || email.indexOf('@') == '-1'){  
			var error = true;  
		}
		if(message.length == 0){  
			var error = true;  
		}
		
		

		if(error == false){  
        	$('#contact_form_submit a').slideToggle(500); 
        	$('#contact_form_success').delay(500).slideToggle(500); 
			$.post("http://www.360w3.com/clients/vvp/assets/php/mailer.php", $("#contact_form").serialize(),function(result){
	            if(result == 'sent'){ 
	            	// yes
	            }else{ 
	            	// no
	        	}  
			});
   
		} 
		
	}

