

function slideSwitch() { /* Slide de imagenes XHTML Compatible */
    var $active = $('#slideshow img.active');

    if ( $active.length == 0 ) $active = $('#slideshow img:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$(function() {
    setInterval( "slideSwitch()", 5000 );
});


function nav(o) /* Auto select Compatible*/
   {
	   var e = document.getElementById('menu_rapido_select');
   var w = o.selectedIndex;
   var url_add = o.options[w].value;
   window.location= url_add;
   }
   
function externalLinks() { /* links externos XHTML compatibles */
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

function clean(o){ /* Limpia campos cuando se posa el foco */
	 o.setAttribute('value','');

}

function validaFormSimple(o){
	var mail = o.email.getAtribute('value')	;
	
	validadEmail(mail);
	
}
function validarEmail(valor) { /* Valida campos de Correo */
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
    return true;
  } else {
   
   return false;
  }
 }

function validaMarketSimple(form){
	if (form.nombre.value == ''){
		alert('Debe introducir un nombre.');
		form.nombre.focus();
		return false;
	}
	if (validarEmail(form.email.value) == false){
			alert('La direccion de Correo es incorrecta.');
			document.formMarketSimple.email.focus();
			return false;
	}
	else if (form.privacidad.checked == false){
		alert('Debe Aceptar nuestra politica de privacidad.');
		document.formMarketSimple.privacidad.focus();
		return false;
	}
	else{return true;}
}