var priceFrom = 0;var priceTo = 100;var caratFrom = 10;var caratTo = 600;var cutFrom = 1;var cutTo = 5;var colorFrom = 1;var colorTo = 8;var clarityFrom = 1;var clarityTo = 11;//var frun=1;function SearchProducts(){		/*	// override these in your code to change the default behavior and style 	$.blockUI.defaults = { 		// message displayed when blocking (use null for no message) 		message:  'Trwa wyszukiwanie brylantÃ³w.<br/>ProszÄ™ czekaÄ‡.', 	 		// styles for the message when blocking; if you wish to disable 		// these and use an external stylesheet then do this in your code: 		// $.blockUI.defaults.css = {}; 		css: { 			padding:        0, 			margin:         0, 			width:          '20%', 			top:            '40%', 			left:           '40%', 			textAlign:      'center', 			color:          '#18385A',			border:         '4px solid #FF6C00', 			backgroundColor:'#FAFAFB', 			cursor:         'wait',			fontSize:       '12px',			fontWeight:     'bold',			fontFamily:     'Arial,Helvetica,sans-serif'		}, 	 		// styles for the overlay 		overlayCSS:  { 			background: 'black', 			opacity: '0.3'		}, 	 		// styles applied when using $.growlUI 		growlCSS: { 			width:    '350px', 			top:      '10px', 			left:     '', 			right:    '10px', 			border:   'none', 			padding:  '5px', 			opacity:   0.6, 			cursor:    null, 			color:    '#fff', 			backgroundColor: '#000', 			'-webkit-border-radius': '10px', 			'-moz-border-radius':    '10px' 		}, 		 		// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w 		// (hat tip to Jorge H. N. de Vasconcelos) 		iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', 	 		// force usage of iframe in non-IE browsers (handy for blocking applets) 		forceIframe: false, 	 		// z-index for the blocking overlay 		baseZ: 1000, 	 		// set these to true to have the message automatically centered 		centerX: true, // <-- only effects element blocking (page block controlled via css above) 		centerY: true, 	 		// allow body element to be stetched in ie6; this makes blocking look better 		// on "short" pages.  disable if you wish to prevent changes to the body height 		allowBodyStretch: true, 	 		// enable if you want key and mouse events to be disabled for content that is blocked 		bindEvents: true, 	 		// be default blockUI will supress tab navigation from leaving blocking content 		// (if bindEvents is true) 		constrainTabKey: true, 	 		// fadeIn time in millis; set to 0 to disable fadeIn on block 		fadeIn:  200, 	 		// fadeOut time in millis; set to 0 to disable fadeOut on unblock 		fadeOut:  400, 	 		// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock 		timeout: 800, 	 		// disable if you don't want to show the overlay 		showOverlay: true, 	 		// if true, focus will be placed in the first available input field when 		// page blocking 		focusInput: true, 	 		// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) 		applyPlatformOpacityRules: true, 	 		// callback method invoked when unblocking has completed; the callback is 		// passed the element that has been unblocked (which is the window object for page 		// blocks) and the options that were passed to the unblock call: 		//     onUnblock(element, options) 		onUnblock: null, 	 		// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 		quirksmodeOffsetHack: 4 	}; 			if(!frun){		$.blockUI();	}	frun=0;*/		$('#count').html('<img src="/portal/assets/img/konfigurator/ajax-loader.gif" style="position:relative; top:10px;"/>');		$.post("/portal/assets/snippets/konfigurator/diamond_search.php",	{		price_from: priceFrom, 		price_to: priceTo, 		carat_from: caratFrom, 		carat_to: caratTo, 		cut_from: cutFrom, 		cut_to: cutTo, 		color_from: colorFrom, 		color_to: colorTo, 		clarity_from: clarityFrom, 		clarity_to: clarityTo	}, 	function(data){		setTimeout(			function(){				$('#count').html(data.count);                                $('#count2').html(data.count);                                $('#diamonds_found_top').html(data.count);                                $('#priceFrom').html(data.priceFrom);                                $('#priceTo').html(data.priceTo);                                $('#price_div').html(data.priceFrom.toFixed(2) + ' - ' + data.priceTo.toFixed(2) + ' z³');                                $('#price_top').html(data.priceFrom.toFixed(2) + ' - ' + data.priceTo.toFixed(2) + ' z³');                                $('#caratFrom').html(data.caratFrom);                                $('#caratTo').html(data.caratTo);                                $('#carat_div').html(data.caratFrom  + ' - ' + data.caratTo + ' ct');                                $('#carat_top').html(data.caratFrom  + ' - ' + data.caratTo + ' ct');                                $('#cutFrom').html(data.cutFrom);                                $('#cutTo').html(data.cutTo);                                $('#cut_div').html(data.cutFrom + ' - ' + data.cutTo);                                $('#cut_top').html(data.cutFrom  + ' - ' + data.cutTo);                                $('#colorFrom').html(data.colorFrom);                                $('#colorTo').html(data.colorTo);                                $('#color_div').html(data.colorFrom + ' - ' + data.colorTo);                                $('#color_top').html(data.colorFrom + ' - ' + data.colorTo);                                $('#clarityFrom').html(data.clarityFrom);                                $('#clarityTo').html(data.clarityTo);                                $('#clarity_div').html(data.clarityFrom + ' - ' + data.clarityTo);                                $('#clarity_top').html(data.clarityFrom + ' - ' + data.clarityTo);                                $('#see_results').attr("href",data.link);                                $('#see_results2').attr("href",data.link);                                $('#link_top').attr("href",data.link);			}		,200);			},'json');}	$(function(){		// Slider	$('#price_slider').slider({		range: true,				values: [0, 100], 		change: function(event, ui) {			var values = $('#price_slider').slider('option', 'values');						priceFrom = values[0];			priceTo = values[1];			$('#price_div').html(priceFrom.toFixed(2) + ' - ' + priceTo.toFixed(2) + ' z³');			SearchProducts();		}	});		// Slider	$('#carat_slider').slider({		range: true, 		min: 10, 		max: 600,		values: [10, 600],		change: function(event, ui) {			var values = $('#carat_slider').slider('option', 'values');						caratFrom = values[0];			caratTo = values[1];			$('#carat_div').html((caratFrom / 100).toFixed(2) + ' - ' + (caratTo / 100).toFixed(2) + ' ct');			SearchProducts();		}	});		// Slider	$('#cut_slider').slider({		range: true,		step: 1,		min: 1, 		max: 5,		values: [1, 5], 		change: function(event, ui) {			var values = $('#cut_slider').slider('option', 'values');						cutFrom = values[0];			cutTo = values[1];			var cuts = {				1 : "Idealny",				2 : "Bardzo dobry", 				3 : "Dobry", 				4 : "Poprawny"			}			$('#cut_div').html(cuts[Math.round(cutTo) - 1] + ' - ' + cuts[Math.round(cutFrom)]);			SearchProducts();		}	});		// Slider	$('#color_slider').slider({		range: true,		step: 1,		min: 1, 		max: 8,		values: [1, 8], 		change: function(event, ui) {			var values = $('#color_slider').slider('option', 'values');						colorFrom = values[0];			colorTo = values[1];			var colors = {				1 : "D",				2 : "E", 				3 : "F", 				4 : "G", 				5 : "H", 				6 : "I", 				7 : "J"			}			$('#color_div').html(colors[Math.round(colorFrom)] + ' - ' + colors[Math.round(colorTo) - 1]);			SearchProducts();		}	});		// Slider	$('#clarity_slider').slider({		range: true,		step: 1,		min: 1, 		max: 11,		values: [1, 11], 		change: function(event, ui) {			var values = $('#clarity_slider').slider('option', 'values');						clarityFrom = values[0];			clarityTo = values[1];			var clarity = {				1 : "FL",				2 : "IF", 				3 : "VVS1", 				4 : "VVS2", 				5 : "VS1", 				6 : "VS2", 				7 : "SI1", 				8 : "SI2", 				9 : "I1", 				10 : "I2"			}			$('#clarity_div').html(clarity[Math.round(clarityFrom)] + ' - ' + clarity[Math.round(clarityTo) - 1]);									SearchProducts();		}	});						});	$(document).ready( function () { 		$('#price_slider').slider('option', 'min', priceFrom);		$('#price_slider').slider('option', 'max', priceTo);		$('#price_slider').slider('option', 'values', [priceFrom,priceTo]);			SearchProducts();});	
