function swing($){

	var uc_events = $("div#highlighted div#main div#upcoming_events");
	var info = $("div#highlighted div#main div#wordtheatre_info");
	uc_events.css('opacity','0.75');
	uc_events.bind("click",moveLeft);
	uc_events.bind("mouseenter",highlight);
	uc_events.bind("mouseleave",dim);
	
		
	function moveLeft(){
		// this function will show the uncoming events
		//unbinding
		uc_events.unbind("click",moveLeft);
		uc_events.unbind("mouseenter",highlight);
		uc_events.unbind("mouseleave",dim);
		//wordtheatre_info moves
		info.animate({width:50,opacity:0.7},{queue:false, duration:1500});
		info.children("div#logo").animate({width:50,opacity:0.0},
				{queue:false, 
				duration:1500,
				complete:function(){
					info.children("div#logo").addClass("inactive");
					info.children("span#banner").css('display','block');
					info.children("span#banner").animate({opacity:1.0},
						{
						queue:false,
						duration:300,
						complete:function(){
							// binding
							info.bind("click",moveRight);
							info.bind("mouseenter",highlight);
							info.bind("mouseleave",dim);
							}
						});
					}
				});
		
		//upcoming_uc_events moves
		uc_events.children("span#banner").animate({opacity:0.0},{queue:false,duration:300});
		uc_events.animate({width:960,opacity:1.0},{queue:false, duration:1500});
		uc_events.children("#title").removeClass("inactive");
		uc_events.children("#title").css("opacity","0.0");
		uc_events.children("div#scroll").children(".arrow").css("opacity","0.0");
		uc_events.children("div#scroll").children(".arrow").removeClass("inactive");
		uc_events.children("div#scroll").children("div#wrapper_items").css("opacity","0.0");
		uc_events.children("div#scroll").children("div#wrapper_items").removeClass("inactive");
		uc_events.children("div#scroll").children("div#wrapper_items").animate({width:870,opacity:1.0},
			{
			queue:false, 
			duration:1500,
			complete:function(){
				uc_events.children("#title").animate({opacity:1.0},{queue:false, duration:200});
				uc_events.children("div#scroll").children(".arrow").animate({opacity:1.0},{queue:false, duration:500});
				uc_events.children("div#scroll").children("div.arrow").animate({opacity:1.0},{queue:false, duration:300});
				uc_events.children("div#scroll").children("div#wrapper_items").children("div.current").removeClass("inactive");
				uc_events.children("div#scroll").children("div#wrapper_items").children("div.current").css("opacity","0.0");
				uc_events.children("div#scroll").children("div#wrapper_items").children("div.current").animate({opacity:1.0},{queue:false, duration:500});
			}
		});
	}// end of moveLeft;
	
	function moveRight(){
		//binding
		info.unbind("click",moveRight);
		info.unbind("mouseenter",highlight);
		info.unbind("mouseleave",dim);
		
		//wordtheatre_info moves
		info.animate({width:960},{queue:false, duration:1500});
		info.children("span#banner").animate({opacity:0.0},{queue:false,duration:300});

		info.children("div#logo").animate({width:960},
			{queue:false, 
			duration:1500,
			complete:function(){
				info.children("div#logo").css("display","block");
				info.children("div#logo").animate({opacity:1.0},{queue:false, duration:500});
			}
		});
		

		//wordtheatre_info moves
		/*
		info.animate({width:50,opacity:0.7},{queue:false, duration:1500});
		info.children("div#logo").animate({width:50,opacity:0.0},
				{queue:false, 
				duration:1500,
				complete:function(){
					info.children("span#banner").css('display','block');
					info.children("span#banner").animate({opacity:1.0},
						{
						queue:false,
						duration:300,
						complete:function(){
							// binding
							info.bind("click",moveRight);
							info.bind("mouseenter",highlight);
							info.bind("mouseleave",dim);
							}
						});
					}
				});
		*/
		
		// upcoming_uc_events moves
		uc_events.animate({width:50,opacity:0.7},{queue:false, duration:1500});
		uc_events.children("div").animate({width:50,opacity:0.0},
				{queue:false, 
				duration:1500,
				complete:function(){
					uc_events.children("div").css('display','none');
					uc_events.children("span.text_90_deg").css('display','block');
					uc_events.children("span.text_90_deg").animate({opacity:1.0},
						{
						queue:false,
						duration:300,
						complete:function(){
							uc_events.bind("click",moveLeft);
							uc_events.bind("mouseenter",highlight);
							uc_events.bind("mouseleave",dim);
						}
						});
					}
				});
	}// end of moveRight
	
	function highlight(){
		$(this).animate({opacity:0.9},{queue:false, duration:150});
	}
	function dim(){
		$(this).animate({opacity:0.75},{queue:false, duration:250});
	}
	
	
}
//********************************************
// new swing in class
//*********************************************
(function($){
	var EYE = window.EYE = function() {
		var _registered = {
			init: []
		};
		return {
			init: function() {
				$.each(_registered.init, function(nr, fn){
					fn.call();
				});
			},
			extend: function(prop) {
				for (var i in prop) {
					if (prop[i] != undefined) {
						this[i] = prop[i];
					}
				}
			},
			register: function(fn, type) {
				if (!_registered[type]) {
					_registered[type] = [];
				}
				_registered[type].push(fn);
			}
		};
	}();
	$(EYE.init);
})(jQuery);

