$(function(){
if($("#edit-profile-website").val()=='') { $("#edit-profile-website").val('http://'); };
});


$(document).ready(function () {
	$("#search-form #edit-category-wrapper label").html("With the following tags:");
	$("#search-form #edit-Categories-wrapper").append("<br><span class=helptext style='font-size:.8em;width=100px;'>Hold CTRL key down while<br />clicking to select multiple.</span>");
	$("#search-form .criterion:last").hide();
//	$("body.page li:contains('Configure')").remove();
//	$("body.page li:contains('Sort')").remove();
//	$("body.text li:contains('Configure')").remove();
//	$("body.text li:contains('Sort')").remove();
//	$("body.story li:contains('Configure')").remove();
//	$("body.story li:contains('Sort')").remove();
//	$("body.webform li:contains('Configure')").remove();
//	$("body.webform li:contains('Sort')").remove();
	//$("#edit-tid-1 option:first").html('All'); 
	//$("#edit-tid option:first").html("All"); 
	//$("#edit-field-source-value-many-to-one option:first").html("All");
	$("#edit-field-source-value-many-to-one option:first").remove();
	$("a:contains('More information about formatting options')").remove();
	//$("option:contains('All')").remove();
});

this.tooltip = function(){	

	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

// starting the script on page load

$(document).ready(function(){
	tooltip();
});



function findValue(li) {
	if( li == null ) return alert("No match!");

	// if coming from an AJAX call, let's use the CityId as the value
	if( !!li.extra ) var sValue = li.extra[0];

	// otherwise, let's just display the value in the text box
	else var sValue = li.selectValue;


	window.location="/node/"+sValue;
	//alert("The value you selected was: " + sValue);
}

