$(document).ready(function() {

$('#slide-show')
.after('<div id="slide-buttons">')
.cycle({ 
fx:     'scrollLeft', 
speed:  '500', 
cleartype: !$.support.opacity,
cleartypeNoBg: true,
timeout: 8000, 
nowrap: 0,
pause: true,
pager:  '#slide-buttons',
pagerAnchorBuilder: function(idx, slide) {return '<li><a href="#"></a></li>';}
});

//remove default input text

$('input[type="text"]').each(function() {
    var default_value = this.value;
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
        }
    });
});

//lightbox

$("a.product-images").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
	});

//modal

$('.idea-submission').click(function (e) {
$('#idea-modal').modal({
containerId: 'idea-container',
overlayClose: 'true',
position: ["23%","35%"]
});

});

$('.login-box').click(function (e) {
$("#login-modal").modal({onOpen: function (dialog) {
	dialog.overlay.fadeIn('slow', function () {
		dialog.container.slideDown('slow', function () {
			dialog.data.fadeIn('slow');
		});
	});
}});
});


//validate registration form

$("#register_form").validate({
  rules: {
    password: "required",
    confirm_password: {
      equalTo: "#password"
    }
  }
});


});
