  Global.call("Tooltipps.init()");

  var Tooltipps = {
        init: function() {
          $$(".fotolink").each(function(t) {
              t.observe("mouseover", function(e){

              if (t.readAttribute('rel') != null) {
                  $('fotolink_headline').innerHTML = "";
                  $('fotolink_content').innerHTML = '<img src="/img/ajax-loader.gif" />';
                  $('fotolink_price').innerHTML = "";
                  new Ajax.Request("/ajax/index/index.fotolink.php", {
                  method: 'post',
                  parameters: {
                          object: t.readAttribute('rel')
                  },

                  onSuccess: function(json){
                      var data = json.responseText.evalJSON();
                      $('fotolink_headline').innerHTML = data.name;
                      $('fotolink_content').innerHTML = data.description;
                      price_euro = 0;
                      price_cent = 0;

                      for(i=0; i <= data.price_amount.length; i++){
                          if (data.price_amount.substr(i,1) == ".")
                          {
                              price_euro = data.price_amount.substr(0,i);
                              price_cent = data.price_amount.substr(i+1,2);
                          }
                      }
                      if (data.price_info == 'col')
                      {
                          fotolink_price_content = '<div class="full_price"><div class="price_euro" style="font-size: 16px;">Auf Anfrage</div></div>';
                      }
                      else
                      {
                          fotolink_price_content = '<div class="full_price"><div class="price_euro">' + price_euro + '</div><div class="price_cent">' + price_cent + '</div><div class="price_typ">pro ' + data.price_base + '</div></div>';
                      }
                      $('fotolink_price').innerHTML = fotolink_price_content;

                      //fotolink_price.innerHTML = data.price_amount;
                    }
                    });

                    $("fotolink_tooltip").setStyle({
                        top: e.pointerY() + 20 + "px",
                        left: e.pointerX() + 20 + "px",
                        display: "block"
                    });
                  }

              }),
              t.observe("mouseout", function(e){
                  $("fotolink_tooltip").hide();
              }),
              t.observe("mousemove", function(e){
                $("fotolink_tooltip").setStyle({
                      top: e.pointerY() + 20 + "px",
                      left: e.pointerX() + 20 + "px"
                  });
              })
          }
	)

        }
      };




//	fotolink_tooltip = null;
//	document.onmousemove = updateFotolinkTooltip;
//
//	function updateFotolinkTooltip(e) {
//	  var _event = Event.extend(e);
//	  if (fotolink_tooltip != null && fotolink_tooltip.style.display == 'block') {
////		x = (e.pageX ? e.pageX : window.event.x) + fotolink_tooltip.offsetParent.scrollLeft - fotolink_tooltip.offsetParent.offsetLeft;
////	    y = (e.pageY ? e.pageY : window.event.y) + fotolink_tooltip.offsetParent.scrollTop - fotolink_tooltip.offsetParent.offsetTop;
////	    fotolink_tooltip.style.left = (x + 20 ) + "px";
////	    fotolink_tooltip.style.top   = (y + 20) + "px";
//
//		x = _event.pointerX();
//	    y = _event.pointerY();
//
//	    fotolink_tooltip.setStyle({
//			left: (x + 20) + "px",
//			top: (y + 20) + "px"
//		});
//	  }
//	}
//
//	function showFotolinkTooltip(id, object) {
//	    new Ajax.Request("/ajax/index/index.fotolink.php", {
//		method: 'post',
//		parameters: {
//			object: object
//		},
//
//		onSuccess: function(json){
//		    var data = json.responseText.evalJSON();
//		    $('fotolink_headline').innerHTML = data.name;
//		    $('fotolink_content').innerHTML = data.description;
//		    price_euro = 0;
//		    price_cent = 0;
//
//		    for(i=0; i <= data.price_amount.length; i++){
//			if (data.price_amount.substr(i,1) == ".")
//			{
//			    price_euro = data.price_amount.substr(0,i);
//			    price_cent = data.price_amount.substr(i+1,2);
//			}
//		    }
//		    if (data.price_info == 'col')
//		    {
//			fotolink_price_content = '<div class="full_price"><div class="price_euro" style="font-size: 16px;">Auf Anfrage</div></div>';
//		    }
//		    else
//		    {
//			fotolink_price_content = '<div class="full_price"><div class="price_euro">' + price_euro + '</div><div class="price_cent">' + price_cent + '</div><div class="price_typ">pro ' + data.price_base + '</div></div>';
//		    }
//		    $('fotolink_price').innerHTML = fotolink_price_content;
//
//		    //fotolink_price.innerHTML = data.price_amount;
//		  }
//	    });
//
//	    fotolink_tooltip = $(id);
//	    //fotolink_headline = $('fotolink_headline');
//	    //fotolink_content = $('fotolink_content');
//	    //fotolink_price = $('fotolink_price');
//	    fotolink_tooltip.style.display = "block";
//	}
//
//	function hideFotolinkTooltip(id) {
//	    fotolink_tooltip.style.display = "none";
//	}
	
