jQuery(document).ready(function(){

		ezi_cycle()

		ezi_scroll_top();
		
        ezi_demobox();

		//$().jSnow();
}); 
        function ezi_cycle() {
			jQuery('#slider-in').cycle({
				fx: 'scrollLeft',
				speed:    500, 
    			timeout:  5000, 
				pager:    '#nav', 
				pause:    true ,
     
				// callback fn that creates a thumbnail to use as pager anchor 
				pagerAnchorBuilder: function(idx, slide) { 
					return '<li></li>'; 
				} 
			});
			jQuery('#tm-top, #tm-bottom').cycle({
				fx: 'fade',
				speed:    600, 
    			timeout:  6000,
				pause:    true    
			});
		}
		
		function ezi_scroll_top(){
			jQuery('#top').click(function() {
            	jQuery('html, body').animate({scrollTop:0}, 'slow');
            });
        }
        function ezi_demobox(){
			// center the box
			jQuery.fn.center = function (absolute) {
				return this.each(function () {
					var t = jQuery(this);
					t.css({
						position:    absolute ? 'absolute' : 'fixed', 
						left:        '50%', 
						top:        '50%'
					}).css({
						marginLeft:    '-' + (t.outerWidth() / 2) + 'px', 
						marginTop:    '-' + (t.outerHeight() / 2) + 'px'
					});
					if (absolute) {
						t.css({
							marginTop:    parseInt(t.css('marginTop'), 10) + jQuery(window).scrollTop(), 
							marginLeft:    parseInt(t.css('marginLeft'), 10) + jQuery(window).scrollLeft()
						});
					}
				});
			};
			jQuery("#demo-box").center();
			// slide up/down login panel
			jQuery("#demo").click(function(){
				jQuery('body').append('<div id="overlay" />');
				jQuery('#overlay').fadeTo('fast', 0.3);
				jQuery("#demo-box").stop().fadeIn(1);
			});
			jQuery("#close").click(function(){
				jQuery('#overlay').fadeOut();
				jQuery("#demo-box").fadeOut(1);
			});			
		}

