KNURL     = '/news/webserv/';
NDETAIL   = '/news/';
function querySt(ji) {
  hu = window.location.search.substring(1);
  gy = hu.split("&");
    for (i=0;i<gy.length;i++) {
    ft = gy[i].split("=");
      if (ft[0] == ji) {
      return ft[1];
      }
    }
}
$(document).ready(function(){

lang = 'en';
cadena = location.href;
pat = /espanol/
if(pat.test(cadena)){ //cadena a buscar
  lang = 'es';
} 

  $(".noticias2").load(KNURL+'getlastnews/pagina/1?lang='+lang, function() {
  rp = $(".noticias2").html();
  $(".noticias2").html(rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp+rp)
//   alert($(".noticias2").html() );
});

  $("#wpublic").load(KNURL+'listdownload/');
//   $(".wbn_anchor a").live("click",function(){
//     $("#wnoticias").load($(this).attr("href"));
//     return false;
//   })
  div = $(".noticias").next().children().attr("href",NDETAIL+"noticias.html");
//   alert(div)
//   $(".noticias").next("a").attr("href","/~kievasoc/demo/noticias.html");
  qs = querySt("id");
  if(qs != undefined){
    $("#wnoticias").load(KNURL+'detailnews/'+qs+'/?lang='+lang);
  }else{ 
    $("#wnoticias").load(KNURL+'listnews/');
  }

  $("form").submit(function(){
//     alert("algo")
    data  =  $(this).serialize() ;
    $("#loadscr").load(KNURL+'mailcontact/?'+data);
//     alert("otro")
    return false;
  })

});


