
		 
	$(document).ready(function() {	
		
		
		if ($.browser.msie && $.browser.version.substr(0,1)<9) {
			// IE 8 and lower specific jQuery
		}
		else {
		
			// Changing all links to anchors
			$('#home_button').attr("href", "#home");
			$('#home_button2').attr("href", "#home");
			$('#about_button').attr("href", "#about");
			$('#sqezy_button').attr("href", "#sqezy");
			$('#sqezy_lrg_link').attr("href", "#sqezy");
			$('#sqezy1_button').attr("href", "#sqezy1");
			
			$('#wizz_button').attr("href", "#wizz");
			$('#wizz_lrg_link').attr("href", "#wizz");
			$('#wizz-germ-killers_button').attr("href", "#wizz-germ-killers");
			$('#wizz-kitchen_button').attr("href", "#wizz-kitchen");
			$('#wizz-bathroom_button').attr("href", "#wizz-bathroom");
			$('#wizz-floorcare_button').attr("href", "#wizz-floorcare");
			$('#wizz-carpet-and-upholstery_button').attr("href", "#wizz-carpet-and-upholstery");
			$('#wizz-laundry_button').attr("href", "#wizz-laundry");
			
			$('#stardrops_button').attr("href", "#stardrops");
			$('#stardrops_lrg_link').attr("href", "#stardrops");
			$('#stardrops-heritage_button').attr("href", "#stardrops-heritage");
			$('#stardrops-household_button').attr("href", "#stardrops-household");
			$('#stardrops-protects_button').attr("href", "#stardrops-protects");
			$('#stardrops-kitchen_button').attr("href", "#stardrops-kitchen");
			$('#stardrops-bathroom_button').attr("href", "#stardrops-bathroom");
			$('#stardrops-laundry_button').attr("href", "#stardrops-laundry");
			
			$('#pinkstuff_button').attr("href", "#pinkstuff");
			$('#pinkstuff_lrg_link').attr("href", "#pinkstuff");
			$('#pinkstuff-household_button').attr("href", "#pinkstuff-household");
			
			$('#datasheets_button').attr("href", "#datasheets");
			
			$('#alur_button').attr("href", "#alur");
			$('#alur_lrg_link').attr("href", "#alur");
			$('#alur1-button').attr("href", "#alur1");
			$('#alur2-button').attr("href", "#alur2");
			$('#alur3-button').attr("href", "#alur3");
			
			$('#contact_button').attr("href", "#contact");
		}
		
		/*$('a.panel').live("click",function () {
			        
			$('#wrapper').scrollTo($(this).attr('href'), 800, {onAfter:function(){ 
				
			} });	
			
			return false;
						
		});	*/
		
		$(this).localScroll({
			   target:'#wrapper',
			   lazy:'true',
			   axis:'xy',
			   hash: 'true'
			});
			
		$('#sqezy_products').load('assets/inc/sqezy_products.php');
		$('#wizz_products').load('assets/inc/wizz_products.php');
		$('#stardrops_products').load('assets/inc/stardrops_products.php');
		$('#pinkstuff_products').load('assets/inc/pinkstuff_products.php');
		$('#alur_products').load('assets/inc/alur_products.php');
		$('#about_section').load('assets/inc/about_section.php');
		$('#datasheets_section').load('assets/inc/datasheets.php');
		
		//contact form - added by Rich
			$("#contactForm #btnSubmit").before('<ul class="errors"></ul>');
			$("#contactForm").validate({
				errorElement: 'span',
				errorLabelContainer: "#contactForm ul.errors",
				wrapper: "li",
				rules: {
					cfEmail: {
						required: true,
						email: true
					},
					cfSubject: "required",
					cfMessage: "required"
				},
				messages: {
					cfEmail: {
						required: "Please enter your email address.",
						email: "Please enter a valid email address."
					},
					cfSubject: "Please enter a subject.",
					cfMessage: "Please enter a message."
				},
				submitHandler: function(form) {
					$.ajax({
						type: 'POST',
						url: 'contact_post.php',
						data: { btnSubmit:1,cfSubject: $("#cfSubject").val(), cfEmail: $("#cfEmail").val(), cfMessage: $("#cfMessage").val()},
						success: function(data){
							$("#contactForm").html(data);
							$('#wrapper').scrollTo($('a.selected').attr('href'), 0);
						}
					});
					return false;
				}
			});
		
	});
	 
	function resizePanel() {
	 
		width = $(window).width();
		height = $(window).height();
	 
		mask_width = width * $('.item').length;
			
		$('#debug').html(width  + ' ' + height + ' ' + mask_width);
			
		$('#wrapper, .item').css({width: width, height: height});
		$('#mask').css({width: mask_width, height: height});
		$('#wrapper').scrollTo($('a.selected').attr('href'), 0);
			
	}
	
