function load_list(url, selector)
{
$.ajax({
type: "GET",
url: url,
beforeSend: function(){
$(selector).html('
');
},
success: function(data){
$(selector).html(data);
}
});
}
function checkFieldRegister(value,divid){
$.post("/vn/checkusername.php", { usename: $("#"+value).val(),type: value },
function(data){
$("#"+divid).html(data);
});
}
function showLoginTop(id){
$("#top_login_hover").css('display','block');
}
function hideLoginTop(id){
$("#top_login_hover").css('display','none');
}
function isemail_1(email) {
var re = /^(\w|[^_]\.[^_]|[\-])+(([^_])(\@){1}([^_]))(([a-z]|[\d]|[_]|[\-])+|([^_]\.[^_])*)+\.[a-z]{2,3}$/i
return re.test(email);
}
function delete_other_pic(id){
$.ajax({
type: "POST",
url: "/vn/delete_other_pic.php",
data: "record_id="+id,
success: function(msg){
if(msg!=''){
alert( msg );
$("#"+id).remove();
}
}
});
}
function delete_other_pic_land(id){
$.ajax({
type: "POST",
url: "/vn/delete_other_pic_land.php",
data: "record_id="+id,
success: function(msg){
if(msg!=''){
alert( msg );
$("#"+id).remove();
}
}
});
}
function deleteLand(id){
$.ajax({
type: "POST",
url: "/vn/delete_land.php",
data: "record_id="+id,
success: function(msg){
if(msg!=''){
alert( msg );
$("#land_list_"+id).remove();
}
}
});
}
function check_form_search_bds(lang_path){
var id_bds = $('#id_batdongsan').val();
if(document.getElementById("id_batdongsan").value > 0){
window.location.href = '/vn/type.php?module=search&id='+id_bds;
}else{
if($('#search_on_map').is(':checked')){
$('#search_bds').attr('action',lang_path+'ban-do.html');
}
if(document.getElementById("iCat").value == 0){
alert("Bạn chưa chọn danh mục !");
document.getElementById("iCat").focus();
return;
}
document.search_bds.submit();
}
}
function check_form_search_duan(){
if(document.getElementById("iCat").value == 0){
alert("Bạn chưa chọn danh mục !");
document.getElementById("iCat").focus();
return;
}
document.search_bds.submit();
}
function showGoogleMap(id){
var xxx = $('#'+id).height();
if(xxx==0){
$('#'+id).css('height','362px');
}else{
$('#'+id).css('height','0px');
}
}
function ChangLatLon(CatId,KgiaId,DtichId,CityId,QuanId,BedId){
$.ajax({
type: 'GET',
url: '/vn/ajax_map_lat_lon.php',
data: {'iCity': CityId, 'iQuan': QuanId},
success: function(data){
$('#LatId').val(data.lat);
$('#LonId').val(data.lon);
LoadGoogleMap(CatId,KgiaId,DtichId,CityId,QuanId,BedId,data.lat,data.lon);
},
dataType: 'json'
});
}
function AddToCartBDS(url,id,text){
$.ajax({
type: "GET",
url: "/vn/addtocart_ajax.php",
data: 'iData='+id,
success: function(){
$("#cartBDS_"+id).css('color','#999999');
$("#cartBDS_"+id).html(text);
$("#cartBDS_"+id).attr('href','javascript:void(0);');
var total = parseInt($(".dathang_icon").html())+1;
$(".dathang_icon").html(total);
}
});
}
function RemoveToCartBDS(url,id){
$.ajax({
type: "GET",
url: "/vn/recount.php",
data: 'iData='+id,
success: function(){
$(".cart_bds_"+id).css('display','none');
}
});
}