// JavaScript Document
function rdoSearch(type){
	$.ajax({
		url:'modules/search/resultSearch.php',
		cache: true,
		data:{'reqType':'ajax','searchType':type},
		type:'POST',
		success:function(data){
			$('#resultSearch').empty().append(data);	
		}
		
	});
}

function jeedsearch(){
    
    var type = $('[name=rdoSearch]').fieldValue();
    var word = $("#txtMainSearch").val();
    if(word != '' && word != 'Tags ด้านล่างไม่ถูกใจ ค้นหาคำใหม่ที่นี่เลย !'){
        $.ajax({
            url:'modules/search/linkSearch.php',
            cache: true,
            data:{'searchType':type,'word':word},
            type:'POST',
            success:function(data){

                window.location.href=data;

            }

        });
    }
}//E-func
function clearInputSearch(){
    $('#txtMainSearch').val('');
}
function resetInputSearch(){
    $('#txtMainSearch').val('Tags ด้านล่างไม่ถูกใจ ค้นหาคำใหม่ที่นี่เลย !');
}
function enterSearch(e) {
	  
	  if( e.keyCode==13){
			jeedsearch();

	  }
	  
}