$(document).ready(function(){

	
	$(".drop_details").hide();
	$("#options").hide();
	$("#poll_box").hide();
	$("#attach_box").hide();

	$("#poll-panel-tab").click(function(){

		$("#attach_box").slideUp("fast");
		$("#options").slideUp("fast");
		$("#poll_box").slideDown("fast");
		$("#options-panel-tab, #attach-panel-tab").parent().removeClass("activetab");
		$(this).parent().addClass("activetab");
		return false;
	});

	$("#attach-panel-tab").click(function(){

		$("#options").slideUp("fast");
		$("#poll_box").slideUp("fast");
		$("#attach_box").slideDown("fast");
		$("#poll-panel-tab, #options-panel-tab").parent().removeClass("activetab");
		$(this).parent().addClass("activetab");
		return false;	
	});

	$("#options-panel-tab").click(function(){
		$("#attach_box").slideUp("fast");
		$("#poll_box").slideUp("fast");
		$("#options").slideDown("fast");
		$("#poll-panel-tab, #attach-panel-tab").parent().removeClass("activetab");
		$(this).parent().addClass("activetab");
		return false;
	});













$(".link_hover").hover(
  function () {

    $("ul",this).slideDown();
  
},
  function () {
    $("ul",this).hide();

  }
   
  
);

$("ul.subnav").hover(
  function () {
	$(this).prev().css("background-image", "url(/forum/styles/2010-Caroline-Daily-Forum/theme/images/2010-menu-hover.gif)");
  },
  function () {
	$(this).prev().attr("style","");
    $(this).hide();
  }
);

if($('.gallery .empty').length > 0 )
{
	$('.gallery').hide();
}




$('.facebook_link').click(function(){
	$('.dropbox_2').hide();
	$('.dropbox_1').hide();
	$('.dropbox_4').hide();
	$(".dropbox_3").slideToggle();		
});
			

$('.twitter_link').click(function(){
	$('.dropbox_1').hide();
	$('.dropbox_3').hide();
	$('.dropbox_4').hide();
	$(".dropbox_2").slideToggle();
});
				

$('.rss_link').click(function(){
	$('.dropbox_3').hide();
	$('.dropbox_2').hide();
	$('.dropbox_4').hide();
	$(".dropbox_1").slideToggle();
});
			
$('.news_letter_link').click(function(){
	$('.dropbox_1').hide();
	$('.dropbox_2').hide();
	$('.dropbox_3').hide();
	$(".dropbox_4").slideToggle();
});


$('.contentDig img').attr("src","/");


$('.upload_input').change(function(){
	var upload_input = $('.upload_input').val();
	$('input.fake_input').val(upload_input);	
})


$('.postbody table a').attr('rel','nofollow');


var counter = 1;

$(document).keypress(function(event) { 

	if (event.which === 32 && $('.focusIN').length < 1) {


		var newY = $('.posts_table tr').eq(counter);
	


		var offsett = newY.position();

		$.scrollTo( offsett.top, 500 );
		counter ++;

		return false;
	}

	else if (event.which == 13 && $('.focusIN').length < 1) {
	

		if ($(".view_topic .pagination").length > 0)
		{
			
			if($(".view_topic .pagination a:last-child").length > 0 )
			{
				window.location = $(".view_topic .pagination a:last-child").attr("href")
				return false;
			}
			else{
				return true;
			}

		}
		else{
			return true;
		}
		
	  }

});
	


$('.user_signature span, .user_signature strong, .user_signature a ').attr('style','');

$('.notification_box').click(function(){
	
	$(this).fadeOut("medium");
});




$(".author_title").hover(
  function () {
	$(".drop_details").slideDown("medium");
  }, 
  function () {

  }
);

$(".post_avatar").hover(
  function () {

		$(".drop_details").slideDown("medium");
		
  }, 
  function () {

  }
);


$(".drop_details").hover(
  function () {


  }, 
  function () {

		$(this).slideUp("medium");
  }
);


var myValue = getCookie("sawPanel");

if (!myValue && $('#inline_example1').length > 0)
{
	$.facebox($('#inline_example1'))
	
}









function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}//end of function getCookie



$("#forum_select").change(function(){
	if($(this).val())
	{
	window.location = $(this).val();
	}
	
});



jQuery.each(jQuery.browser, function(i) {
  if($.browser.msie){
    	
   	 //$(".extra_forum th:first-child").attr("width","7%");
$('.header_table').prev().children().addClass('last_tr')
	 $(".forum_table tr:last-child td, .index_table_bg tr:last-child td, .tablebg tr:last-child td").addClass("last_tr");
	 $(".index_table_bg td:last-child, .tablebg td:last-child").addClass("last_td");
     $(".jump_search .btnlite, .ie_jumpbox .btnlite").attr("style","margin-top:-8px; height:auto; width:100px;");
  }
});









});//end of DOM load









