// JavaScript Document
var initNewsEvents;
var initPortfolioEvents;

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

		
		/* small features */
     initPortfolioEvents = function()
		{
		$$('div.feat_container').addEvents({
		'mouseenter': function(){
			//alert('over');
			var bg = new Fx.Tween(this);
			var btn = new Fx.Tween(this.getFirst('.feat_morebtn').getFirst());
			if(this.getProperty('id')!='feat_nobackground1')
			{
				bg.set('background-color', '#ececec');        
			}
			btn.set('background-color','#0095d5');
			
		},
		'mouseleave': function(){
		   var bg = new Fx.Tween(this);
		   var btn = new Fx.Tween(this.getFirst('.feat_morebtn').getFirst());
		   if(this.getProperty('id')!='feat_nobackground1')
			{
			bg.set('background-color', '#ffffff');
			}
			btn.set('background-color','#d6d6d6');
		},
		'click': function(){
			window.location = this.getProperty('url');
		}
		});
		}
		
		
		
		/* overview portfolio features */
     initOverviewPortfolioEvents = function()
		{
		$$('div.feat_overview_container').addEvents({
		'mouseenter': function(){
			//alert('over');
			this.getFirst('.feat_overview_bottom').getFirst().getFirst().setStyle('color','#0095d5');
			
		},
		'mouseleave': function(){
		 this.getFirst('.feat_overview_bottom').getFirst().getFirst().setStyle('color','#48494a');
		},
		'click': function(){
			window.location = this.getProperty('url');
		}
		});
		}
	
	
	/*long features*/
	initNewsEvents = function()
	{
		$$('div.feat_news_container').addEvents({
		'mouseenter': function(){
			var bg = new Fx.Tween(this);
			var btn = new Fx.Tween(this.getFirst('.feat_news_morebtn').getFirst());
			bg.set('background-color','#ececec');        
			btn.set('background-color','#0095d5');		
		},
		'mouseleave': function(){
			var bg = new Fx.Tween(this);
			var btn = new Fx.Tween(this.getFirst('.feat_news_morebtn').getFirst());
			bg.set('background-color', '#ffffff');
			btn.set('background-color','#d6d6d6');
		},
		'click': function(){
		   window.location = this.getProperty('url');
		}
		});
	}
	
	
	initModuleEvents = function()
	{
	  $$('div.feat_small').addEvents({
	  'mouseenter': function(){
		  var bg = new Fx.Tween(this.getFirst('.highlight'));
		  bg.set('background-color','#ececec');   
	  },
	  'mouseleave': function(){
		  var bg = new Fx.Tween(this.getFirst('.highlight'));
		  bg.set('background-color','#ffffff');
	  },
	  'click': function(){
		   window.location = this.getProperty('url');
	  }
	  });
	}
	
	
	$$('.viewall').addEvents({	
		'mouseenter': function(){
		  this.setStyle('background-color','#0095D5');
  
	  },
	  'mouseleave': function(){
		 this.setStyle('background-color','#9ac2d6');
	  }, 
	  'click': function(){
		  var url = this.getProperty('url');
		  if(url!=null)
		  {
			  window.location = this.getProperty('url');
		  }
	  }
	  });
	  
	  
	  $$('span.title').addEvents({	
		'mouseenter': function(){
		  this.setStyle('color','#0095D5');
  
	  },
	  'mouseleave': function(){
		 this.setStyle('color','#48494A');
	  }
	  });
	  
	 
	  
	   $$('.navitem').addEvents({	 
	  'click': function(){
		  var url = this.getProperty('url');
		  if(url!=null)
		  {
			  window.location = this.getProperty('url');
		  }
	  }
	  });
	
		
	
});

