//SET NOCONFLICT TO WORK WITH OTHER LIBRARIES
jQuery.noConflict();

//CUSTOM JQUERY FUNCTIONS
jQuery(document).ready(function(){

	//Clear the input fields
	jQuery('input, textarea').clearInput();

	// superfish
	jQuery('ul#nav').superfish({ 
		delay:       0,                            		// one second delay on mouseout 
		animation:   {opacity:'show', height:'show'}, 	// fade-in and slide-down animation 
		speed:       300,                          		// faster animation speed 
		autoArrows:  false,                         	// disable generation of arrow mark-up 
		dropShadows: false                            	// disable drop shadows 
	});
	

	
});

//clearInput function
jQuery.fn.clearInput = function(){
	return this.focus(function(){
		if(this.value == this.defaultValue){
			this.value = "";
		}
	}).blur(function(){
		if(!this.value.length){
			this.value = this.defaultValue;
		}
	});
};

//clearForm function
jQuery.fn.clearForm = function() {
	return this.each(function() {
		var type = this.type, tag = this.tagName.toLowerCase();
		if (tag == 'form')
			return jQuery(':input',this).clearForm();
		if (type == 'text' || type == 'password' || tag == 'textarea')
			this.value = '';
		else if (type == 'checkbox' || type == 'radio')
			this.checked = false;
		else if (tag == 'select')
			this.selectedIndex = -1;
	});
};
