
//oben script type="text/javas...." besagt, dass js folgt. unten dann $ fÃ¼r jquery-Anweisung, (document) meint immer
//das aktuelle dokument, .ready heiÃŸt "wenn dieses fertig", dann die function() ausfÃ¼hren: das makePOSTRequest
//(i_home reinladen mit der Funktion KeinSubmenu (zieht ggf ornament raus, also hier unnÃ¶tig), in bereich namens
//inhalt (so wurde die mitte benannt) reinladen)


function makePOSTRequest(url, parameters, para, targ, pAnimate, pFunction)
{
  var httpRequest = false;
  var target = targ;
  var param = para;
  if(window.XMLHttpRequest)
    { // Mozilla, Safari,...
     httpRequest = new XMLHttpRequest();
     if(httpRequest.overrideMimeType)
      {
        httpRequest.overrideMimeType("text/html");//http_request.overrideMimeType("text/xml");
      }
    }
    else if(window.ActiveXObject)
    { // IE
     try
     {
        httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
     }
     catch(e)
     {
      try
      {
          httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e){}
     }
    }
  if(!httpRequest)
  {
    alert("Cannot create XMLHTTP instance"); return false;
  }
  httpRequest.open("POST", url, true);
  httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  httpRequest.send(parameters);
  httpRequest.onreadystatechange = function()
  {
    if (httpRequest.readyState == 4)
    {
      if (httpRequest.status == 200)
      {
        var echo = httpRequest.responseText;
  			if(jQuery.isFunction(pFunction)){
				  pFunction(Rueckgabe);
				}
        if(targ=='inhalt'){
          Rueckgabe = jQuery.parseJSON(httpRequest.responseText);
          document.getElementById('inhalt').innerHTML = Rueckgabe.inhalt;
        }
//
        if(para=='submenu'){
          if($('#orna_reob').width()!='0'){
            $('#orna_reob').animate({width:'0px'},500);
          }
          document.getElementById('submenu1').innerHTML = Rueckgabe.submenu;
          if(url=='i_weisheit.php'){
            $('#orna_reob').css({'background-image':'url(images/orna_reob_final.png)'});
          }
          if(url=='i_massagen.php'){
            $('#orna_reob').css({'background-image':'url(images/orna_reob_final.png)'});
          }
          $('#orna_reob').animate({width: '331px'}, 4000);
        }
        if(para=='KeinSubmenu'){
          document.getElementById('submenu1').innerHTML = '';
          $('#orna_reob').animate({width:'0px'},500);
        }
//

      }else{
          alert("Fehler in der Bearbeitung der Dateien.");
      }
    }
  }
}

// neue funktion statt makePOSTrequest diesmal f�r dunklere Farbe//
function dunkelfaerben(id){

$('#'+id+'1').css('#AC7D4D');
$('#'+id+'2');


//$('#'+id+'1').animate({
//			opacity: 1,
//			'-moz-opacity': 1,
//			filter:'alpha(opacity=100)'
//		}, 400);
//
//
//
//$('#'+id+'2').animate({
//			opacity: 1,
//			'-moz-opacity': 1,
//			filter:'alpha(opacity=100)'
//		}, 400);
//
}

function hellfaerben(id){
//	if(id=='qt'){
//		qt = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='duft'){
//		duft = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='schwitz'){
//		schwitz = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='symbole'){
//		symbole = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='seele'){
//		seele = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='relax'){
//		relax = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='rue'){
//		rue = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='udv'){
//		udv = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='shiro'){
//		shiro = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='gesicht'){
//		gesicht = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='ohr'){
//		ohr = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='auge'){
//		auge = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='edel'){
//		edel = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='fuss'){
//		fuss = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
//	if(id=='mm'){
//		mm = $('#'+id+'2').animate({
//			opacity: 0.0,
//			'-moz-opacity': 0.0,
//			filter:'alpha(opacity=0)'
//		}, 400);
//	}
}
function grafik (id){
$('#'+id).fadeIn();
}

function setgb(){
  var email = document.getElementById('email').value;
  var name = document.getElementById('name').value;
  var vorname = document.getElementById('vorname').value;
  var eintrag = document.getElementById('eintrag').value;
  var t = document.getElementById('t').innerHTML;
  email = email.replace('&','kfmnsund;');
  name = name.replace('&','kfmnsund;');
  vorname = vorname.replace('&','kfmnsund;');
  eintrag = eintrag.replace('&','kfmnsund;');
  makePOSTRequest('setgb.php', 'email='+email+'&name='+name+'&vorname='+vorname+'&eintrag='+eintrag+'&t='+t, '', '', '', function(){
    makePOSTRequest('gb.php', 'e=danke', 'KeinSubmenu', 'inhalt', '', '');
  });

}

