$(function(){
	  
//SET ON STATE FOR BUTTON//
	$('.navigation a').css({backgroundPosition: '0px -200px'});
	var button_width = $('a#on').width();
	var offset = button_width/2 -10 ;
	offset += 'px';
	$('a#on').css({backgroundPosition: '0px -49px', 'border-right':'1px solid #a5b4b8', 'border-left':'1px solid #a5b4b8', 'padding':'13px 29px 0px 29px'});
	
	$('a#on').append('<br /><img src="images/nav_dash.gif" class="alwaysarrow" alt="" />');
	$('a#on').children('.alwaysarrow').css({'display':'block', 'position':'relative', 'top':'7px', 'left':offset});
	if ($.browser.msie && $.browser.version <= 7 ) $('a#on').children('.alwaysarrow').css({'display':'block', 'position':'relative', 'top':'7px', 'left':'0px'});
	
///////////////////

//ROLLOVER//
	$('li.nav').bind('mouseenter', function(){
			  
				var theLink = $(this).children().eq(0);			

				if($(theLink).attr('id') !='on'){
					
					
					var button_width = $(theLink).width();
					var offset = button_width/2 -10 ;
					if ($.browser.msie && $.browser.version <= 7 ) offset = 0;

					offset += 'px';
					
					
					$(theLink).css({backgroundPosition: '0px -50px'})
					
					if ($(theLink).children('.arrow').length <=0){
						var arrow = document.createElement('img');
						    $(arrow).attr('src', 'images/nav_dash.gif');
							$(arrow).addClass('arrow');
						$(theLink).append('<br />');
						$(theLink).append(arrow);
						$(theLink).children('.arrow').css({'display':'block', 'position':'relative', 'top':'16px', 'left':offset});
					}
					
					var thisArrow = $(this).children('a').children('.arrow')
					$(thisArrow).css({'left':offset});
					$(thisArrow).stop().animate({top:'7', opacity:'1'}, 100);
				}
					if( $(this).children('.dropdown').css('display') == 'none'){
						$(this).children('.dropdown').fadeIn(200);
					}else{
					$(this).children('.dropdown').stop().animate({opacity: '1'}, 100);
					}
				
				
				
			})
			.bind('mouseleave', function(e){
										 
				if( $(this).children('.dropdown').css('display') == 'block'){
					$(this).children('.dropdown').fadeOut(200);
				}else{
				$(this).children('.dropdown').stop().animate({opacity: '0'}, 100);
				}

				var theLink = $(this).children().eq(0);	
				var thisArrow = $(this).children('a').children('.arrow')
				
				if($(theLink).attr('id') !='on'){
				
				$(theLink).css({backgroundPosition: '0px -200px'})
					

				$(thisArrow).stop().animate({'top':'15px', opacity:'0'}, 100);

				}

				
			});	
//END ROLLOVER//

	
//EQUAL HEIGHT COLS//
if ($('#home_header').length <=0){
	var highestCol = Math.max($('.col_main').height(),$('.col_sub').height());
	$('.content .center').height(highestCol);
}
/////////////////////////

//TWITTER FEED//
		$("#quote_container").tweet({
            username: 'codeplex_f',
            join_text: "auto",
            count: 1,
            loading_text: "loading tweet..."
        });
/////////////////////////




});//END DOCUMENT.READY

