function lienhe()
{
    if($('#name').val()=="")
    {
        $('#name').focus();
        return false;
    }
    if($('#email').val()=="")
    {
        $('#email').focus();
        return false;
    }
    if($('#nd').val()=="")
    {
        $('#nd').focus();
        return false;
    }
    if($('#code').val().length!=4)
    {
        $('#code').focus();
        return false;
    }
    $('#fr').submit();
}


function getgallery(id,type,lang)
{   
    $("#tieude").html($('#a'+id).html());
    $.ajax({
           type: "POST",
           url: $('#link').val()+"ajax/getgallery/"+id,
           data:{lg:lang,t:type},                        
           success: function(data){       
                if(data!='err')
                {                    
                    $('#kqload').html(data);
                    if(type=="doc")
                        gallery_v();
                    else gallery_h();
                }
                else alert('Có lổi xảy ra');                    
                
           }
        });
}

function get_feng(id,dk,lang,p,gh)
{   
    if(gh==null)gh="";
    $.ajax({
           type: "POST",
           url: $('#link').val()+"ajax/getfeng",
           data:{vl:id,lg:lang,k:dk,page:p,gih:gh},                        
           success: function(data){   // alert(data)   
                if(data!='err')
                {                    
                    if(dk=="Y")$('#ktfeng').html(data);
                    else $('#vpfeng').html(data);
                }
                else alert('Có lổi xảy ra');                    
                
           }
        });
}

function changeimg(el)
{
    $("#imgshow").attr('src',$(el).attr('src'));
}


function othernews(id,cate,lang,p)
{   
    
    $.ajax({
           type: "POST",
           url: $('#link').val()+"ajax/getothernews/"+p,
           data:{id_n:id,id_c:cate,id_l:lang},                        
           success: function(data){       
                if(data!='err')
                {                    
                    $('#othernews').html(data)
                }
                else alert('Có lổi xảy ra');                    
                
           }
        });
}

function otherproject(lang,id,p)
{   
    
    $.ajax({
           type: "POST",
           url: $('#link').val()+"ajax/getotherproject/"+p,
           data:{id_p:id,l:lang},                        
           success: function(data){       
                if(data!='err')
                {                    
                    $('#otherproject').html(data)
                }
                else alert('Có lổi xảy ra');                    
                
           }
        });
}
