// when the DOM is ready
$(function () {
  var img = new Image();
  
  // wrap our new image in jQuery, then:
  $(img)
    // once the image has loaded, execute this code
    .load(function () {
      // set the image hidden by default    
      $(this).hide();
    
      // with the holding div #loader, apply:
      $('loading')
        // remove the loading class (so no background spinner), 
        .removeClass('loading')
        // then insert our image
        .append(this);
    
      // fade our image in to create a nice effect
      $(this).fadeIn();
    })
    
    // if there was an error loading the image, react accordingly
    .error(function () {
      // notify the user that the image could not be loaded
    })
    
    // *finally*, set the src attribute of the new image to our image
    .attr('src', '');
});



	$(document).ready(function() {
		/*
		var defaults = {
  			containerID: 'moccaUItoTop', // fading element id
			containerHoverClass: 'moccaUIhover', // fading element hover class
			scrollSpeed: 1200,
			easingType: 'linear' 
 		};
		*/		
		$().UItoTop({ easingType: 'easeOutQuart' });
	});

function sys_toggle() {
	jQuery(".toggle_content").hide(); 

	jQuery("h5.toggle").toggle(function(){
		jQuery(this).addClass("active");
		}, function () {
		jQuery(this).removeClass("active");
	});

	jQuery("h5.toggle").click(function(){
		jQuery(this).next(".toggle_content").slideToggle();
	});
}

jQuery(function(){
	sys_toggle();
	jQuery('ul.sf-menu ul li span').css({display:'none'});
	jQuery('.sub_nav li span').css({display:'none'});
	jQuery('.sitemap li span').css({display:'none'});

	Cufon.replace('h1, h2, h3, .post-info .date, .latest_news .date,', { hover:true, fontFamily: 'BPreplay' });
	Cufon.replace('h4, h5, h6, .sf-menu a, .subheader .subdesc, .subheader span, blockquote p, a.button span,', { hover:true, fontFamily: 'TitilliumText14L' });
});
