/*Sustitucion de imagenes por enlaces*/
/*<a href="http://www.google.es" id="img/google" class="cambiogif">Buscador Web</a>*/
/*El script me cambiaria lo anterior por <img src="img/google.gif" />*/
jQuery.fn.loadthis = function(format, path, onload){
	if(!document.images) return this;
	if(!path)path = "../../../../img/";
	this.each(
		function(){
			var img = $("<img>"), el = jQuery(this);
			var file;
			var re = /(?:{src\:)(\S+)(?:})/i;
			var m = this.className.match(re);
			if(m){
				file = path + m[1];
			}else{
				file = path + this.id + "." + format;
			}
			jQuery(img).attr({
				src: file,
				alt: el.text()
			}).load(typeof onload == "function" ? onload : function(){} );
			var a = el.find("a");
			var toAppend = a.length ? a.empty().append(img) : img;
			el.empty().append(toAppend);
		}
	)
	return this;
}
/*Delay en procesos jquery*/
/*Retrasa 2 segundos la aplicacion de show en el contenedor ID*/
/*	$(this).delay(2000,function(){*/
/*		$("#id").show('slow');*/
/*	});*/
jQuery.fn.delay = function(time,func){
	return this.each(function(){
		setTimeout(func,time);
	});
};
function validate(){
	if($("input#INI_actividad").val()){
		$("#formulario_INI").submit();
	}else{
		$("#INI_actividad").fadeOut("slow").fadeIn("slow").css({'background' : 'red', 'color' : 'white'}).val(texto);
	}
}
function v_form(){
	if($("#SEND_form").validate()){
		$("#SEND_form").submit();
	}
}
