// JavaScript Document
    $(function() {
        $(".masquer").click(function()
        {
          $("#messageUser").hide();
        });
    });

    function makeRemote(name, width, height, source, menu, resize) {
        var href;
        resize = 'yes'; // force to yes, ie win7 bug and didn't work with others browser so...
        if (typeof(source) == 'string') { href = source; }
        else { href = source.href; }
        remote = window.open(href, name, "width=" + width + ",height=" + height + ",scrollbars=" + menu + ",status=" + menu + ",resizable=" + resize);
        if (remote.opener == null) remote.opener = window;
    }
    function ShowImage(url) {
        popupImage = window.open('','photo','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1');
        popupImage.document.open();
        popupImage.document.writeln('<HTML><HEAD>');
        popupImage.document.writeln('<Script Language="JavaScript">');
        popupImage.document.writeln('var message="jalf.com"; function click(e) { if (document.all) { if (event.button == 2) { alert(message); return false; } } if (document.layers) { if (e.which == 3) { alert(message); return false; } } } if (document.layers) { document.captureEvents(Event.MOUSEDOWN); } document.onmousedown=click;');
        popupImage.document.writeln('</Script>');
        popupImage.document.writeln('<TITLE>Jouer avec le Fantasme, parce qu&#39;on a tous des fantasmes</TITLE><META HTTP-EQUIV="imagetoolbar" CONTENT="no"></HEAD><BODY onload="window.focus()" LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 bgcolor="#660000"><CENTER><A HREF=# onclick="window.close()" border="0"><IMG SRC="' + url + '" BORDER=0 NAME=imageTest onload="window.resizeTo(imageTest.width + 40, imageTest.height + 43); if (screen.width < imageTest.width + 40) { window.resizeTo(screen.width - 50, screen.height - 50); window.moveTo(0,0); } else if (screen.height < imageTest.height + 43) { window.resizeTo(screen.width - 50, screen.height - 50); window.moveTo(0,0); }" hspace="5" vspace="4"></CENTER></a></BODY></HTML>');
        popupImage.document.close();
    }
    function popup2(mylink, windowname) {
        if (! window.focus) { return true; }
        var href;
        if (typeof(mylink) == 'string') { href=mylink; }
        else { href=mylink.href; }
    if(windowname=='Profil'){
      window.open(href, windowname,'width=550,height=600,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
    }
    else{
      window.open(href, windowname,'width=230,height=400,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
    }
    return false;
    }

  var message="jalf.com ";
  function click(e) {
    if (document.all) {
      if (event.button == 2) {
         //alert(message);
         return false;
      }
    }
    if (document.layers) {
      if (e.which == 3) {
         //alert(message);
         return false;
      }
    }
    return true;
  }

 // if the user is not VIP
function checkmember(url){
   open(url + '/ct/subscribe/upgrade', 'main', 'resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, width=650, height=630');
   return (false);
 }


 function ShowAlb_Verif(Usr,Look,msg,pic){
  $.ajax({
        url: '/cgi-bin/system/showalbum_UsrVerif.pl',
        type: 'POST',
        data: '&User=' + Usr + '&Look=' + Look + '&Pic=' + pic,
        timeout: 3000,
        cache:false,
        error: function(verif){
            alert('ERROR : Contact administrator (error code MH-L65)' );
        },
        success: function(verif){
          if(verif == '[2]'){
          var agree=confirm(msg);
          if (agree) { open('/ct/subscribe/upgrade', 'main', 'resizable=yes, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, width=620, height=480'); }
          return (false);
          }else{
            ShowImage(pic);
          }
        }
     });
 }


//Enables the checkbox selection with a click on the label
function check_uncheck(ctrl_id)
{
    if(document.getElementById(ctrl_id).checked == true){
        document.getElementById(ctrl_id).checked = false;
    }
    else {
        document.getElementById(ctrl_id).checked = true;
    }
}

function openDashboard(unumber){
    //
    //if(WindowObjectReference == null || WindowObjectReference.closed)
    ///* explanation: if the pointer to the window object
    //in memory does not exist or
    //if such pointer exists but the window was closed */
    //{
        WindowObjectReference = window.open("/ct/admin/" + unumber + "/0","Dashboard of " + unumber, "location=no,menubar=no,scrollbars=yes,status=no,width=900,left=0,top=0");
    //}
    /* explanation: then create it. The new window will be created and
    will be brought on top of any other window. */
    //else {
    //    if(WindowObjectReference.focus){
    //        WindowObjectReference.focus();
    //    };
    //};
}

