$(function() {
	var $test3 = $('#text3'),
		$caption = $('div.slide_caption'),
		$pause = $('#pause'),
		$resume = $('#resume'),
		$freeze = $('#freeze'),
		$stop = $('#stop'),
		$restart = $('#restart'),
		STOP = 1, RUN = 2, PAUSE = 3;



	$test3.crossSlide({
		fade: 1
	}, [
		{
			src:  '/img/1.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
		},{
			src:  '/img/2.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  '/img/3.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  '/img/4.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  '/img/5.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  '/img/6.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  '/img/7.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  '/img/8.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
		}, {
			src:  '/img/9.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
			}, {
			src:  '/img/10.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
				}, {
			src:  '/img/11.jpg',
			alt:  'Decoracion de jardines con fuentes y esculturas',
			from: 'top left',
			to: 'top left',
			time: 4
		}
	], function(idx, img, idxOut, imgOut) {
		if (idxOut == undefined) {
			$caption.text(img.alt).animate({ opacity: .77 })
		} else {
			$caption.animate({ opacity: 0 })
		}
	});
	$caption.show().css({ opacity: 0 })
	$caption.show().css({ z_index: 10000 })

	function state(state) {
		$pause.attr('disabled', state != RUN);
		$resume.attr('disabled', state != PAUSE);
		$freeze.attr('disabled', state == STOP);
		$stop.attr('disabled', state == STOP);
	}
	state(RUN);

	$pause.click(function() {
		$test3.crossSlidePause();
		state(PAUSE);
	});

	$resume.click(function() {
		$test3.crossSlideResume();
		state(RUN);
	})

	$freeze.click(function() {
		$test3.crossSlideFreeze();
		state(STOP);
	});

	$stop.click(function() {
		$test3.crossSlideStop();
		$caption.css({ opacity: 0 })
		state(STOP);
	});

	$restart.click(function() {
		$test3.crossSlideRestart();
		state(RUN);
	});

	
});
$(document).ready(function() {	$("#logout").click(function() {		$.ajax({			url: $(this).attr("href"),			success: function() {				location.reload();							}		});		return false;	});		$("#login-form").submit(function() {		$("#login_usr").attr("disabled", true);		$("#login_pwd").attr("disabled", true);		$("#login_button").attr("disabled", true);			    var options = {	            type: "POST",	            data: {	            	"login[usr]": $("#login_usr").val(),	            	"login[pwd]": $("#login_pwd").val()	            },	            success: function(result) {	    			if(result.respuesta == "error") {	    				$("#login_usr").attr("disabled", false);	    				$("#login_pwd").attr("disabled", false);	    				$("#login_button").attr("disabled", false);	    			} else {	    				location.reload();	    			}	            },	            error: function(jqXHR, textStatus, errorThrown) {	            }	    };	    $(this).ajaxSubmit(options);		return false;	});	    $(".defaultText").focus(function(srcc) {    	if ($(this).val() == $(this)[0].title) {    		$(this).removeClass("defaultTextDisabled");    		$(this).val("");    	}    });    	        $(".defaultText").blur(function() {    	if ($(this).val() == "") {    		$(this).addClass("defaultTextDisabled");    		$(this).val($(this)[0].title);    	}    });    	        $(".defaultText").blur();});

