/************************************************************
 ** Clears a field
 ** By: 	Joshua Sowin (fireandknowledge.org)
 ** HTML: <input type="text" value="Search" name="search"
 **			id="search" size="25" 
 ** 		onFocus="clearInput('search', 'Search')" 
 ** 		onBlur="clearInput('search', 'Search')" />
 ***********************************************************/
function clearInput(field_id, term_to_clear) {
	
	// Clear input if it matches default value
	if (document.getElementById(field_id).value == term_to_clear ) {
		document.getElementById(field_id).value = '';
	}
	
	// If the value is blank, then put back term
	else if (document.getElementById(field_id).value == '' ) {
		document.getElementById(field_id).value = term_to_clear;
	}
} // end clearInput()



function pricetip(target_items, name){
 $(target_items).each(function(i){
		$("#pricetable").append('<div class="'+name+'" id="'+name+i+'"><p><strong>'+$(this).parent().children('li.col-1').html()+'</strong><br />'+$(this).parent().children('li.col-6').html()+'</p></div>');
		var thistip = $('#'+name+i);
		var thislink = $(this);
		var thispos = thislink.position();

		$(this).mouseover(function(){
				thistip.css({display:"block"});
		}).mousemove(function(){
				thistip.css({left:thispos.left+225, top:thispos.top-20});
		}).mouseout(function(){
				thistip.css({display:"none"});
		});
	});
}
$(document).ready(function(){ pricetip('ul.row li.col-1','tooltip');});
