function resizeForm(){
  if (document.all){
   var sSize = '45';
   if (navigator.appVersion.indexOf('MSIE 5.5') != -1)
     sSize = '38';
   for (var i=0; i < document.forms[0].length - 1; i++){
     if (document.forms[0].elements[i].type == 'text')
       document.forms[0].elements[i].size = sSize;
   }
  }
}
function ChangeMail(oForm,email,oLink){
	var sName = new String();
	var sValue = new String();
	var sBody = new String();
	for (var i=0;oForm.elements[i]; i++){
		sName = oForm.elements[i].name;
		sValue = oForm.elements[i].value;
	    if (oForm.elements[i].type == 'radio'){
			if (!oForm.elements[i].checked)
			  sValue = ''
		}
		if ((!(sName=='subject')) && sValue){
			sBody = sBody + sName.toUpperCase() + ': ' + sValue + '.' + String.fromCharCode(13,10);
		}
	}
	oLink.href = 'mailto:' + email + '?subject=' + oForm.elements.subject.value + '&body=' + escape(sBody);
}
function validate() {
	oForm = document.forms[0];
	if(isWhitespace(oForm.Nombre.value)) { alert("Por favor, indique su nombre."); oForm.Nombre.focus();  return false; }
	if(!validamail(oForm.email.value)) { alert("El e-mail es erróneo. Por favor, revíselo."); oForm.email.focus(); return false; }
	if(isWhitespace(oForm.subject.value)) { alert("Por favor, indique un asunto."); oForm.subject.focus(); return false; }
	return true;
}
function validateProducts() {
	oForm = document.forms[0];
	if(isWhitespace(oForm.Nombre.value)) { alert("Por favor, indique su nombre."); oForm.Nombre.focus(); return false; }
	if(!validamail(oForm.email.value)) { alert("El e-mail es erróneo. Por favor, revíselo."); oForm.email.focus(); return false; }
	if(isWhitespace(oForm.Telefono.value)) { alert("Por favor, indique un asunto."); oForm.Telefono.focus(); return false; }
	return true;
}
function validamail(email){
   var isEmail = email.match(/^\w+(-\w+)*(\.\w+(-\w+)*)*@\w+(-\w+)*(\.\w+(-\w+)*)*\.([a-z]{3}|[a-z]{2})$/);
   if (!isEmail) {
      return false;
   } else {
      return true;
   }
}
function CheckLength(oControl,nMax,sDesc){
    var sValor = oControl.value;
    var sMensaje = new String();
    var nLongitud = sValor.length;
    if (nLongitud >= nMax){
oControl.value = sValor.substring(0,nMax - 1);
sMensaje = 'El campo ' + sDesc+ ' no puede sobrepasar los ' + nMax + ' caracteres.';
alert(sMensaje);
    }
  }
function isWhitespace (s)
{
  var whitespace = " \t\n\r";
  var i;
    if (isEmpty(s)) return true;
    for (i = 0; i < s.length; i++)
    {
var c = s.charAt(i);
if (whitespace.indexOf(c) == -1) return false;
    }
    return true;
}
function isEmpty(s)
{ return ((s == null) || (s.length == 0))
}