﻿$().ready(function() {
             // Search Box Fix
             var seek = "";  

             $("#term").focus(function(){
                 $(this).val("");
             });
             $("#term").blur(function(){
                 if($(this).val() == ("")){
                    $(this).val(seek);
                 }
             });
             $("#term1").focus(function(){
                 $(this).val("");
             });
             $("#term1").blur(function(){
                 $(this).val(seek);
             });
	     $("#Search").click(function(){
		MR_Search('query',GetMainSearchUrl('searchOption'));
	     });
             $("#searchOption").val('location');
             // End Search Box Fix

             // Footer Fix

		$('#nfooter').makeFAQ({
			displayIndex: false,
			faqHeader: "h6"
		});
             // End Footer Fix

             // Tab Fix
		$("#tabs").tabs();
		$("#tabs2").tabs();
             // End Tab Fix
});
//function to swap values for the search optoins
function swapSearchOptionValue(whichVal) {
    var valToSelect = whichVal;
    var selectObj = document.getElementById('searchOption');
    for(var cnt = 0; cnt < selectObj.length; cnt++ ) {
        if(selectObj.options[cnt].value == valToSelect) {
            selectObj.options[cnt].selected = true;
            break;
        }
    }
    switch (valToSelect) {
      case 'ELECUS': document.getElementById('term').value = 'Enter Zip';break;
      case 'ELECCA': document.getElementById('term').value = 'Enter City or Postal';break;
      default: document.getElementById('term').value = 'Enter search terms';break;
    }
    
}
//function to show/hide the search (arguments: which visible state {'visible', 'hidden'}, how many pixels {from} the right to go in CSS)
function showHideSearch(targetVal, rightDist, curId) {
   var assignNewVis = targetVal;
   var newXPos = rightDist;
   var linkId = curId;
   document.getElementById('searchBoxHolder').style.visibility = assignNewVis;
   document.getElementById('searchBoxHolder').style.right = newXPos + 'px';
   resetSearchNavColors();
   document.getElementById(linkId).style.color = "#5c5c5c";
   return true;
}
//function to reset the nav colors
function resetSearchNavColors() {
   document.getElementById('sLocUs').style.color = "#FFF";
   document.getElementById('sLocCan').style.color = "#FFF";
   document.getElementById('sWeb').style.color = "#FFF";
   return true;
}
