//Javascript File

//This will be used for the Watercooler Newsletter site


var windowSizeArray = [ "width=600,height=600", "width=600,height=600,scrollbars=yes" ];
 


$(document).ready(function() {
	/* Drop down text */
	$dateHeight = $('#date_section').height();
	
	$('#date_section').height(0);
	$(".dropDownTitle").next('.dropDownText').slideUp(0);
	
	$(".dropDownTitle").click(function(){
		if($('.dropDownText').is(":visible")){
			$('.dropDownText').slideUp();
		}
		if($(this).next('.dropDownText').is(":hidden")){
			$(this).next('.dropDownText').slideToggle();
		}
	});
	
	$("#category_button").click(function(){
		$('#archive_holder #archives').animate({ marginLeft: 0}, 500);
		$('#date_section').animate({ height: 0}, 500);
		$('.sort_buttons').css('text-decoration', 'none');
		$(this).css('text-decoration', 'underline');
	});
	
	$("#date_button").click(function(){
		$('#archive_holder #archives').animate({ marginLeft: -500}, 500);
		$('#date_section').animate({ height: $dateHeight}, 500);
		$('.sort_buttons').css('text-decoration', 'none');
		$(this).css('text-decoration', 'underline');
	});
	
	
    $('.newWindow').click(function (event){
 
		var url = $(this).attr("href");
        var windowName = "popUp";//$(this).attr("name");
        var windowSize = windowSizeArray[$(this).attr("rel")];
		window.open(url, windowName, windowSize);
		event.preventDefault();
		console.log('hello');
 
    });
	
}); /* End of Document jQuery function */
