// clear field value function: removes the default value onfocus, and adds back if nothing entered 
function fieldClear(obj) {
	if(obj.Val) {
		if (obj.value == '') { 
			obj.value = obj.Val;
			obj.Val = null;
			obj.first = null;
		} 
		else {
			obj.Val = null;
		}
	} else if (!obj.first) { 
		obj.Val = obj.value;
		obj.value = ''; 
		obj.first = 'true';
	} 
}
// Hide / Show functionality on the Product Detail page
$(document).ready(function(){
		// check to see if product_detail class is present before proceeding.
	if ($('.product_detail').is('*')) {
		nav_item 	 = $('.product_detail #nav_prodinfo li a');
		content_item = $('.product_detail .prodinfo');
			// bind click function to the Tab Items
		nav_item.click(function(e) {
			e.preventDefault();
			var index = nav_item.index(this);
				// do nothing if the user clicks on the Active Tab Item
			if ($(this).is('.active')) return false;
				// otherwise hide all Tab Items and Content, then show the newly active states
			else {
				nav_item.removeClass('active');
				$(this).addClass('active');
				content_item.removeClass('active');
				content_item.eq(index).addClass('active');
			}
		});
	}
});
