

$(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();
*/	
	
    	var $sameHeightDivs = $('.sameHeight');
    	var maxHeight = 0;
	$sameHeightDivs.each(function() {
		maxHeight = Math.max(maxHeight, $(this).outerHeight());
	});

   	//$sameHeightDivs.css({ height: maxHeight + 'px' });
	  
	 
	$(".stripeMe tr:odd").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);
			     });	
	
*/
	
	
	  /*
		$("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
		
	});			
	*/
	$(".lac_images .tooltip").tooltip({
		effect: 'slide',
		position: "left top", 
		//offset: [-5, -20],
		delay:100
		
	}); 
			
		
	

	$(".lac_images li img").each(function(index) {
		//alert(index);

		var newHref = $(this).attr("src");
		var filename = newHref.match(/.*\/(.*)$/)[1];
		var x = filename.substring(0, filename.indexOf('.jpg'));
		var newfilename = x + '_hover.jpg';
		
		var newSource = "/userfiles/modules/page/" + newfilename;	
			

		var image = $('<img />').attr('src', newSource );

	});


	$(function() {
		 $(".lac_images li img").hover(function() {

			var newHref = $(this).attr("src");
			var filename = newHref.match(/.*\/(.*)$/)[1];
			var x = filename.substring(0, filename.indexOf('.jpg'));
			var newfilename = x + '_hover.jpg';
			var newSource = "/userfiles/modules/page/" + newfilename;
				  
		   	$(this).attr("src", newSource);
		   	
		  }, function() {
		  	$(this).attr("src", $(this).attr("src").split("_hover.").join("."));
		  });
	});
	

	$('.fancybox').fancybox({
		 overlayOpacity : 0.5	,
		 titlePosition : 'inside'		
	});



	$(".dataTable tr:even").addClass("alt");


        $(".columns").equalHeights(550); 

	

});
	


  


