$(document).ready(function() {
$('#btn_busca').bind("click",
		function(e) {
			var obj = $('#buscabusca');
			if(obj.val().length >= 4) {
				$('#contenedor').empty();
				$('#contenedor').prepend('<img src="js/load.gif" alt="Cargando ...">');
				$.ajax({
					type: "POST",
					url: "busca_prov.php",
					data: "busca="+obj.val(),
					success: function(msg){
						$('#btn_vacia').show("slow");
						$('#contenedor').empty();
						$('#contenedor').prepend(msg);
					}
				});
			} else { 
         			var obj_msg_error = $('#mensage_error');
              alert(obj_msg_error.val());}
		}
	);
$('#btn_vacia').bind("click",
		function(e) {
			$('#buscabusca').val('');
			$('#contenedor').empty();
			$('#contenedor').prepend('<img src="js/load.gif" alt="Cargando ...">');
			$.ajax({
				type: "POST",
				url: "busca_prov.php",
				data: "busca=",
				success: function(msg){
				$('#btn_vacia').hide("slow");
				$('#contenedor').empty();
				$('#contenedor').prepend(msg);
				}
			});
		}
	);
});

// JavaScript Document
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}

//-->

function swfs(path,width,height,bgcolor)

{
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" align="middle">\n');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<param name="movie" value="'+path+'" />\n');
    document.write('<param name="quality" value="high">\n');
    document.write('<param name="wmode" value="transparent">\n');
    if (bgcolor!=null) document.write('<param name="bgcolor" value="'+bgcolor+'" />');
    if (bgcolor!=null) document.write('<embed src="'+path+'" quality="High" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" />');    
    else               document.write('<embed src="'+path+'" quality="High"  width="'+width+'" height="'+height+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" />');    
    document.write('</'+'object>');

} 

function ayuda() {
    window.open("livehelp/index.php?LANGUAGE=es","Window1","menubar=no,width=615,height=440,toolbar=no");
}
function help() {
window.open("livehelp/index.php?LANGUAGE=en","Window1","menubar=no,width=615,height=440,toolbar=no");
}
function cargarSWF(direccion,ancho,alto){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ancho+'" height="'+alto+'">');
    document.write('<param name="movie" value="'+direccion+'" /><param name="quality" value="high"><param name="menu" value="false" /><param name="wmode" value="transparent" /><embed src="'+direccion+'" quality="high" wmode=transparent pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ancho+'" height="'+alto+'"></"+"embed><noembed> <div align="center">Su navegador no dipone de una versi?n apropiada de flash player. <br> Puede obtenerla gratuitamente <a href="http://www.adobe.com/es/products/flashplayer/">aqui </'+'a> </'+'div> </'+'noembed></'+'object>');
}
