redir = function (url) {
	document.location.href = url;
}
//
cambiarImagen = function (imgName, imgSrc) {
  if (document.images){
    if (imgSrc != "none"){
      document.images[imgName].src = imgSrc;
    }
  }
}
//
function colorea(){
	if(document.getElementById('tunombre_h')){
	   document.getElementById('tunombre_h').style.color   = '#999999';
	   document.getElementById('tuemail_h').style.color     = '#999999';
	   document.getElementById('emailamigo_h').style.color = '#999999';
	}
}
window.onload = colorea;
//
function borra(id){
	switch(id){
		case 'tunombre_h':
			document.getElementById('tunombre_h').value = '';
			document.getElementById('tunombre_h').style.color = '#333333';
			document.getElementById('tunombre_h').style.background = '#fff';
			break;
		case 'tuemail_h':
			document.getElementById('tuemail_h').value = '';
			document.getElementById('tuemail_h').style.color = '#333333';
			document.getElementById('tuemail_h').style.background = '#fff';
			break;
		case 'sunombre':
			document.getElementById('sunombre').style.background = '#fff';
   		break;
		case 'suemail':
			document.getElementById('suemail').style.background = '#fff';
   		break;
		case 'desnombre':
			document.getElementById('desnombre').style.background = '#fff';
   		break;
		case 'desemail':
			document.getElementById('desemail').style.background = '#fff';
   		break;
		case 'comentario':
			document.getElementById('comentario').style.background = '#fff';
   		break;
		case 'nombre':
			document.getElementById('nombre').style.background = '#fff';
   		break;
		case 'email':
			document.getElementById('email').style.background = '#fff';
   		break;
		case 'telefono':
			document.getElementById('telefono').style.background = '#fff';
   		break;
		case 'apellido':
			document.getElementById('apellido').style.background = '#fff';
   		break;
	}
}
//-------------------------------------------------------
function limpia(obj){
	for (var i=(obj.length-1); i >= 0; i--){
		obj.options[i] = null;
	}
}
//-------------------------------------------------------
echeck = function (str) 
{
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   return false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		return false;
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		return false;
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		return false;
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		return false;
	 }
	
	 if (str.indexOf(" ")!=-1){
		return false;
	 }
	//
	 return true;
}
//-----------------------------------------------------
function suscribite() {
	var obj = document.getElementById("texto_suscribe");
	
	if(echeck(obj.value)) {
		var obj1 = document.getElementById("encab_suscribe");
		obj1.innerHTML = "Registrando ...";
		//
		x_suscripcion (obj.value, r_suscripcion)
	}
}
r_suscripcion = function(r)
{
	var obj = document.getElementById("encab_suscribe");
	obj.innerHTML = r;
	
	
}


//-----------------------------------------------------