// chngf.js

var IFrameObj; // our IFrame object
function callToServer(numero) {
  var responseMessage = document.getElementById('responseMessage');
  responseMessage.style.display = 'inline';
  if ((document.sinscrire.newemail.value=='Ââåä³òü Âàø email...')
      || (document.sinscrire.newemail.value=='')) {
    responseMessage.innerHTML = '<span style="color:red">Áóäü-ëàñêà, ââåä³òü Âàø email...<\/span>';
    return false;
  }
  if (!document.createElement) {return true};
  var IFrameDoc;
  var URL = 'mlist/subscribe.php?l=u&a='+numero+'&e='+document.sinscrire.newemail.value;
  responseMessage.innerHTML = '<span style="color:red">çà÷åêàéòå õâèëþ...<\/span>';
	
  if (!IFrameObj && document.createElement) {
    try {
      var tempIFrame=document.createElement('iframe');
      tempIFrame.setAttribute('id','RSIFrame');
      tempIFrame.style.border='0px';
      tempIFrame.style.width='0px';
      tempIFrame.style.height='0px';
      IFrameObj = document.body.appendChild(tempIFrame);
      if (document.frames) {
        // this is for IE5 Mac
        IFrameObj = document.frames['RSIFrame'];
      }
    } catch(exception) {
      // This is for IE5 PC
      iframeHTML='<iframe id="RSIFrame" style="';
      iframeHTML+='border:0px;';
      iframeHTML+='width:0px;';
      iframeHTML+='height:0px;';
      iframeHTML+='"><\/iframe>';
      document.body.innerHTML+=iframeHTML;
      IFrameObj = new Object();
      IFrameObj.document = new Object();
      IFrameObj.document.location = new Object();
      IFrameObj.document.location.iframe = document.getElementById('RSIFrame');
      IFrameObj.document.location.replace = function(location) {
        this.iframe.src = location;
      }
    }
  }
  if (navigator.userAgent.indexOf('Gecko') !=-1 && !IFrameObj.contentDocument) {
    // we have to give NS6 a fraction of a second
    // to recognize the new IFrame
    setTimeout('callToServer("'+numero+'")',10);
    return false;
  }
  if (IFrameObj.contentDocument) {
    // For NS6
    IFrameDoc = IFrameObj.contentDocument; 
  } else if (IFrameObj.contentWindow) {
    // For IE5.5 and IE6
    IFrameDoc = IFrameObj.contentWindow.document;
  } else if (IFrameObj.document) {
    // For IE5
    IFrameDoc = IFrameObj.document;
  } else {
    return true;
  }
  IFrameDoc.location.replace(URL);
  return false;
}
function handleResponse(doc) {
  var responseMessage = document.getElementById('responseMessage');
  responseMessage.innerHTML = doc.getElementById('soupe').innerHTML;
  if (doc.getElementById('succes')) {
     document.sinscrire.newemail.value = 'Ââåä³òü Âàø email...';
  }
}
function clearChamp() {
  if (document.sinscrire.newemail.value == 'Ââåä³òü Âàø email...')
    document.sinscrire.newemail.value = '';
}