$(document).ready(function(){
var found_images = $("img").css('display','none');
var image_parents = new Array();
var counter = 0;
	jQuery.makeArray(found_images);
	found_images.each(function(image){
		if (!this.complete){
		image_parents[counter] = $(this).parent();
		$(this).remove();
		}
		else {
		this.loaded = true;
		$(this).fadeIn();
		}
		
		counter ++;
		
	})

	counter = 0;
		found_images.each(function(image){		 
				if (!this.loaded){ 
					var	parent = $(image_parents[counter]);
				 var img = new Image();
				  $(img).load(function () {
				      $(this).css('display','none').appendTo(parent).fadeIn();
				   }).error(function () {}).attr('src', this.src);
				}		
				counter ++;			
				});		
});


function clearText(input_obj){
	var input = $(input_obj);
	if ( input.hasClass('clear') == false ) {
		if (input[type='text']){ input.val(''); }
		if (input[type='textarea']){ input.text(''); }
		input.addClass('clear');
	}
}