
$(function() {
	$(".mailto").emailencode();
	// curved corners at bottom
	container_settings = {
		tl: { radius: 0 },
		tr: { radius: 0 },
        bl: { radius: 16 },
        br: { radius: 16 },
        antiAlias: true,
        autoPad: true,
        validTags: ["div"]
    }
    // curved corners all around (insets)
	contact_settings = {
		tl: { radius: 6 },
		tr: { radius: 6 },
        bl: { radius: 6 },
        br: { radius: 6 },
        antiAlias: true,
        autoPad: true,
        validTags: ["div"]
    }


	$('#container').corner(container_settings);
	$('#contact').corner(contact_settings);
	
	
	$('p').hide();
	$('img').hide();
	var animations = new Array();
	$('img').each(function() {
	    animations.push($(this));
	});
	$('p').each(function() {
	    animations.push($(this));
	});
	doAnimation(animations.shift());	
	function doAnimation(animatedItem) {

	    animatedItem.fadeIn("fast", function() {

	        if(animations.length > 0) {
	        	doAnimation(animations.shift());
        	} else {
        		
        	}
	    });
	}
    
});


/* LiteTest email encode
* Version 0.9
* Author Jonas Hagstedt
* URI: http://www.litetest.com/Resources.aspx/EmailEncode
* Released with the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
(function($) {
	$.fn.emailencode = function(options) {
		var settings = jQuery.extend({
			atsign: "z"
		}, options);

		return this.each(function() {
			var address = $(this).attr("href");
			var formatedAddress = address.replace(settings.atsign, "@");
			$(this).attr("href", "mailto:" + formatedAddress);
		});
	};
})(jQuery);
