function triggerInstantSearch() {
	$.post("/", $("#instant-result-form").serialize());
}

// New Homepage
// JS by Coding People



document.documentElement.className = 'js';

function sliderDescriptions () {
	
	var dockwrap = $('#surf_info .dockwrap');
	if(!dockwrap.length) {return false}
	
	$('#surf_info #dock').Fisheye({
		maxWidth: 85,
		items: 'a',
		itemsText: 'span',
		container: '.dock-container',
		itemWidth: 77,
		proximity: 50,
		alignment : 'left',
		valign: 'bottom',
		halign : 'center'
	});
	
	
	var description = $('#slider_descriptions .description');
	if(!description.length) {return false}
	
	
	
		description.css(
		{
			'display': 'none',
			'top': 0,
			'left': 0,
			'position': 'static'
		}					   
	);
	
	
	$(description[0]).css(
		{
			'display': 'block'
		}					   
	);
	

	
	
	
	$( "#surf_info .dock-item" ).each(
	 
		
		function( intIndex ){
	 			$( this ).bind (
				"mouseenter",
				function(){
					description.css('display','none');
					$(description[intIndex]).css('display','block');
				}
				);
	 
		}
	 
	);	
}

 
 $(document).ready(function() {
							
	
	function replaceCheckboxes () {
			$(function(){
            	$('input').checkBox({addVisualElement: false});
			});
	}
	
	replaceCheckboxes ();
	
	
	function stepsPopup () {
			var steps_foto = $('#steps_foto');
			if(!steps_foto.length) {return false}
			var steps_lk = $('#steps_lk');
			
			
			steps_lk.click(
				function () {
						steps_foto.css('left','50%');
						return false;
				}			   
			);
			
			steps_foto.click(
				function () {
						steps_foto.css('left','-9999px');
						return false;
				}			   
			);
			
	}
	
	stepsPopup();
	
	function noteMessages () {
		var note_wrapper = $('#note_wrapper');
		if(!note_wrapper.length) {return false}
		note_wrapper = $(note_wrapper[0]);
		var close_note = note_wrapper.find('.close');
		close_note.click(
			function () {
					$(this).closest('#note_wrapper').css('display','none');
			}				 
		);
		
		var note_middle = note_wrapper.find('#note_middle');
		var note_content = note_wrapper.find('#note_content');
		if(note_content.height()>103) {
			note_middle.css('height',note_content.height()-103);
			if(note_wrapper.hasClass('welcome_msg')) {
				note_middle.css('height',note_content.height()-129);
			}
		}
	}
	
	noteMessages();
	
	
	function tooltips () {
		var tooltip = $('.tooltip');
		if(!tooltip.length) {return false}
		for(i=0; i<tooltip.length; i++) {
			var tooltip_middle =  $(tooltip[i]).find('.tooltip_middle');
			var h = $(tooltip[i]).find('.tooltip_content').height();
			if(h>206) {
				tooltip_middle.css('height',h-206);
			}
		}
	}
	
	 tooltips();
	 

	sliderDescriptions ();
	 
							
});


