$(document).ready(function(){
	$('#match_menu a').css("opacity",0 );
	$('#match_menu a').hover(function(){
		$(this).stop().animate({ "opacity": 1}, 200);;
	}).mouseout(function (){
		$(this).stop().animate({ "opacity": 0}, 500);
	});
	gen_page('review',1,'');
	gen_page('preview',1,'All');
	$('#news_type').change(function(){
		gen_page('preview',1,$(this).val());
	});
	
});
function gen_page(type,Page,type_preview){
	if(type=="review"){
		genPageReview(Page);
	}else{
		genPagePreview(Page,type_preview);
	}
}

function genPageReview(PageNo){
	$('#right_content').html('<div class="loading">รอสักครู่...</div>')
	$.ajax({
		   type: "GET",
		   url: "review_list.php",
		   data: "page="+PageNo+"&t="+Math.random(),
		   success: function(msg){
			 $('#right_content').html(msg);
		   }
		 });

}
function genPagePreview(PageNo,type){
	$('#left_content').html('<div class="loading">รอสักครู่...</div>')
	$.ajax({
		   type: "GET",
		   url: "preview_list.php",
		   data: "page="+PageNo+"&type="+type+"&t="+Math.random(),
		   success: function(msg){
			 $('#left_content').html(msg);
				if ( $.browser.msie ) {
					if( $.browser.version ='7.0'){
							$('#news_content .left_column .list h3').css('display','inline');
					}
				}
		   }
		 });

}
