// JavaScript Document
function vacio(q) {   
        for ( i = 0; i < q.length; i++ ) {   
                if ( q.charAt(i) != " " ) {   
                        return false   
                }   
        }   
        return true   
}


function testEmail(campoemail) {
var Email =  new String(campoemail); 
var Correct = true; 
CharCount=1; 
strLength=Email.length; 
while ((CharCount < strLength) && (Email.charAt(CharCount) != '@')) 
{ 
	CharCount++ 
} 
if ((CharCount>= strLength) || (Email.charAt(CharCount) != '@'))  
{  
	Correct = false; 
} 
else 
{ 
	CharCount += 2; 
} 
while ((CharCount < strLength) && (Email.charAt(CharCount) != '.')) 
{ 
	CharCount++ 
} 
if ((CharCount>= strLength - 1) || (Email.charAt(CharCount) != '.')) 
{ 
	Correct = false; 
} 
return Correct 
} 


function validarURL(url){
var re=/^http:\/\/\w+(\.\w+)*\.\w{2,3}$/; 
return re.test(url);
}


function txt_consulta_correcta(texto)
{
var correcto = true;
var patron = /http|link=|url=/i;
if (texto.search(patron)>=0)
	{
		alert(texto)
		correcto = false;
	}

return correcto
}
