(function($){
	$( document ).ready( function(){
		$('.widget_nav_menu .menu-sidebar-menu-container').before('<div class="bottom-shadow">&nbsp;</div><div class="top-shadow">&nbsp;</div>');
		$('.widget_nav_menu .menu').before('<div class="top-bg">&nbsp;</div><div class="bottom-bg">&nbsp;</div>');
		
		$('#respond #reply-title').prependTo('#respond #commentform');
		
		$('.post .wp-polls').wrap('<div class="bottom"><div class="top"></div></div>');
		$('.post .top').prepend('<h2 class="poll-title">Latest Poll What Do you Think?</h2>');
		
		checkSidenav();
		
		$('.blink')
			.focus(function(){
				if ( $(this).attr('value') == $(this).attr('title') ) {
					$(this).attr({ 'value': '' })
				};
			})
			.blur(function(){
				if ( $(this).attr('value') == '' ) {
					$(this).attr({ 'value': $(this).attr('title') })
				};
			});
			
		$('.side-nav ul li > a').live('click', function () {
			if (!$(this).parent().hasClass('active')) {
				$(this).parents('ul:eq(0)').find('li.active').removeClass('active');
				$(this).parents('ul:eq(0)').find('ul').slideUp();
				$(this).parent().addClass('active');
				$(this).parent().find('ul').slideDown();	
			};
		});
	
		$(".tweets-holder").tweet({
		    join_text: "auto",
		    username: "safeteens",
		    count: 3,
		    auto_join_text_default: 'none',
		    auto_join_text_ed: "we",
		    auto_join_text_ing: "we were",
		    auto_join_text_reply: "we replied",
		    auto_join_text_url: "we were checking out",
		    loading_text: "loading tweets..."
	    });
			
		if ($.browser.msie && $.browser.version.substr(0,1)<7) {
			DD_belatedPNG.fix('.billboard, .billboard:hover, h1#logo a, .call, .top-nav ul li.polls a, .top-nav ul li.polls a:hover, .top-nav ul li.links a, .top-nav ul li.links a:hover, .top-nav ul li.hotlines a, .top-nav ul li.hotlines a:hover, #main-nav, #search-holder .search-btn, .side-nav-holder .bottom-shadow, .side-nav-holder .top-shadow, .side-nav .top-bg, .side-nav .bottom-bg, .home-post .more-btn, .footer-col, .tweets-title, ul.marker-list li');
		};
	});
	
	function checkSidenav() {
		$('.menu-sidebar-menu-container ul li').each(function () {
			if ($(this).hasClass('current_page_item')) {
				$(this).find('ul').slideDown();
			};
			if ($(this).hasClass('current_page_ancestor')) {
				$(this).find('ul').slideDown();
			};
		})
	}
})(jQuery)
