function HTMLentities(texte) {
texte = texte.replace(/"/g,'&quot;'); // 34 22
texte = texte.replace(/&/g,'&amp;'); // 38 26
texte = texte.replace(/\'/g,'&#39;'); // 39 27
texte = texte.replace(/</g,'&lt;'); // 60 3C
texte = texte.replace(/>/g,'&gt;'); // 62 3E
texte = texte.replace(/\^/g,'&circ;'); // 94 5E


return texte;
}




function hackggoogle(){
$("#aubg").css("background","none");
$("#ads").css("background","none");

}
function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
function alterPage(){
if ($("#slidernav #slider").length)
$("#slidernav #slider").easySlider({
auto: true, continuous: true,
numeric: true,
pause: 4000
});
//alert("ok");
//$(".roundedbox").corner("round 10px");
if ($(".loginboxx").length) $(".loginboxx").css("height",$(".loginboxx").height()+"px");
 try{if ($(".loginboxx").length && $(".loginboxx").corner )$(".loginboxx").corner("round 10px");}catch(err){console.log('roundlogin'+err);}
 try{$(".shortcut").corner("round 10px");}catch(err){}
 try{$(".roundbox").corner("round 10px");}catch(err){}
 if (!$(".htmlarea").length)
 try{$(".button").corner("round 5px");}catch(err){}
 $(".entsumimage img").css("width","128px");
 
 setTimeout("hackggoogle()",1000);

  if ($("#switchmes").text()=="no") return;
  try{
  if (!$("#context_message") || !$("#context_message").length || $("#context_message").html().length<10) return;
  if ($("#cesticiquejeteveux").length){
    $("#cesticiquejeteveux").html($("#context_message").html());
    $("#context_message").html("");
    return;  
  }
    
  } catch (err){ return;  }
  
  //alert($(".homepage").html().length);
  mydivs6=jQuery(".centercolumn").find("h2");
  
  len=mydivs6.length;
  if (len==0) return;
  $(mydivs6[0]).after("<div id='context_message2'>"+$("#context_message").html()+"</div>");
  $("#context_message").html("");
  
  
 

  
  
  
}

function getPopup(){
 var pop = gup( 'pop' );
  var regex = new RegExp(pop,"gi");
  var regex2 = new RegExp("20110624\/one-community","gi");
  
  //rezo/classes/special-events/geneve/20110624/one-community
  
  if ((pop && pop!="")||window.location.href.match(regex2)){
   var poped=false;
   $('a[rel*=facebox]').each(function(){
     if (poped) return;
     
     href=$(this).attr("href");
     //console.log(href);
     if (href.match(regex)){
      $(this).trigger("click");
     poped=true;  
     // console.log("match"+href);
      }
   })
  }
}


$(document).ready(function(){
  alterPage();
  
 setTimeout("getPopup()",1500);
  
  });
