jq142(function($) {

    function submitSearch() {
        if (document.searchform.s.value != '') {
            document.searchform.submit();
        } else {
            alert('Please enter text in the search box in order to search our site.');
        }
    }
	$('#search_button_go').click(function() {
		submitSearch();
	});

    jQuery('.megamenu').megamenu({'enable_js_shadow' : false});
    
    
 // Request Form - How did you hear about us
    $('#formBuilderFieldOther').hide();
    function getComingFrom() {
        var comingFrom = $('#formBuilderFieldcoming_from select :selected').text();
        if(comingFrom == 'Referred by Architect' || comingFrom == 'Referred by Builder' || comingFrom == 'Referred by Plumber' || comingFrom == 'Other'){
        	$('#formBuilderFieldOther').show();
        }else{
        	$('#formBuilderFieldOther').hide();
        }
    }
    $('#formBuilderFieldcoming_from select').change(function() {
    	getComingFrom();
	});

    $('#formBuilderFieldcoming_from ').click(function() {
    	getComingFrom();
	});
    
    
});

// var count = 0;
// var threshold = 20
// var $$ = jQuery;
// var hover = 'mm-item-link-hover';
// var menu = {'tech':'tech-list', 'explained':'explained-list'};
//
//
// var trevorMenu = function(menuID, boxID, hoverClass) {
// 	$$('#'+menuID+',#'+boxID).bind('mousemove', function() {
// 		count = 0;
// 	});
// 	$$('html').bind('mousemove', function() {
// 		++count;
// 		if (count > threshold) {
// 			$$('#'+boxID).slideUp(150);
// 			$$('#'+menuID).removeClass(hoverClass);
// 		}
// 	});
//
// 	$$('#'+menuID).bind('mouseenter', function() {
// 		$$('#'+boxID).slideDown(150);
// 		$$(this).addClass(hoverClass);
// 	});
//
// };
// $$(function() {
// 	$$.each(menu, function(index, value) {
// 		trevorMenu(index, value, hover);
// 	});
// });
