function $(obj) {
  return document.getElementById(obj);
}

function rollovers(div) {
  var self = this; // set up object reference
  self.suffix = '_over'; // suffix for over images
  self.div = (typeof div == 'object') ? div : $(div); // get the div object
  self.images = self.div.getElementsByTagName('img'); // store the default image objects
  
  for(var i = 0; i < self.images.length; i++) {
    // over src array
    var split = self.images[i].src.split('.');
	var overSrc = '';
	
	for (var j = 0; j < split.length; j++) {
	  if (j == (split.length - 1)) {
	    overSrc += self.suffix;
	  }
	  if (j != 0) {
	    overSrc += '.';
	  }
	  overSrc += split[j];
	}
	
    // preload images
    self.images[i].rollover = new Image();
    self.images[i].rollover.src = (overSrc);
    self.images[i].defaultSrc = self.images[i].src;
    
    self.images[i].onmouseover = function() {
      this.src = this.rollover.src;
    }
	
	self.images[i].onmouseout = function() {
	  this.src = this.defaultSrc;
	}
	
  } // end for each image
}

function prepareForm() {

  $('input_name').onblur = function() {
    if ($('input_name').value == '') {
	  $('input_name').value = 'Name';
	}
  }
  
  $('input_email').onblur = function() {
    if ($('input_email').value == '') {
	  $('input_email').value = 'E-Mail';
	}
  }
  
  $('input_name').onfocus = function() {
    if ($('input_name').value == 'Name') {
	  $('input_name').value = '';
	}
  }
  
  $('input_email').onfocus = function() {
    if ($('input_email').value == 'E-Mail') {
	  $('input_email').value = '';
	}
  }
  
}

window.onload = function() { new rollovers('menu'); prepareForm(); };