/* /////////////////////////////////////////////////////////////////////////
Javascript - EU.DIGIVAL.ES
Realizacion: digival.es 
joseignacio.marcos@digival.es
///////////////////////////////////////////////////////////////////////// */
var ingles;
function iniciaEU(){
	
	//CAJA DE USUARIO ------------------------------------------------------------------------------------
	if($('#usuario').length){ 
		$('#usuario').focus(function (){
			if($('#usuario').val()=='Username') ingles=1;
			if($('#usuario').val()=='' || $('#usuario').val()==' ' || $('#usuario').val()=='Usuario' || $('#usuario').val()=='Username') $('#usuario').val('');
		});
		 $('#usuario').blur(function () {
        	if($('#usuario').val()=='' || $('#usuario').val()==' '){ 
				if(ingles==1) $('#usuario').val('Username');
				else $('#usuario').val('Usuario');
			}
    	});
	}//fin del input de usuario ----------------------------------------------------------------------------
	
	//CAJA DE PASSWORD -------------------------------------------------------------------------------------
	if($('#password').length){ 
		$('#password').focus(function (){
			$('#password').replaceWith('<input id="password" name="password" type="password" value="" class="campoform" maxlength="8" />');
			$('#password').focus();
		});
	}//fin del input de password ---------------------------------------------------------------------------
	
	if($('#moduloEs').length){
	  setInterval("slideSwitch('#moduloEs div')", 12000 );
	}
	
} //FIN DE INICIANUTRICION


/*** -------------------------------------------------------------------------------------------
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
**------------------------------------------------------------------------------------------- */
function slideSwitch(toslide) {

   var $active = $(toslide+'.active');

    if ( $active.length == 0 ) $active = $(toslide+':last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $(toslide+':first');

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

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

/* -------------------------------------------------------------------------------------------
LOAD -----------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------- */ 
$(document).ready(iniciaEU);