<!-- Yahoo! Inc.
		window.ysm_customData = new Object();
		window.ysm_customData.conversion = "transId=,currency=,amount=";
		var ysm_accountid  = "1E5K66HMF67GP1BGJ1QSPJ05BV0";
		document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' "
		+ "SRC=//" + "srv2.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid
		+ "></SCR" + "IPT>");
	// -->
	
function showResponse() { 
			alert("Thank you for your contact with Integrity Furniture. Your information has been sent.");
			return true; 
		}
		$(document).ready(function() {
			$("a[rel^='lightbox']").colorbox();
			$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
			var tabContainers = $('div.tabs > div');
			tabContainers.hide().filter(':first').show();
			$('div.tabs ul.tabNavigation a').click(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).show();
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').click();
			$('a.tabclick').click(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).show();
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			});
			$(function() {
				$('#rotation').cycle();
			});
			$('#quotebutton').click(function () {
				$('#requestquote').slideToggle("slow");
			});
			
			// NEW AJAX COMPARISON FUNCTION
			var $queried = false;
			$('#comparebutton').click(function () {
				if($queried == false){
					$('#ajax-loader').css('left', ($('#comparebutton').offset().left + 310) + 'px');
					$('#ajax-loader').css('top', ($('#comparebutton').offset().top + 10) + 'px');
					$('#ajax-loader').show();
	
					$.post("/includes/ajaxMassage.php", {data : $("#compareprices").html()},
					function(data){
						if(data == "error"){
							$('#compareprices').html("ERROR - Cannot Query Data");
							$('#ajax-loader').hide();
						}else{
							$('#ajax-loader').hide();
							$('#compareprices').html(data);
							$('#compareprices').slideToggle("slow");
							$queried = true;
						}
					});
				}else{
					$('#compareprices').slideToggle("slow");
				}
			});
						var options = {
				success: showResponse,
				clearForm: true
		    };
			function showMega() {
				$(this).find("div").stop()
				.fadeIn("fast")
				.css("display", "block")
				//columnMega()
			};
			function columnMega() {
				$('.navholder').columnize({
					width: 200,
					height: 300
				});
			};
			function hideMega() {
				$(this).find("div").stop()
				.fadeOut("fast")
			};
			var config = {    
				sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
				interval: 200, // number = milliseconds for onMouseOver polling interval    
				over: showMega, // function = onMouseOver callback (REQUIRED)    
				timeout: 500, // number = milliseconds delay before onMouseOut     
				out: hideMega // function = onMouseOut callback (REQUIRED)    
			};
			/*
			$("#quoteform").validationEngine({
				success: function() {
					if($("#formID").validationEngine({returnIsValid:true})) { $("#quoteform").ajaxForm(options) }
				}
			});
			*/
			$("#quoteform").submit(function(){
				var theform = $(this);
				$.post(theform.attr('action'), theform.serialize(), function(data) {
					var datalength = data.error.length;
					if(datalength < 1){
						showResponse();
						$("input", theform).attr('value',"");
					}else{
						var i = 0;
						for(i = 0; i < datalength; i++){
							$('input[name="'+data.error[i]+'"]', theform).css('border-color', '#cf1c1c');
						}
						alert('There was an error with your submission');
					}
				}, "json");
				
				return false;
			});
			$("#quoteform input").change(function(){
				$(this).css('border-color', '#D9D9D9');
			});
			$("#leftnav div.links ul.navlinks li").hoverIntent(config);
			$("#listings div.listing a").bigTarget();
			//$(".navholder").columnize({ width: 190 });
			if ($.browser.msie) {
				var zIndexNumber = 1000;
				$('div').each(function() {
					$(this).css('zIndex', zIndexNumber);
					zIndexNumber -= 1;
				});
				$("#colorbox").css('zIndex', '9999');
				$("#cboxOverlay").css('zIndex', '9999');
				$("#cboxWrapper").css('zIndex', '9999');
				$("#cboxClose").css('zIndex', '9999');
				$("#cboxPrevious").css('zIndex', '9999');
				$("#cboxNext").css('zIndex', '9999');
				$(".holder").css('zIndex', '9999');
				$("#inside").css('zIndex', '9999');
			};
			$(document).pngFix();
			$("#npclick").toggle(
				function () {
					$("#support").css({"display":"block"});
				},
				function () {
					$("#support").css({"display":"none"});
				}
			);
		});
