$(function(){
		
    $('#tick').cycle({
		fx: 'fade',
		pause: 1,
		slideResize: 0,
		speed: 500,
		timeout: 10000
	});
		
    $('#carousel').cycle({
		fx: 'fade',
		pause: 1,
		slideResize: 0,
		speed: 1000,
		timeout: 6000
	});
	
	$("form.validate").validate();
});

$('input.email').focus(function()
{
	if($(this).val() == 'Email') $(this).val('');
});

$('input.name').focus(function()
{
	if($(this).val() == 'Name') $(this).val('');
});

jQuery.jQueryRandom = 0;
jQuery.extend(jQuery.expr[":"],
{
    random: function(a, i, m, r) {
        if (i == 0) {
            jQuery.jQueryRandom = Math.floor(Math.random() * r.length);
        };
        return i == jQuery.jQueryRandom;
    }
});

jQuery.fn.center = function()
{
   return this.each(function()
   {
		var $self = jQuery(this);
		var width = $self.width();
		var containerWidth = $self.parent().width();
		var offset = (containerWidth-width)/2;
		
		$self.css('margin-left', offset);
   });
};
