function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


$(document).ready(function() {

	$(".answer").css('display','none');	
	
	$(".question").click(function () { 
		
		
		if ($(this).find(".showButton").attr('src') == '/images/more button roll.gif') {
			$(this).find(".showButton").attr('src','/images/more button.gif');
		}
		else {
			$(this).find(".showButton").attr('src','/images/more button roll.gif');
		}
	
		$(this).next(".answer").toggle("slow");
    
    });

	$(".newsMonths").css('display','none');	
	$(".newsYear").click(function () { 
	
		$(this).next(".newsMonths").toggle();
    
    });
	
	$(".conditionCategory[rel]").overlay({
		 
		top: 160
	});
	
	$(".searchInput").autocomplete("/search-autocomplete.php", {
		width: 260
	});
	
	/*

	if (readCookie('registered') == '3') {
		
		a = true;
		
		$("body").overlay({
			 // some expose tweaks suitable for modal dialogs 
		    expose: { 
		        color: '#333', 
		        loadSpeed: 200, 
		        opacity: 0.9 
		    },
			target: '#others',
		    closeOnClick: false 
		});
	}
*/
});
