function checkForm() {
	var theForm = document.reply;
	if (theForm.reply_name.value == "") {
		alert ("กรุณากรอก ชื่อ ด้วยครับ");
		theForm.reply_name.focus();
	} else if (document.getElementById("reply_content").value == "") {
		alert ("กรุณากรอก ความคิดเห็น ด้วยครับ");
		theForm.content.focus();
	} else if (theForm.reply_capcha.value == "") {
		alert ("กรุณากรอก ตัวเลข ด้วยครับ");
		theForm.reply_capcha.focus();
	} else {
		theForm.submit();
	}
}

function reDirec(url) {
	window.location = url;
}

function votethis(id,p){

		$("#div_vote").html('โปรดรอสักครู่.....');
		$.post("/2010/vote/"+id+"/"+p,function(data){
			if(data=='not'){
				$('#div_vote').html('โหวตไม่ได้ . . . !!!้');
				$('#div_vote').fadeIn('slow');
				//setTimeout("$(\"#div_vote\").fadeOut(\"slow\")",7000);
			} else {
				$('#div_vote').html(data);
				$('#div_vote').fadeIn('slow');
				//setTimeout("$(\"#div_vote\").fadeOut(\"slow\")",7000);
			}
		});
};	

function tabber(id){
		
		for(i=0;i<10;i++){
			$("#tab"+i).removeClass('div_tabber_active');	
		}
		
		$("#tab"+id).addClass('div_tabber_active');
		
		
		$("#div_tab").html('โปรดรอสักครู่.....');
		$.post("/2010/tabber/"+id,function(data){
			if(data=='not'){
				$('#div_tab').html('โหวตไม่ได้ . . . !!!้');
				$('#div_tab').fadeIn('slow');
				//setTimeout("$(\"#div_vote\").fadeOut(\"slow\")",7000);
			} else {
				$('#div_tab').html(data);
				$('#div_tab').fadeIn('slow');
				//setTimeout("$(\"#div_vote\").fadeOut(\"slow\")",7000);
			}
		});
};	

function tabReview(id){
		
		for(i=0;i<10;i++){
			$("#tab"+i).removeClass('div_tab_rw_active');	
		}
		
		$("#tab"+id).addClass('div_tab_rw_active');
		
		
		$("#div_tab").html('โปรดรอสักครู่.....');
		$.post("/2010/tab_review/"+id,function(data){
			if(data=='not'){
				$('#div_tab').html('โหวตไม่ได้ . . . !!!้');
				$('#div_tab').fadeIn('slow');
			} else {
				$('#div_tab').html(data);
				$('#div_tab').fadeIn('slow');
			}
		});
};	


function wb_query(id){
		
		for(i=0;i<10;i++){
			$("#tab_wb"+i).removeClass('div_wb_active');	
		}
		
		$("#tab_wb"+id).addClass('div_wb_active');
		
		
		$("#div_wb").html('โปรดรอสักครู่.....');
		$.post("/2010/wb/"+id,function(data){
			if(data=='not'){
				$('#div_wb').html('โหลดไม่ได้ . . . !!!้');
				$('#div_wb').fadeIn('slow');
				//setTimeout("$(\"#div_vote\").fadeOut(\"slow\")",7000);
			} else {
				$('#div_wb').html(data);
				$('#div_wb').fadeIn('slow');
				//setTimeout("$(\"#div_vote\").fadeOut(\"slow\")",7000);
			}
		});
		
};

function chk_tab(count){
	$("#tab_bg_pic").html('โปรดรอสักครู่.....');
	$.post("/2010/tab_firstpage/"+count,function(data){
		if(data=='not'){
			$('#tab_bg_pic').html('โหลดไม่ได้ . . . !!!้');
			$('#tab_bg_pic').fadeIn('slow');
			//setTimeout("$(\"#div_vote\").fadeOut(\"slow\")",7000);
		} else {
			$('#tab_bg_pic').html(data);
			$('#tab_bg_pic').fadeIn('slow');
			//setTimeout("$(\"#div_vote\").fadeOut(\"slow\")",7000);
		}
	});	
};

function pageJump(p,id) {
	window.location="/2010/view/"+id+"/"+p;
}