var  $j = jQuery.noConflict();
$j(document).ready(function(){
    $j("a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'facebook',slideshow:false,autoplay_slideshow:false});
});

$j(document).ready(function(){
    $j('#contato').click(function(){

					$j('html, body').animate({
						scrollTop: $j("#rodape").offset().top
					}, 1000);


				 });
});

$j(document).ready(function() {
	$j('input[title]').each(function() {
		if($j(this).val() === '') {
			$j(this).val($j(this).attr('title'));
		}

		$j(this).focus(function() {
			if($j(this).val() == $j(this).attr('title')) {
				$j(this).val('').addClass('focused');
			}
		});
		$j(this).blur(function() {
			if($j(this).val() === '') {
				$j(this).val($j(this).attr('title')).removeClass('focused');
			}
		});
	});
});

$j(document).ready(function() {
    var options = {
        dataType:  'json',
        success:   showResponse
    };

    // bind form using 'ajaxForm'
    $j('#form_contato').ajaxForm(options);

});




function showResponse(data)  {
       if(data.sucess == true)
       {

            $j('#error').empty().html(data.message);
            document.getElementById('form_contato').reset();
            //$('#form_contato').reset();
       }
       else
       {
        $j('#error').empty().html(data.message);
       }
}

