function vieworiginal(imid,wi,he){
   wi=wi+50;
   he=he+100;
   var w=window.open("/home/ow_image.php?id="+imid,"photo","width="+wi+",height="+he+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1'");
   w.focus();
}

function affcomment(idb){
   var ow=window.open("../home/ow_commentaire_rsr.php?id="+idb,'commentaire',"toolbar=no,menubar=no,location=no,scrollbars=1,resizable=1,width=550,height=450");
   ow.focus();
}


/*var bulle_fcolor = "#FFFFFF";
var bulle_backcolor = "#A85D33";
var bulle_textcolor = "#000000";
var bulle_textfamily = "arial";
var bulle_capcolor = "#FFFFFF";

var bulle_border = "2";*/

var bulle_offsetx = 10;
var bulle_offsety = 10;
var bulle_x = 0;
var bulle_y = 0;
var bulle_snow = 0;
var bulle_width = "150";
var bulle_over;

var ns4 = (document.layers)? true:false;   // check if netscape4
var ie4 = (document.all)? true:false;      // check if ie4
var ie5;

// Microsoft Stupidity Check for ie5 ! >:-((
if (ie4) {
   if (navigator.userAgent.indexOf('MSIE 5')>0 || navigator.userAgent.indexOf('MSIE 6')>0) {
      ie5 = true;
   } else {
      ie5 = false;
   }
} else {
   ie5 = false;
}

var dom2 = ((document.getElementById) && !(ie4||ie5))? true:false; // check the W3C DOM level2 compliance. ie4, ie5, ns4 are not dom level2 compliance !! grrrr >:-(


// Caption popup
function dcc(text, copyr, title) {

   if(dom2){
      bulle_over=document.getElementById("bulleDiv");
      document.onmousemove = mouseMove;
      bulle_over.style.width=bulle_width+"px";
   }else{
      if ( (ns4) || (ie4) ) {
         if (ns4) bulle_over = document.layers["bulleDiv"];
         if (ie4) bulle_over = bulleDiv.style;
         document.onmousemove = mouseMove;
         if (ns4) document.captureEvents(Event.MOUSEMOVE);
      }
   }

//   txt = "<TABLE WIDTH="+bulle_width+" BORDER=0 CELLPADDING="+bulle_border+" CELLSPACING=0 BGCOLOR=\""+bulle_backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT COLOR=\""+bulle_capcolor+"\" FACE=\"Arial,Helvetica\" SIZE=\"-2\">"+title+"</FONT></B></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+bulle_fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT COLOR=\""+bulle_textcolor+"\" SIZE=\"-2\" FACE=\"Arial,Helvetica\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
   txt="<div class=\"bulletitre\">"+title+"</div><div class=\"bulletexte\">"+text+"</div><div class=\"bullecopyright\">"+copyr+"</div>";
   layerWrite(txt);
   disp();
}

// Clears popups if appropriate
function nd() {
   if ( ns4 || ie4 ||dom2 ) {
      bulle_snow = 0;
      hideObject(bulle_over);
   }
}




// Common calls
function disp() {
   if ( ns4 || ie4 || dom2 )  {
      if (bulle_snow == 0)    {
         //moveTo(bulle_over, bulle_x + bulle_offsetx - (bulle_width/2), bulle_y + bulle_offsety);// Center
         moveTo(bulle_over, bulle_x + bulle_offsetx , bulle_y + bulle_offsety);// Right
         // moveTo(bulle_over, bulle_x - bulle_offsetx - bulle_width, bulle_y + bulle_offsety); // Left
         showObject(bulle_over);
         bulle_snow = 1;
      }
   }

}


// Moves the layer
function mouseMove(e) {
   if(dom2 || ns4){
      bulle_x = e.pageX;
      bulle_y = e.pageY;
   }else{
      if(ie4) { bulle_x = event.x; bulle_y = event.y; }
      if(ie5) { bulle_x = event.x + document.body.scrollLeft; bulle_y = event.y + document.body.scrollTop; }
   }
   if (bulle_snow) {
      //moveTo(bulle_over, bulle_x + bulle_offsetx - (bulle_width/2), bulle_y + bulle_offsety);// Center
      moveTo(bulle_over, bulle_x + bulle_offsetx , bulle_y + bulle_offsety);// Right
      // moveTo(bulle_over, bulle_x - bulle_offsetx - bulle_width, bulle_y + bulle_offsety); // Left
   }
}


// Writes to a layer
function layerWrite(txt) {
    if(ns4) {
        var lyr = document.bulleDiv.document;
        lyr.write(txt);
        lyr.close();
    }
    else if(ie4) document.all["bulleDiv"].innerHTML = txt
    else if(dom2) document.getElementById("bulleDiv").innerHTML=txt
}

// Make an object visible
function showObject(obj) {
    if(ns4) obj.style.visibility = "show";
    else if(ie4) obj.visibility = "visible";
    else if(dom2) obj.style.visibility ="visible";
}

// Hides an object
function hideObject(obj) {
    if(ns4) obj.style.visibility = "hide";
    else if(ie4) obj.visibility = "hidden";
    else if(dom2) obj.style.visibility = "hidden";
}

// Move a layer
function moveTo(obj,xL,yL) {
   if(dom2){
      obj.style.left = xL +"px";
        obj.style.top = yL +"px";
   }else{
        obj.left = xL;
        obj.top = yL;
    }
}
