﻿function changemovie(id){
  
  var framus = document.getElementById("movieframe");
  
if (id==1) {
  framus.src = "http://www.allen-carr.de/flash/movieangst.htm"
  update("Flashfilm - Angst");
}
if (id==2) {
  framus.src = "http://www.allen-carr.de/flash/moviekick.htm"
  update("Flashfilm - Kick");
} 
if (id==3) {
  framus.src = "http://www.allen-carr.de/flash/moviestress.htm"
  update("Flashfilm - Stress");   
}
if (id==4) {
  framus.src = "http://www.allen-carr.de/flash/moviegeschmack.htm"
  update("Flashfilm - Geschmack");
}
if (id==5) {
  framus.src = "http://www.allen-carr.de/flash/moviegewohnheit.htm"
  update("Flashfilm - Gewohnheit");
}
if (id==6) {
  framus.src = "http://www.allen-carr.de/flash/moviegewicht.htm"
  update("Flashfilm - Gewicht");
}
}


// Ajaxeinsatz zum abspeichern der abgespielten Flash-Filme im Tracking tool
/* httpRequest */
var httpReq = createXMLHttpRequest();

/* generate http request */
function createXMLHttpRequest() {

  // if object is not initialized
  if (httpReq == null) {

    // if xmlHttpReq object is enabled/available
    if (window.XMLHttpRequest) {

      // create object
      return new XMLHttpRequest();

    } else if (window.ActiveXObject) { // IE

      try {

        // activex object
        return new ActiveXObject("Msxml2.XMLHTTP");

      } catch (e) {

        try {

          return new ActiveXObject("Microsoft.XMLHTTP");

        } catch (e) {

          // httpReq not available
          return null;

        } // catch

      } // catch

    } // elseif

  } // httReq = null

} // function



/* update connections based on ajax */
function update(what) {

  // send XMLHttpReq auf eine Antwort wird nicht gewartet
  // beim lokalen Test
  // httpReq.open('POST', 'http://localhost:90/ajax/ajaxInterface.aspx?update=' + what, true);
  // online auf dem Easywell-Server
  httpReq.open('POST', 'http://www.allen-carr.de/ajax/ajaxInterface.aspx?update=' + what, true);
  httpReq.send('');
}