//add

function splash() {
  var m_t = $(window).height()/2;
  var m_l = $(window).width()/2;
  var rand_t = Math.floor(Math.random()*(m_t-10));
  var rand_l = Math.floor(Math.random()*500);
  var rand_vz = Math.random();
  if (rand_vz < 0.5) {
    rand_t = m_t - rand_t;
  } else {
    rand_t = m_t + rand_t;
  }
  rand_vz = Math.random();
  if (rand_vz < 0.5) {
    rand_l = m_l - rand_l;
  } else {
    rand_l = m_l + rand_l;
  }
  var elHtml = '<img id="blood1" style="display:none;position:absolute;z-index:100;left:' + rand_l + 'px;top:' + rand_t + 'px;" alt="" src="http://www.armaberokay.de/blog/wp-content/themes/2010_03_02/img/fun/plant1.png" />'
  $('#absperrband').after(elHtml);

  rand_t = Math.floor(Math.random()*(m_t-10));
  rand_l = Math.floor(Math.random()*500);
  rand_vz = Math.random();
  if (rand_vz < 0.5) {
    rand_t = m_t - rand_t;
  } else {
    rand_t = m_t + rand_t;
  }
  rand_vz = Math.random();
  if (rand_vz < 0.5) {
    rand_l = m_l - rand_l;
  } else {
    rand_l = m_l + rand_l;
  }
  elHtml = '<img id="blood2" style="display:none;position:absolute;z-index:100;left:' + rand_l + 'px;top:' + rand_t + 'px;" alt="" src="http://www.armaberokay.de/blog/wp-content/themes/2010_03_02/img/fun/plant2.png" />'
  $('#absperrband').after(elHtml);

  rand_t = Math.floor(Math.random()*(m_t-10));
  rand_l = Math.floor(Math.random()*500);
  rand_vz = Math.random();
  if (rand_vz < 0.5) {
    rand_t = m_t - rand_t;
  } else {
    rand_t = m_t + rand_t;
  }
  rand_vz = Math.random();
  if (rand_vz < 0.5) {
    rand_l = m_l - rand_l;
  } else {
    rand_l = m_l + rand_l;
  }
  elHtml = '<img id="blood3" style="display:none;position:absolute;z-index:100;left:' + rand_l + 'px;top:' + rand_t + 'px;" alt="" src="http://www.armaberokay.de/blog/wp-content/themes/2010_03_02/img/fun/plant3.png" />'
  $('#absperrband').after(elHtml);

  $('#blood1').show("drop", { direction: "up" }, 500);
  $('#blood1').mouseover(function () {
      $(this).hide("puff", {}, 700);
  }); 
  $('#blood2').show("drop", { direction: "up" }, 1000);
  $('#blood2').mouseover(function () {
      $(this).hide("puff", {}, 700);
  }); 
  $('#blood3').show("drop", { direction: "up" }, 1500);
  $('#blood3').mouseover(function () {
      $(this).hide("puff", {}, 700);
  }); 
}

function showAd1() {
      $("#loyaladimg").attr("src","http://www.armaberokay.de/blog/wp-content/uploads/ads/loyal.png");
};
function showAd2() {
      $("#loyaladimg").attr("src","http://www.armaberokay.de/blog/wp-content/uploads/ads/loyal2.png");
};

function showHoffesttext() {
  $('#hoffestbutton').css("display", "none");
  $('#hoffesttext').slideDown("slow");;
}

function startFunStuff() {
  $("#absperrband").css("display", "block");
  $("#content > div").css("cursor", "crosshair");
  $("#content > div").click(function () {
      $(this).hide("explode", 500);
  }); 
  $("#sidebar > ul >li > div").css("cursor", "crosshair");
  $("#sidebar > ul >li > div").click(function () {
      $(this).hide("explode", 500);
  }); 
  $("#header > div").css("cursor", "crosshair");
  $("#header > div").click(function () {
      $(this).hide("explode", 500);
  });
}

/*
* function is executed when mouse is over the box containing the wrong answer
* moves the box containing the wrong other to a random position
*/
function moveElement(elem) {
    
    // generate a random value between 0 and 1
    // multiply with the window width minus the width of the quiz box
    var rand_x = Math.floor(Math.random()*300);
       
    // generate a random value between 0 and 1
    // multiply with the window height minus the height of the quiz box
    var rand_y = Math.floor(Math.random()*250);

    // avoid that the box moves more to the left than it's original position
    if (rand_x < 0) {
      //rand_x = 0;
    }

    // avoid that the box moves more to the top than it's original position
    if (rand_y < 0) {
      //rand_y = 0;
    }

    // get the box object by using jquery's selector
    el = $(elem);

    // use jquery's animate method to change the the object's css properties left and top
    // 250 is the duration of the animation
    el.animate({
        left: rand_x,
	top: rand_y
      }, 250 );
}