

$(document).ready(function(){
	


	$('#search_input').searchField();
 
    $("#btn_back").click(function(){
    	window.location.href = '/index';
    });

	$(".accordion_menu").accordion({
		autoHeight:false,
		active:0,
		clearStyle: true,
		navigation: true
	});
			
 
	function mainmenu(){
			$(" .flyout ul").css({display:"none"}); // Opera Fix
			$(".flyout li").hover(function(){
					//$(this).find("ul:first").parent().css({background: "#373737", background:"rgba(0, 0, 0, 0.7)"});
					$(this).find("ul:first").parent().addClass("flyout_hovered");
					$(this).find("ul:first").css({visibility: "visible",display: "block"}).show(100);
				},function(){
					//$(this).find("ul:first").parent().css({background: "none"});
					$(this).find("ul:first").parent().removeClass("flyout_hovered");
					$(this).find("ul:first").css({display: "none"});
				});
	}   
	mainmenu();


 
	  
	 
	$(".stripeMe tr:even").addClass("table_row_alt");	  
	
	var contentHeight = $("#three_column_middle").height();
	var rightBlockHeight = $("#rightBlocks").height();
	var leftBlockHeight = $("#leftBlocks").height();
	var greatestHeight; 

	if(leftBlockHeight > contentHeight && leftBlockHeight > rightBlockHeight){
		greatestHeight = leftBlockHeight;
	}
	if(rightBlockHeight > contentHeight && rightBlockHeight > rightBlockHeight){
		greatestHeight = rightBlockHeight;
	}	
	if(contentHeight > leftBlockHeight && contentHeight > rightBlockHeight){
		greatestHeight = contentHeight;
	}
	
	$("#rightBlocks").height(greatestHeight);

	$('#product_tabs').bind('tabsshow',
			 function(event, ui) {
					bentleyheight = $("#product_tabs").find(".ui-tabs-panel:visible").height();
					tabsheight = $("#product_tabs").height();
					//alert(tabsheight);
					otherheight = $("#type_range_view").height();
					newheight = tabsheight + otherheight;
					$("#three_column_right").height(newheight);
					$(".bentley #three_column_right").height(bentleyheight);
					$(".bentley #rightBlocks").height(bentleyheight);
			     });	
	
	if( $('#country').val()=='United Kingdom'){
		$('#city').removeAttr('disabled');
	}else{
		$('#city').attr('disabled','disabled');
	};
	
	$('#country').change ( function() {
		if( $('#country').val()=='United Kingdom'){
			$('#city').removeAttr('disabled');
		}else{
			$('#city').attr('disabled','disabled');
		};
	
	});	
	  /*
		$("a.delete").click(function(e){
		    e.preventDefault();
		    var href = $(this).attr('href');
		    customConfirm('This item will be permanently deleted and cannot be recovered. Are you sure?',
		        function(){
		                location.href = href;
		        }
		    ); 
		});
		
		$('ul.sf-menu').superfish({ 
		   delay:       1000,                             
		    animation:   {opacity:'show'},                
		    speed:       'fast',                          
		    autoArrows:  false,                           
		    dropShadows: false
		                     
		}); 		
		
	$(".upgrade_path_list a").tooltip({
		effect: 'slide',
		position: "center left", 
		offset: [75, -3],
		delay:100
		
	});			
	
		$(".upgrade_path_list a").tooltip({
			effect: 'slide',
			position: "center right", 
			offset: [75, 0],
			delay:100
			
		});
			
		
	*/		
});



  

