jQuery(document).ready(function () {
	function diner_restaurant_search_loop_focus(element) {
		var diner_restaurant_focus = element.find('select, input, textarea, button, a[href]');
		var diner_restaurant_firstFocus = diner_restaurant_focus[0];  
		var diner_restaurant_lastFocus = diner_restaurant_focus[diner_restaurant_focus.length - 1];
		var KEYCODE_TAB = 9;

		element.on('keydown', function diner_restaurant_search_loop_focus(e) {
			var isTabPressed = (e.key === 'Tab' || e.keyCode === KEYCODE_TAB);

			if (!isTabPressed) { 
			  return; 
			}

			if ( e.shiftKey ) /* shift + tab */ {
			  if (document.activeElement === diner_restaurant_firstFocus) {
		    diner_restaurant_lastFocus.focus();
		      e.preventDefault();
		    }
		  } else /* tab */ {
		  	if (document.activeElement === diner_restaurant_lastFocus) {
		    	diner_restaurant_firstFocus.focus();
		      e.preventDefault();
		    }
		  }
		});
	}
	
	jQuery('.search-box span a').click(function(){
    jQuery(".serach_outer").slideDown(1000);
  	diner_restaurant_search_loop_focus(jQuery('.serach_outer'));
  });

  jQuery('.closepop a').click(function(){
    jQuery(".serach_outer").slideUp(1000);
  });
});

function diner_restaurant_project_tab(evt, cityName) {
  var i, tabcontent, tablinks;
  tabcontent = document.getElementsByClassName("tabcontent");
  for (i = 0; i < tabcontent.length; i++) {
    tabcontent[i].style.display = "none";
  }
  tablinks = document.getElementsByClassName("tablinks");
  for (i = 0; i < tablinks.length; i++) {
    tablinks[i].className = tablinks[i].className.replace(" active", "");
  }
  jQuery('#'+ cityName).show()
  evt.currentTarget.className += " active";
}

jQuery(document).ready(function () {
	jQuery('.tabcontent').hide();
	jQuery('.tabcontent:first').show();
});