function noSpam() {
    if (document.getElementById) {
		var at = "@";
	  	var links = document.getElementsByTagName('a');
	  
	  	for (var i = 0; i < links.length; i++) {
		  	var linkElem = links[i];
			
		  	if (linkElem.className == 'escape') {
		  		var mail = linkElem.firstChild; var domain = linkElem.lastChild;
		  		mail.nextSibling.firstChild.innerHTML = at;
		  		linkElem.href = "mailto:" + mail.data + at + domain.data;
		  	}
			
	  	} // End for
	  
    } // End if
}
 function correctPosition(oElement,oPos,oWhich) {
      while( oElement.offsetParent ) {
        oPos -= oElement['offset'+oWhich];
        oElement = oElement.offsetParent;
      }
      oPos += document.documentElement['scroll'+oWhich] ? document.documentElement['scroll'+oWhich] : document.body['scroll'+oWhich];
      return oPos;
    }
 function IE6BodyBGRFixed(){
    document.writeln( '<style type="text\/css">' );
    document.writeln( "body { background-position: expression( correctPosition(this,10,'Left')+'px '+correctPosition(this,20,'Top')+'px'); }" );
    document.writeln( '<\/style>' );	 
 }


// Onload-Methode ohne Prototype:
window.onload = noSpam;


if (jQuery) {
	
	$(document).ready(function() {
		
		 $('input[type=text][title!=""]').each(function() {
			if ($.trim($(this).val()) == '') $(this).val($(this).attr('title'));
			if ($(this).val() == $(this).attr('title')) $(this).addClass('exampleText');
		}).focus(switchText).blur(switchText);
		
		$('form').submit(function() {
			$(this).find('input[type=text][title!=""]').each(function() {
				if ($(this).val() == $(this).attr('title')) $(this).val('');
			});
		});
		
		 $('textarea[title!=""]').each(function() {
			if ($.trim($(this).val()) == '') $(this).val($(this).attr('title'));
			if ($(this).val() == $(this).attr('title')) $(this).addClass('exampleText');
		}).focus(switchText).blur(switchText);
		
		$('form').submit(function() {
			$(this).find('textarea[title!=""]').each(function() {
				if ($(this).val() == $(this).attr('title')) $(this).val('');
			});
		});
		
		$('#sidebar input.submit').hover(
		  function () {
			
			$(this).attr('src', 'images/submit-button-hover.png');
		  },
		  function () {
			$(this).attr('src', 'images/submit-button.png');
		  }
		);
   
    });

	function switchText(){
		if ($(this).val() == $(this).attr('title'))
			$(this).val('').removeClass('exampleText');
		else if ($.trim($(this).val()) == '')
			$(this).addClass('exampleText').val($(this).attr('title'));
	}
	
	
   
}


