$(document).ready(function() {

	$("#news_headers li").hover(function() {
		$(this).addClass("highlight")
		//$(this).animate({opacity: "1"}, "fast");
	}, function() {
		$(this).removeClass("highlight")
		//$(this).animate({opacity: "0.9"}, "fast");
	});


	hidehtml();
//for (var i = 10; i < 14; i++) {
//var ids = i;
//if (i<10) {var ids='0'+i; } else {var ids=i;}
//jQuery('#news00'+ ids).click(function() {showhtml('inc/news00'+ ids +'.txt')});
//}
/*	jQuery('#statya0001').click(function() {showhtml('inc/statya0001.txt')});
	jQuery('#statya0002').click(function() {showhtml('inc/statya0002.txt')});
	jQuery('#statya0003').click(function() {showhtml('inc/statya0003.txt')});
	jQuery('#statya0004').click(function() {showhtml('inc/statya0004.txt')});
	jQuery('#statya0005').click(function() {showhtml('inc/statya0005.txt')});
	jQuery('#statya0006').click(function() {showhtml('inc/statya0006.txt')});
	jQuery('#statya0007').click(function() {showhtml('inc/statya0007.txt')});
	jQuery('#statya0008').click(function() {showhtml('inc/statya0008.txt')});
	jQuery('#statya0009').click(function() {showhtml('inc/statya0009.txt')}); */

/*	jQuery('#news0001').click(function() {showhtml('inc/news0001.txt')});
	jQuery('#news0002').click(function() {showhtml('inc/news0002.txt')});
	jQuery('#news0003').click(function() {showhtml('inc/news0003.txt')});
	jQuery('#news0004').click(function() {showhtml('inc/news0004.txt')});
	jQuery('#news0005').click(function() {showhtml('inc/news0005.txt')});
	jQuery('#news0006').click(function() {showhtml('inc/news0006.txt')});
	jQuery('#news0007').click(function() {showhtml('inc/news0007.txt')});
	jQuery('#news0008').click(function() {showhtml('inc/news0008.txt')});
	jQuery('#news0009').click(function() {showhtml('inc/news0009.txt')});
	jQuery('#news0010').click(function() {showhtml('inc/news0010.txt')});
	jQuery('#news0011').click(function() {showhtml('inc/news0011.txt')});
	jQuery('#news0012').click(function() {showhtml('inc/news0012.txt')});
	jQuery('#news0013').click(function() {showhtml('inc/news0013.txt')});
	jQuery('#news0014').click(function() {showhtml('inc/news0014.txt')}); */
	//jQuery('#news0014').click(function() {showhtml('inc/news0014.php?id=14')});
/*	jQuery('#news0015').click(function() {showhtml('inc/news0015.txt')});
	jQuery('#news0016').click(function() {showhtml('inc/news0016.txt')});
	jQuery('#news0017').click(function() {showhtml('inc/news0017.txt')});
	jQuery('#news0018').click(function() {showhtml('inc/news0018.txt')}); */
	jQuery('#news_headers li').click(function() { var data_id= $(this).attr('id'); showhtml('inc/'+data_id+'.txt')});
});
function showhtml(myurl){
	$.ajax({
		url: myurl,
		type: 'GET',
		dataType: 'html',
//		beforeSend: function(){$("#news_content").slideToggle("fast"); },
		beforeSend: function(){$("#news_content").animate({opacity: "hide"}, "slow"); },
		success: function(data){
			$('#news_content').html(data);
//			$("#news_content").slideToggle("slow");
			$("#news_content").animate({opacity: "show"}, "slow");
			$('<div/>').attr('id','news_close').html('X').click(hidehtml).prependTo('#news_content');
		}
	});
}
function hidehtml(){
	$("#news_content").animate({opacity: "hide"}, "fast");
}
