// JavaScript Document
$(document).ready(function() {

	$("#portfolio_fade").fadeOut(500, function() {

			$("#portfolio_fade").load("portajax.php");
			
	});
	$("#portfolio_fade").fadeIn(500, function() {
		$("a.portfolioimage").fancybox({
			'zoomSpeedIn': 600, 'zoomSpeedOut': 500,
	
	 		'imageScale': true,
	 		'overlayShow': true,
	 		'overlayOpacity': .7,
	 		'hideOnContentClick': false
	
		}); 
	});
	
	//SEARCH HOVER
	$("input#search_button").hover(function(e) {
			$(e.target).addClass("hover");		
		}, function(e){
			$(e.target).removeClass("hover");		
	});//END SEARCH HOVER
	
	//Drop Down Menu
	$("ul#top_nav li.drop_down_active").hover(function(e) {
		$(".drop_down").css("display", "none");
		$(e.target).parent().find(".drop_down").css("display", "block");
		
	}, function(e) {
			$(e.target).parent().find(".drop_down").css("display", "none");
	});
	
	$(".drop_down").hover(function(e) {

	}, function(e) {
		$(".drop_down").css("display", "none");
	});
	
	//Seach Box
	$('#search').blur(function(e) {
		if(this.value == "") {
			$(this).val("Product Search");
			$(this).css('color','#999999');
		}
	});
	
	$('#search').focus(function(e) {
		$(this).css('color','#111111');
		if(this.value == "Product Search") {
			$(this).val("");
			
		}
	});
	
	//PORTFOLIO FADE
	$("#portfolio_prev").click(function() {
		$("#portfolio_fade").fadeOut(300, function() {
			$("#portfolio_fade").load("portajax.php?f=back",'', function(){
				$("#portfolio_fade").fadeIn(300, function() {
					$("a.portfolioimage").fancybox({
						'zoomSpeedIn': 600, 'zoomSpeedOut': 500,
				
				 		'imageScale': true,
				 		'overlayShow': true,
				 		'overlayOpacity': .7,
				 		'hideOnContentClick': false
				
					}); 
				});
			});
		});

		return false;
	});

	$("#portfolio_next").click(function() {
		$("#portfolio_fade").fadeOut(300, function() {
			$("#portfolio_fade").load("portajax.php?f=next",'', function(){
				$("#portfolio_fade").fadeIn(300, function() {
					$("a.portfolioimage").fancybox({
						'zoomSpeedIn': 600, 'zoomSpeedOut': 500,
				
				 		'imageScale': true,
				 		'overlayShow': true,
				 		'overlayOpacity': .7,
				 		'hideOnContentClick': false
				
					}); 
				});
			});
		});

		return false;
	});		
	
	/* This is basic - uses default settings */
	
	$(".fancy").fancybox({
		'zoomSpeedIn':		0, 
		'zoomSpeedOut':	0, 
		'hideOnContentClick': true,
		'overlayShow': true,
		'frameWidth': 700,
		'frameHeight': 300,
		'overlayOpacity': .7
	});

	$("a.portfolioimage").fancybox({
		'zoomSpeedIn': 600, 'zoomSpeedOut': 500,

 		'imageScale': true,
 		'overlayShow': true,
 		'overlayOpacity': .7,
 		'hideOnContentClick': false

	}); 	
	

});//END JS