if (!("console" in window) || !("firebug" in console)) {
	var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
	window.console = {};
	for (var i = 0, len = names.length; i < len; ++i) {
		window.console[names[i]] = function(){};
	}
}

var themePath = "/wp-content/themes/MRipoll_1.0";



jQuery(document).ready(function($){
	
	$('input[type="text"]').addClass("idleField");
	$('input[type="password"]').addClass("idleField");
	
	$('input[type="text"]').focus(function() {
		$(this).removeClass("idleField").addClass("focusField");
        if (this.value == this.defaultValue){
        	this.value = '';
    	}
        if(this.value != this.defaultValue){
	    	this.select();
        }
    });
    
    
    $('input[type="password"]').focus(function() {
		$(this).removeClass("idleField").addClass("focusField");
        if (this.value == this.defaultValue){
        	this.value = '';
    	}
        if(this.value != this.defaultValue){
	    	this.select();
        }
    });
    
    
    
    $('input[type="text"]').blur(function() {
    	$(this).removeClass("focusField").addClass("idleField");
        if (this.value == ''){
        	this.value = (this.defaultValue ? this.defaultValue : '');
    	}
    });
    
    
    $('input[type="password"]').blur(function() {
    	$(this).removeClass("focusField").addClass("idleField");
        if (this.value == ''){
        	this.value = (this.defaultValue ? this.defaultValue : '');
    	}
    });



    
    
    
	$("a[rel^='prettyPhoto']").prettyPhoto({

	theme: 'light_rounded',
	allowresize: false,
	showTitle: true,
	default_width: 640,
	default_height: 480
	});


	$('#feature').nivoSlider({ 
		controlNav: false,
		effect: 'fade',
		slices:30,
		animSpeed:1000,
		pauseTime:6000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:false, //Next & Prev
		directionNavHide:false,
		pauseOnHover:true,
		controlNav:true
	});
	
	
	
	
	
});

function isValidEmailAddress(emailAddress) {
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailAddress);
}




