jQuery(document).ready(function($){

	var css_class_of_teasers = "teaser_with_rollovertext";
	var id_notation_of_teasers = "teaser"; /* make this the id-names of teasers sans the numbers, that is, if your ID's of the teasers are in the format id="teaser1", id="teaser2" and so on, it would be just "teaser" */
	var css_class_of_rollovertexte = "rollovertext";
	var id_notation_of_rollovertexte = "rollovertext"; /* make this the id-names of the rollovertexte sans the numbers, that is, if your ID's of the teasers are in the format id="teaser1", id="teaser2" and so on, it would be just "teaser" */
	var id_of_default_rollovertext = "rollovertext_default";




	teasers = $("."+css_class_of_teasers); // get the teasers
	rollovertexte = $("."+css_class_of_rollovertexte); // get the rollovertexte;


	rollovertexte.not("#" + id_of_default_rollovertext).hide(); // hide the rollovertexte except the default one. Done via jQuery to ensure unobstrusive JS.
	rollovertexte.css({position: "absolute"}); // making the rollovertexte absolutely positioned to make sure the page does not jump around while fading in/out the elements

	teasers.hover( // Adding the hover-action to each of the teasers
		function() { // Defining what's to do onMouseOver
			$("#" + id_of_default_rollovertext).ClearTypeFadeOut("fast"); // hide the default rollovertext, will not be shown again afterwards

			var id = this.id; // get the ID of the element
			id_number = str_replace(id_notation_of_teasers,"",id); // extract the number so we can add it to the rollovertexte-id's later

			var rollovertext = id_notation_of_rollovertexte + id_number;
			$("#" + rollovertext).ClearTypeFadeIn("slow");  // Fading out the appropriate rollovertext
		},
		function() { // Defining what's to do onMouseOut
			var id = this.id; // get the ID of the element
			id_number = str_replace(id_notation_of_teasers,"",id); // extract the number so we can add it to the rollovertexte-id's later

			var rollovertext = id_notation_of_rollovertexte + id_number;
			$("#" + rollovertext).ClearTypeFadeOut("fast"); // Fading out the appropriate rollovertext
		}
	);

}); /* end jQuery.ready(function());*/











function str_replace(search, replace, subject) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Gabriel Paderni
    // +   improved by: Philip Peterson
    // +   improved by: Simon Willison (http://simonwillison.net)
    // +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   bugfixed by: Anton Ongson
    // +      input by: Onno Marsman
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +    tweaked by: Onno Marsman
    // *     example 1: str_replace(' ', '.', 'Kevin van Zonneveld');
    // *     returns 1: 'Kevin.van.Zonneveld'
    // *     example 2: str_replace(['{name}', 'l'], ['hello', 'm'], '{name}, lars');
    // *     returns 2: 'hemmo, mars'

    var f = search, r = replace, s = subject;
    var ra = r instanceof Array, sa = s instanceof Array, f = [].concat(f), r = [].concat(r), i = (s = [].concat(s)).length;

    while (j = 0, i--) {
        if (s[i]) {
            while (s[i] = (s[i]+'').split(f[j]).join(ra ? r[j] || "" : r[0]), ++j in f){};
        }
    };

    return sa ? s : s[0];
}
