if(typeof jQuery !== "undefined") {
	jQuery.noConflict();
	jQuery(document).ready(function($) {
	
		//  clear form function
		$.fn.search = function() {
			return this.focus(function() {
				if( this.value == this.defaultValue ) {
					this.value = "";
				}
			}).blur(function() {
				if( !this.value.length ) {
					this.value = this.defaultValue;
				}
			});
		};
	
		// add js class
		$('body').addClass('js');
		
		// make entire homepage box clickable
		/*$('#mainContent .hbox').css({ 'cursor':'pointer' });
		$('#mainContent .hbox').click(function() {  
			window.location = $(this).find('.more a').attr('href');  
		});  */
		
		// tree menu
		$('#subnav ul').treeview({
			animated: 'fast',
			collapsed: true,
			unique: true/*,
			persist: 'location'*/
		});
	
		// clear search form on focus
		$("#searchBox").search();
		
		/***
		* Date picker
		*/
		if($('.date-pick').length>0){
			$('.date-pick').datePicker({clickInput:true});
		}
	
	});
	
}
	
