// global JavaScript Document

//------------------- for clearing and replacing text in form input fields and textareas -------------------//
function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 
function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}



$(document).ready(
		function(){	
		

		$('ul.sf-menu').supersubs({ 
            minWidth:    12,   // minimum width of sub-menus in em units 
            maxWidth:    27,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish();
		
		
			$("ul.tabs").tabs("div.panes > div");
			$("ul.tabsmall").tabs("div.panes > div");
			
			$("#categoryName").autocomplete("/services/categories/search", {
				width: 400,
				minChars: 2,
				max: 10,
				highlight: true,
				autoFill: false,
				scroll: true,
				scrollHeight: 300,
				formatItem: function(data, i, n, value) {
					return data[0].split(".");
				},
				formatResult: function(data, value) {
					return value.split(".")[0];
				}
			});
			  
			  
			
		$("#address_geo").autocomplete("/services/city/search", {
				width: 200,
				minChars: 2,
				max: 10,
				highlight: false,
				autoFill: true,
				scroll: true,
				scrollHeight: 300,
				formatItem: function(data, i, n, value) {
					return data[0].split(".");
				}
			});
			
			checkForLocation();
			
			
							
		//	$(".hint").tooltip({position: "top center",offset: [-10, 10],effect: "bouncy",opacity: 0.02,api: true}).show();
		
			
	});
	


