jQuery(document).ready(function(){
jQuery(".easy-form").EasyForms();
jQuery("#archiveform").change(function() {window.location = jQuery(this).attr('value');});
jQuery("input.stdinput,textarea.stdinput").focus(function() {jQuery(this).addClass("stdinput-sel");}).blur(function() {jQuery(this).removeClass("stdinput-sel");});
jQuery(".recent-forums li:even,.recent-comments li:odd,.article-list li:even,.comment-list li:odd").addClass("alt");
jQuery(".recent-comments li:last,.entry-small:last").addClass("last");
if (jQuery('.ngg-gallery-thumbnail a').length > 0){ 
jQuery('.ngg-gallery-thumbnail a').lightBox();
}
jQuery('.articolo-body a').tooltip({
	delay: 0,
	showURL: false,
	bodyHandler: function() {
		
		var url = jQuery(this).attr("href").substr(jQuery(this).attr("href").length-3,3);
		var ext = url.toLowerCase();		
		if (ext == "jpg" || ext == "gif" ){		
		return jQuery('<img width="150"/>').attr("src", jQuery(this).attr("href"));
		}else{
		return jQuery('<a>'+jQuery(this).attr("href")+'</a>').attr("href", jQuery(this).attr("href"));	
		}
	},
	track: true,   
    top: -50   
});
});
// More usable Forms V 2.3  By Oliver Astrologo
jQuery.fn.EasyForms=function(){
this.submit( function() {
			var submitForm = this;
			jQuery(submitForm).find("label").not(".radiolabel").each(function(){
				var current=jQuery(this);
				var targetForm =  jQuery('#'+current.attr("for"));				
				if (targetForm.val() == current.html()){
				targetForm.val('');
				};																			  
			});
		return true;
	});	
	this.find("label").not(".radiolabel").each(function(){
		var current=jQuery(this);		
		var targetForm = jQuery('#'+current.attr("for"));	   
	   if (targetForm.val() == ''){
			targetForm.val(current.html());		
			}	   
	   targetForm.click(function(){		
		if (jQuery(this).val() == current.html()){
			jQuery(this).val('');			
			}
		});
		targetForm.blur(function(){		
		if (jQuery(this).val() == ''){
			jQuery(this).val(current.html());			
			}
		});
		current.hide();	
	});			
}
