var $j = jQuery.noConflict();
var checkErrors = 0;

$j(function() {
	$j('.nav a, #top').click(function(e){
		$j.scrollTo( this.hash || 0, 1000, {easing:'swing', queue:true});
		e.preventDefault();
	});
	
	//$j('#ngg-gallery-1-10').hide();


// Gallery 
	$j('#section-1 .inner > ul > li:even').addClass('first');
	$j('#section-1 .inner > ul > li:odd').addClass('last');
	$j('#section-1 .ngg-list').each(function(){
		$j(this).find('li:gt(0)').hide();
	});
	
	checkErrors = setInterval('checkmsg()', 500);

});
function checkmsg() {
  if($j('#usermessageb ol a').length > 0) {
    clearInterval(checkErrors);
    var a, b;
    $j('#usermessageb ol a').each(function() {
      a = $j(this).attr('href');
      b = '#' + $j(a).find('input, textarea').attr('id');
      $j(this).attr('href', b);
    });
    $j('#usermessageb ol a').click(function() {
      a = $j(this).attr('href');
      b = $j(a).offset();
      c = b.top - $j(a).siblings('.cf_li_text_err').height();
      $j('html').scrollTop(c);
      $j(a).focus();
      return false;
    });
  }
}
