this.label2value = function(){	

	var inactive = "inactive";
	var active = "active";
	var focused = "focused";
	
	$("label").each(function(){		
		obj = document.getElementById($(this).attr("for"));
		if(($(obj).attr("type") == "text") || (obj.tagName.toLowerCase() == "textarea")){			
			$(obj).addClass(inactive);			
			var text = $(this).text();
			$(this).css("display","none");			
			$(obj).val(text);
			$(obj).focus(function(){	
				$(this).addClass(focused);
				$(this).removeClass(inactive);
				$(this).removeClass(active);								  
				if($(this).val() == text) $(this).val("");
			});	
			$(obj).blur(function(){	
				$(this).removeClass(focused);													 
				if($(this).val() == "") {
					$(this).val(text);
					$(this).addClass(inactive);
				} else {
					$(this).addClass(active);		
				};				
			});				
		};	
	});		
};
$(document).ready(function() {
	label2value();	
	
	$('ul.zebra li:odd') .addClass('zebraOdd');
	$('ul.zebra li:even').addClass('zebraEven');
	
	$('ul#menu li ul').parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)
	
	$("ul#menu li span").toggle(function() { //When trigger is clicked...
		$(this).parent().parent().find("ul").slideUp('normal'); //Drop down the subnav on click
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul").slideDown('fast').show(); //Drop down the subnav on click
	
		/*$(this).parent().find("ul.child").hover(function() {
		}, function(){
			$(this).slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});*/
	
		//Following events are applied to the trigger (Hover events for the trigger)
		},function() {
		      $(this).parent().find("ul").slideUp('normal').show(); //Drop down the subnav on click
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
	
	$('a[rel="external"]') .attr('target','_blank');
    
    $('#menu').menuSelector({
       targetElements: 'li a', // links used to compare with window location
       defaultSelected: 'li:first', // li:first, false = nothing selected by default
       activeClass:'home', // defaults to 'active'
       activeParent:false, // if is set, active class will be set to this parent element, instead of target elements
       onNoEltSelected: function(){
            // your custom code here, if needed
       }
    });
	
});// JavaScript Document
