function validar_formulario()
{
   var sw1=0;
   if(document.getElementById('contenido').value == "")
	{
		alert('el campo descripcion no debe ser vacio');
		sw1 = 1;
		return false;
	}
   if(document.getElementById('foto').value != "")
   {
		var dato=document.getElementById('foto').value;
		//alert(dato)
		var vec=dato.split(".");
		//alert(vec[0])
		//alert(vec[1])
		var texto=vec[1].toLowerCase();
		//alert(texto)
		if(texto == 'jpg' )
		{ sw1 = 0;  }
		else 
		{
		  if(texto == 'jpeg')
		  {
		     sw1 = 0;
		   }
		  else
	      {
			  if(texto == 'png')
			   { sw1 = 0;  }
			  else
			   {
				 alert('la extencion del archivo debe de ser jpg o png intente nuevamente');
				 sw1=1;
				 return false;
				 
				}
		    }
		 }
	}
   else
   {
	  alert('el campo imagen no debe ser vacio');
	  sw1 = 1;
	  return false;
    }
   //////////////////////////////////////////
	// verifica si hubo algun error en alguno
	//////////////////////////////////////////
	if(sw1 == 0 )
	{
		return true; 
	}
	else
	{
		return false;
	}
}

////////////////////////////////////////////
// funcion para ver en una pantalla popup
////////////////////////////////////////////
function abrir_ventana (pagina) 
{
	var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=290, height=445, top=50, left=200";
	window.open(pagina,"Videos",opciones);
}

function validaemail(whatYouTyped)
{
	var fieldset = whatYouTyped.parentNode;
	var txt = whatYouTyped.value;
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txt)) 
	{
		//document.getElementById("guardar_servicio").disabled = "";
		
	} 
	else 
	{
		alert("Ingrese un correo electronico valido");
		//document.getElementById("guardar_servicio").disabled = "disabled";
		document.envio.email.focus();
		//donde form1 es el nombre del formulario 
		//y correo_electronico es el nombre del campo
	}  
  

 }