function addbookmark(){
var bookmarkurl="http://www.pulsradio.com";
var bookmarktitle="Puls'Radio - 1ére Webradio Dance de France.";
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}


function loadImages() {
if (document.getElementById) {
document.getElementById('hidepage').style.visibility = 'hidden';
}
else {
if (document.layers) {
document.hidepage.visibility = 'hidden';
}
else {
document.all.hidepage.style.visibility = 'hidden';
      }
   }
}

function loadingwai(namediv) {
var tmploading = '<div style="text-align: center"><img src="images/loading.gif" border="0"></div>';
var div = document.getElementById(namediv); 
	div.innerHTML = tmploading; 
}

function rehash(url,namediv)
{	 loadingwai(namediv);
     var date = new Date(); 
     var timestamp = "&u="+date.getTime();
     if(window.XMLHttpRequest)
          xhr_object = new XMLHttpRequest(); 
     else if(window.ActiveXObject)
          xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
     else 
          return(false);
     xhr_object.open("GET", url+timestamp, false); 
     xhr_object.send(null);
     if(xhr_object.readyState == 4) { writediv(namediv,xhr_object.responseText); }
     else return(false);

}

function posth(text,ladiv,lty,cty)  
{
loadingwai(ladiv); 
	var xajax = null; 
	if(window.XMLHttpRequest) xajax = new XMLHttpRequest(); 
	else if(window.ActiveXObject) xajax = new ActiveXObject("Microsoft.XMLHTTP"); 
	else return(false); 
	 
	var str = "t="+lty+"&i="+cty+"&c="+text; 
	xajax.open("POST","ajaxphp.php",false); 
	xajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
	xajax.send(str); 
		if(xajax.readyState == 4) { 
		var div = document.getElementById(ladiv); 
		div.innerHTML = xajax.responseText; 
		} 
}

function writediv(namediv,texte) { document.getElementById(namediv).innerHTML = texte; } 
function apercu()
{
	var putxt1 = document.getElementById("texte").value;
	if (putxt1!='') { Masque_OBJ('ndj'); Affiche_OBJ('ppv'); posth(escape(putxt1),'preview',1,0); }
} 
function papercu(cdx)
{
	var putxt1 = document.getElementById("texte").value;
	if (putxt1!='') { Masque_OBJ('ppv'); Affiche_OBJ('ndj'); posth(escape(putxt1),'lastpost',2,cdx); posth('3','dirmur',3,cdx); document.getElementById("texte").value = ""; }
}
function pcmt(cdx)
{   var ladiv = "ecmt"+cdx;
	var putxt1 = document.getElementById("postcmt"+cdx).value;
	if (putxt1!='') { posth(escape(putxt1),ladiv,4,cdx); document.getElementById("postcmt"+cdx).value = ""; }
}
function ppense()
{   
	var putxt1 = document.getElementById("penseeditbox").value;
	if (putxt1!='') { Masque_OBJ('pensedit'); posth(escape(putxt1),'pense',5,0); document.getElementById("penseeditbox").value = "";  Affiche_OBJ('pense'); }
	else { Masque_OBJ('pensedit'); Affiche_OBJ('pense'); }
}
function addlove(lty,cdx)
{
var ladiv = "love"+cdx;
posth(lty,ladiv,6,cdx);
}
function addpem(lty,cdx)
{
var ladiv = "pem"+cdx;
posth(lty,ladiv,7,cdx);
} 
function addpemh(lty,cdx)
{
var ladiv = "pem00";
posth(lty,ladiv,8,cdx);
} 
function delpic(lty)
{
var ladiv = "picuser";
posth(lty,ladiv,9,"picuser");
posth(lty,"allpic",11,"picuser");
}
function delcontrib(cdx,lty,ladiv)
{  
posth(cdx,ladiv,13,lty);
} 
function friends(cdx,lty)
{  
if(cdx=="add") {
posth(1,"ficheadd",12,lty);
}
if(cdx=="addwai") {
posth(3,"listamiswai",12,lty);
posth(4,"listamis",12,lty);
}
if(cdx=="del") {
posth(5,"listamis",12,lty);
}
if(cdx=="unval") { 
posth(6,"listamisunval",12,lty);
}
if(cdx=="delunval") { 
posth(7,"listamiswai",12,lty);
}
posth(lty,ladiv,9,"picuser");
posth(lty,"allpic",11,"picuser");
} 
function movepic(lty)
{
var ladiv = "picuser";
posth(lty,ladiv,10,"picuser");
posth(lty,"allpic",11,"picuser");
}  
function viewpic(lty)
{
var ladiv = "picview";
posth(lty,ladiv,110,ladiv);
} 
function votematch(vote)
{
var url = "vote_inc.php?v="+vote;
rehash(url,"boutons_puls_match");
}

function Affiche_OBJ(){
  var Arg = arguments;
  var Obj;
  for( var i=0; i< Arg.length; i++){
    Obj = document.getElementById( Arg[i]);
    if( Obj){
      Obj.style.visibility = "visible";
      Obj.style.display = "block";
    }
  }
}

function Masque_OBJ(){
  var Arg = arguments;
  var Obj;
  for( var i=0; i< Arg.length; i++){ 
    Obj = document.getElementById( Arg[i]);
    if( Obj){
      Obj.style.visibility = "hidden";
      Obj.style.display = "none";
    }
  }
}


