// JavaScript Document

function nextPageVideo(tab,value,name_div)
{
	$.ajax({
		type:'POST',
		url: ROOT_BASE+'ajax.php',
		data: 'action=nextPageVideo&tab='+encodeURIComponent(tab)+'&p='+encodeURIComponent(value),							
		success:function(html){
			alert(html);
			//$("#"+name_div).html(html);
		}
	});
}
function set_view_video(video)
{
	$.ajax({
		type:'POST',
		url: ROOT_BASE+'ajax.php',
		data: 'action=video&video='+encodeURIComponent(video),							
		success:function(html){
			//$("#"+name_div).html(html);
		}
	});
}
function check_captcha()
{
	var theForm=document.frm_napthe;
	$('#error_napthe').html('<img src="'+ROOT_BASE+'images/loading8.gif" border="0"   height="15"/>');
	$(this).unbind('click',check_captcha);
	var error = '';
	if(theForm.code.value=='')
	{
		$('#error_napthe').html('<b>Lỗi:</b><br/>• &nbsp; Nhập mã số thẻ!');
		theForm.code.focus();
		$(this).click(check_captcha);
		return false;
	}
	if(theForm.captcha.value=='')
	{
		$('#error_napthe').html('<b>Lỗi:</b><br/>• &nbsp; Nhập mã an toàn!');
		theForm.captcha.value = '';
		$("#send_napthe").click(check_captcha);
		theForm.captcha.focus();
		return false;
	}
	$.ajax({
		type:'POST',
		url: ROOT_BASE+'ajax.php',
		data: 'action=check_captcha&captcha='+theForm.captcha.value,							
		success:function(html){
			if(html == 'true')
				document.frm_napthe.submit();
			else{
				$('#error_napthe').html('<b>Lỗi:</b><br/>• &nbsp; Mã an toàn không khớp!');
				document.getElementById('img_captcha').src=ROOT_BASE+'captcha.php?'+Math.random();
				theForm.captcha.focus();
				$("#send_napthe").click(check_captcha);
				return false;	
			}
		}
	});	
}
function send_captcha(captcha){
	
}
