//(function($){
window.addEvent('domready',function() {

	// "MORE" FROM POST-VIEW
	$$('.mosa a.post-view').addEvents({
		mouseenter: function() {
			this.getElement('.post-detail').set('morph', {
				duration: 300,
				transition:  Fx.Transitions.Sine.easeOut
			}).morph({
				'bottom': '0'
			});
		},
		mouseleave: function() {
			this.getElement('.post-detail').set('morph', {
				duration: 300,
				transition:  Fx.Transitions.Sine.easeOut
			}).morph({
				'bottom': '-29px'
			});
		}
	});
	
	// TOGGLE MIN/MAX
	$$('.xmize').addEvent('click', function(){
		if (this.retrieve("toggle") == null)
  	 	{
  	 		$$('.mosa a.post-view').tween('height', '29px');
  	 		this.store("toggle","min");
  	 		this.getElement('.toggle').morph({
				'background-position':'0px 0px' 
			});
  	 		this.getElement('a#max').morph({
				'color':'#5883a0' 
			});
  	 		this.getElement('a#min').morph({
				'color':'#FFFFFF' 
			});
  	 	}
 		else if (this.retrieve("toggle") == 'max')
  	 	{
  	 		$$('.mosa a.post-view').tween('height', '29px');
  	 		this.store("toggle","min");
  	 		this.getElement('.toggle').morph({
				'background-position':'0px 0px' 
			});
  	 		this.getElement('a#max').morph({
				'color':'#5883a0' 
			});
  	 		this.getElement('a#min').morph({
				'color':'#FFFFFF' 
			});
  	 	}
  		else if (this.retrieve("toggle") == 'min')
  	 	{
  	 		$$('.mosa a.post-view').tween('height', '182px');
  	 		this.getElement('.toggle').morph({
				'background-position':'117px 0px' 
			});
  	 		this.getElement('a#max').morph({
				'color':'#FFFFFF' 
			});
  	 		this.getElement('a#min').morph({
				'color':'#5883a0' 
			});
  	 		this.store("toggle","max");
  	 	}
	});
		
	// FADE NAV
	/*var navs = $$('.nav a');
	for (var i = 0; i < navs.length; i++)
	{
		var item = navs[i];		
		var isOn = item.getProperty('class');		
		if (isOn != "on") {
			item.addEvents({
				mouseenter: function(){
					this.set('morph', {
						duration: 600,
						transition:  Fx.Transitions.Sine.easeOut
					}).morph({
						'color': '#FFF',
						'border-bottom-width':'5px',
						'padding-bottom':'6px'
					});
				},
				mouseleave: function(){
					this.set('morph', {
						duration: 600,
						transition:  Fx.Transitions.Sine.easeOut
					}).morph({
						'color': '#899eab',
						'border-bottom-width':'1px',
						'padding-bottom':'10px'
					});
				}
			});
		}
	}
	
	// FADE SIDEBAR LINKS
	var items = $$('.list a','ul.post-categories a');
	for (var i = 0; i < items.length; i++)
	{
		var item = items[i];
		var prnt = item.getParent('li');
		var isOn = prnt.getProperty('class');
		if (isOn.indexOf('current-cat') == -1) {	
			item.addEvents({
				mouseenter: function(){
					this.set('morph', {
						duration: 300,
						transition:  Fx.Transitions.Sine.easeOut
					}).morph({
						'color': '#FFF',
					});
				},
				mouseleave: function(){
					this.set('morph', {
						duration: 300,
						transition:  Fx.Transitions.Sine.easeOut
					}).morph({
						'color': '#899eab',
					});
				}
			});
		}
	}
	
	// CATEGORY RSS
	var items = $$('.title a');
	for (var i = 0; i < items.length; i++)
	{
		var item = items[i];
		item.addEvents({
			mouseenter: function(){
				this.fade('in');
			},
			mouseleave: function(){
				this.fade(0.6);
			}
		});
	}*/
	
	// EXPAND	
	$$('a.aexpand').addEvent('click', function(){
		if (this.retrieve("toggle") == null)
  	 	{
  	 		this.morph({
				'background-position':'0px 0px' 
			});
  	 		$$('.wp-tag-cloud').tween('height', '275px');
  	 		this.store("toggle","min");
  	 	}
 		else if (this.retrieve("toggle") == 'max')
  	 	{
  	 		this.morph({
				'background-position':'0px 0px' 
			});
  	 		$$('.wp-tag-cloud').tween('height', '275px');
  	 		this.store("toggle","min");
  	 	}
  		else if (this.retrieve("toggle") == 'min')
  	 	{
  	 		this.morph({
				'background-position':'0px -19px' 
			});
  	 		$$('.wp-tag-cloud').tween('height', '0px');
  	 		this.store("toggle","max");
  	 	}	
 
	});
	
});
//})(document.id);