$(document).ready(function() {
	//init the laptop service button
	//$('#laptopButton').css('background','#404040');
	
	$('.serviceNav').hover(function(){
		//if the hover button is not the first button, change the 1st buttons background
		if($(this).attr('id') !== "laptopButton"){
			// if the last button is being hovered, we need to show a special image
			// because its longer than the other buttons
			if($(this).attr('id')=="otherServicesButton")
				$(this).css('background','#404040');
			else
				$('#otherServicesButton').css('background','url(img/buttons/other_services_off.png)');
				
			$('#laptopButton').css('background','url(img/buttons/off.png)');
				
		}else{
			$('#laptopButton').css('background','#404040');
		}
	});
	
	$('.serviceNav').mouseleave(function(){
		$('#laptopButton').css('background','#404040');
		$('#otherServicesButton').css('background','url(img/buttons/other_services_off.png)');
	});

	/* show fancybox windows in iframe */
	$(".fancyb").click().fancybox({
		'width'				: '90%',
		'height'			: '75%',
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
				
	/* for slideshow */
	$(".ssbutton").click(function() {
		update_slideshow(this.id.substring(this.id.length-1));
	});	
	
	/*for login
	$(".ajaxbutton").click(function(){
		$("#loginMessage").css("background", "transparant").fadeIn("slow").html("Logging you in...");
		 
		var formData = {
			"username": $("#username").attr("value"),
			"password": $("#password").attr("value"),			
		}
					
		$.post("login.php", formData, function(data){
			if(data == 1){
				$("#loginMessage").css("background", "green").fadeIn("slow").html("Thank you for logging in!").delay(800).fadeOut("slow");
				window.location.href = "clients.php";
			}
			else{
				$("#loginMessage").css("background", "red").fadeIn("slow").html("username or password is incorrect").delay(800).fadeOut("slow");				
			}
			
		 });
	});
	*/
	
});
