// JavaScript Document
function check_fAlexa(){
	fname = document.getElementById("fAlexa");
	if(fname.a.value == ""){
		alert("Nhập website của bạn");
		fname.a.focus();
	}else{
		jQuery("#alexa_msg").html(wait_img);
		jQuery.post(	ajaxURL_Alexa, 
						{
								a: jQuery("#fAlexa input[name='a']").val(),
								btnAlexa: " OK "
						},
						function(msg){
							jQuery("#alexa_msg").html(msg);
						}					
					);
	}				
	return false;
}
function check_fPageRank(){
	fname = document.getElementById("fPageRank");
	if(fname.p.value == ""){
		alert("Nhập website của bạn");
		fname.p.focus();
	}else{
		jQuery("#pagerank_msg").html(wait_img);
		jQuery.post(	ajaxURL_PageRank, 
						{
								p: jQuery("#fPageRank input[name='p']").val(),
								btnPageRank: " OK "
						},
						function(msg){
							jQuery("#pagerank_msg").html(msg);
						}					
					);
	}				
	return false;
}
function check_fPBAMY(){
	fname = document.getElementById("fPBAMY");
	if(fname.url.value == ""){
		alert("Nhập website của bạn");
		fname.url.focus();
	}else{
		jQuery("#PBAMY_msg").html(wait_img);
		jQuery.get(	ajaxURL_PBAMY, 
						{
								url: jQuery("#fPBAMY input[name='url']").val(),
														},
						function(msg){
							jQuery("#PBAMY_msg").html(msg);
						}					
					);
	}				
	return false;
}
function check_fMetaTag(){
	fname = document.getElementById("fMetaTag");
	if(fname.url.value == ""){
		alert("Nhập website của bạn");
		fname.url.focus();
	}else{
		jQuery("#MetaTag_msg").html(wait_img);
		jQuery.post(	ajaxURL_MetaTag, 
						{
								url: jQuery("#fMetaTag input[name='url']").val(),
														},
						function(msg){
							jQuery("#MetaTag_msg").html(msg);
						}					
					);
	}				
	return false;
}
function check_fGoogleBan(){
	fname = document.getElementById("fGoogleBan");
	if(fname.url.value == ""){
		alert("Nhập website của bạn");
		fname.url.focus();
	}else{
		jQuery("#GoogleBan_msg").html(wait_img);
		jQuery.post(	ajaxURL_GoogleBan, 
						{
								url: jQuery("#fGoogleBan input[name='url']").val(),
														},
						function(msg){
							jQuery("#GoogleBan_msg").html(msg);
						}					
					);
	}				
	return false;
}
function check_fKeywordSuggestion(){
	fname = document.getElementById("fKeywordSuggestion");
	if(fname.keyword.value == ""){
		alert("Nhập từ khóa của bạn");
		fname.keyword.focus();
	}else{
		jQuery("#KeywordSuggestion_msg").html(wait_img);
		jQuery.post(	ajaxURL_KeywordSuggestion, 
						{
								keyword: jQuery("#fKeywordSuggestion input[name='keyword']").val(),
														},
						function(msg){
							jQuery("#KeywordSuggestion_msg").html(msg);
						}					
					);
	}				
	return false;
}
function check_fPageIndexed(){
	fname = document.getElementById("fPageIndexed");
	if(fname.url.value == ""){
		alert("Nhập website của bạn");
		fname.url.focus();
	}else{
		jQuery("#PageIndexed_msg").html(wait_img);
		jQuery.post(	ajaxURL_PageIndexed, 
						{
								url: jQuery("#fPageIndexed input[name='url']").val(),
														},
						function(msg){
							jQuery("#PageIndexed_msg").html(msg);
						}					
					);
	}				
	return false;
}
function check_fGoogleRankP(){
	fname = document.getElementById("fGoogleRankP");
	if(fname.url.value == ""){
		alert("Nhập website của bạn");
		fname.url.focus();
	}else{
		jQuery("#GoogleRankP_msg").html(wait_img);
		jQuery.post(	ajaxURL_GoogleRankP, 
						{
								url: jQuery("#fGoogleRankP input[name='url']").val(),
														},
						function(msg){
							jQuery("#GoogleRankP_msg").html(msg);
						}					
					);
	}				
	return false;
}
function check_fWebSpeed(){
	fname = document.getElementById("fWebSpeed");
	if(fname.url.value == ""){
		alert("Nhập website của bạn");
		fname.url.focus();
	}else{
		jQuery("#WebSpeed_msg").html(wait_img);
		jQuery.post(	ajaxURL_WebSpeed, 
						{
								url: jQuery("#fWebSpeed input[name='url']").val(),
														},
						function(msg){
							jQuery("#WebSpeed_msg").html(msg);
						}					
					);
	}				
	return false;
}
function check_fSearchPosition(){
	fname = document.getElementById("fSearchPosition");
	if(fname.domain.value == ""){
		alert("Nhập website của bạn");
		fname.domain.focus();
	}else
	if(fname.keywords.value == ""){
		alert("Nhập từ khóa tìm kiếm");
		fname.keywords.focus();
	}else{
		jQuery("#SearchPosition_msg").html(wait_img);
		jQuery.post(	ajaxURL_SearchPosition, 
						{
								domain: jQuery("#fSearchPosition input[name='domain']").val(),
								keywords: jQuery("#fSearchPosition input[name='keywords']").val(),
														},
						function(msg){
							jQuery("#SearchPosition_msg").html(msg);
						}					
					);
	}				
	return false;
}

