// JavaScript Document

	$(document).ready(function(){
		$("a[rel^='prettyPhoto1']").prettyPhoto({
			animationSpeed: 'normal', /* fast/slow/normal */
			padding: 40, /* padding for each side of the picture */
			opacity: 0.9, /* Value betwee 0 and 1 */
			showTitle: true, /* true/false */
			allowresize: true, /* true/false */
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_rounded' /* light_rounded / dark_rounded / light_square / dark_square */
		});
		$("a[rel^='prettyPhoto2']").prettyPhoto({
			animationSpeed: 'normal', /* fast/slow/normal */
			padding: 40, /* padding for each side of the picture */
			opacity: 0.9, /* Value betwee 0 and 1 */
			showTitle: true, /* true/false */
			allowresize: true, /* true/false */
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_rounded' /* light_rounded / dark_rounded / light_square / dark_square */
		});
		$("a[rel^='prettyPhoto3']").prettyPhoto({
			animationSpeed: 'normal', /* fast/slow/normal */
			padding: 40, /* padding for each side of the picture */
			opacity: 0.9, /* Value betwee 0 and 1 */
			showTitle: true, /* true/false */
			allowresize: true, /* true/false */
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_rounded' /* light_rounded / dark_rounded / light_square / dark_square */
		});	
	
		$("a[rel^='prettyPhoto4']").prettyPhoto({
					animationSpeed: 'normal', /* fast/slow/normal */
					padding: 40, /* padding for each side of the picture */
					opacity: 0.9, /* Value betwee 0 and 1 */
					showTitle: true, /* true/false */
					allowresize: true, /* true/false */
					counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
					theme: 'light_rounded' /* light_rounded / dark_rounded / light_square / dark_square */
				});	
	// $Id: jquery_csspngfix.src.js,v 1.0 2008/06/14 18:29:32 skilip Exp $
	// IE6 PNG FIX
	jQuery.fn.cssPNGFix = function(sizingMethod) {
	  var sizingMethod = (sizingMethod) || 'scale';
	  if($.browser.msie && parseInt($.browser.version) < 7) {
		 $(this).each(function() {
			var css_bg_img = $(this).css('background-image');
			var bg_img = css_bg_img.substring(5, css_bg_img.length - 2);
			$(this).css({'background':'none', 'filter':'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + bg_img + '", sizingMethod="' + sizingMethod + '")'});
		 });
	  };
	  return $(this);
	};
	
	jQuery.fn.imgPNGFix = function(sizingMethod) {
	  var sizingMethod = (sizingMethod) || 'scale';
	  if($.browser.msie && parseInt($.browser.version) < 7) {
		 $(this).each(function() {
			var spacer_src = Drupal.settings.spacer_src;
			var the_img = $(this);
			var src = $(this).attr('src');
			$(the_img).attr('src', spacer_src);
			$(the_img).css({
			  'background':'none',
			  'filter':'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '", sizingMethod="' + sizingMethod + '")'
			});
		 });
	  };
	  return $(this);
	};
	
	$(function() {
	
	  if($.browser.msie && parseInt($.browser.version) < 7) {
		 $('.png_bg').each(function() {
			var css_bg_img = $(this).css('background-image');
			var bg_img = css_bg_img.substring(5, css_bg_img.length - 2);
			$(this).css({'background':'none', 'filter':'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + bg_img + '", sizingMethod="image")'});
		 });
		 $('.png_img').imgPNGFix('image');
	  };
	});		

	var view = "special";
		
	$("#viewSpecial1").click(function(){

		$("#middle_content").css("color", "fff").fadeOut(500, function(){
		
			if(view == "special")
			{
				$(this).load("specials/summer09/?ajax=1", function(){
					$(this).fadeIn(1700,function() {
						if ($.browser.msie)
							this.style.removeAttribute('filter');
						}
					);												 
				});	
				view = "main";
			}
			else 
			{
-
				$(this).load("specials/?ajax=1", function(){
					$(this).fadeIn(1700,function() {
						if ($.browser.msie)
							this.style.removeAttribute('filter');
						}
					);												 
				});	
				
				view = "special";
			}
			
			$("#middle_content").css("color", "000");
			
		});
	
		$(".productSubList").html("Tent Sizes");

	});	
	
	$("#viewSpecial01").mouseover(function(){
		$(this).css("color","green");						   
		}).mouseout(function(){
			$(this).css("color","red");	
		});
	$("#viewSpecial01").click(function(){

		$("#middle_content").css("color", "fff").fadeOut(500, function(){
		
			//if(view == "special")
			//{
				$(this).load("specials/2010_book_early/?ajax=1", function(){
					$(this).fadeIn(1700,function() {
						if ($.browser.msie)
							this.style.removeAttribute('filter');
						}
					);												 
				});	
				view = "main";
			//}
			//else 
			//{

				//$(this).load("specials/?ajax=1", function(){
				//	$(this).fadeIn(1700,function() {
				//		if ($.browser.msie)
				//			this.style.removeAttribute('filter');
				//		}
				//	);												 
				//});	
				
				//view = "special";
			//}
			
			$("#middle_content").css("color", "000");
			
		});
	
		$(".productSubList").html("Tent Sizes");

	});		
	
	
	$("#viewSpecial02").mouseover(function(){
		$(this).css("color","green");						   
		}).mouseout(function(){
			$(this).css("color","red");	
		});
	$("#viewSpecial02").click(function(){

		$("#middle_content").css("color", "fff").fadeOut(500, function(){
		
			//if(view == "special02")
			//{
				$(this).load("specials/holidayhangover10/?ajax=1", function(){
					$(this).fadeIn(1700,function() {
						if ($.browser.msie)
							this.style.removeAttribute('filter');
						}
					);												 
				});	
				//view = "main";
			//}
			//else 
			//{

				//$(this).load("specials/?ajax=1", function(){
				//	$(this).fadeIn(1700,function() {
				//		if ($.browser.msie)
				//			this.style.removeAttribute('filter');
				//		}
				//	);												 
				//});	
				
				//view = "special02";
			//}
			
			$("#middle_content").css("color", "000");
			
		});
	
		$(".productSubList").html("Tent Sizes");

	});		
	


	$("#viewSpecial2").click(function(){

		$("#middle_content").css("color", "fff").fadeOut(500, function(){
		
			//if(view == "special")
			//{
				$(this).load("specials/lighttowers/?ajax=1", function(){
					$(this).fadeIn(1700,function() {
						if ($.browser.msie)
							this.style.removeAttribute('filter');
						}
					);												 
				});	
			//}
/*			else 
			{
-
				$(this).load("specials/?ajax=1", function(){
					$(this).fadeIn(1700,function() {
						if ($.browser.msie)
							this.style.removeAttribute('filter');
						}
					);												 
				});	
				
				view = "special";
			}*/
			
			$("#middle_content").css("color", "000");
			
		});
		
		$("#closeSpecial").click(function(){
				$(this).load("specials/?ajax=1", function(){
					$(this).fadeIn(1700,function() {
						if ($.browser.msie)
							this.style.removeAttribute('filter');
						}
					);												 
				});	
				
				view = "special";
				
		});
	
		$(".productSubList").html("Tent Sizes");

	});	

	$("#viewSpecial1").tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		extraClass: "pretty",
		fixPNG: true,
		left: -130,
		top: -260
	});
	
	$("#viewSpecial2").tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		extraClass: "pretty",
		fixPNG: true,
		left: -130,
		top: -260
	});
		

	
	});