jQuery.noConflict();

function str_replace(search, replace, subject, count)
{
	f = [].concat(search), r = [].concat(replace), s = subject,
	ra = r instanceof Array, sa = s instanceof Array;
	s = [].concat(s);
	if (count)
	{
		this.window[count] = 0;
	}
	for (i = 0, sl = s.length; i < sl; i++)
	{
		if (s[i] === '')
		{
			continue;
		}
		for (j = 0, fl = f.length; j < fl; j++)
		{
			temp = s[i] + '';
			repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];
			s[i] = (temp).split(f[j]).join(repl);
			if (count && s[i] !== temp)
			{
				this.window[count] += (temp.length - s[i].length) / f[j].length;
			}
		}
	}
	return sa ? s : s[0];
}

jQuery(function()
{
	jQuery('a.lightbox').lightBox();
});

jQuery(document).ready(function()
{ 	
	jQuery(document).pngFix();

	jQuery('#wissel').cycle(
	{ 
		fx:    		'fade',
		timeout:	7000,
		speed:  	1500 
	});
	
	var prepend1	= '<div class="kaart_item_over';
	var prepend2 	= '" style="';
	var prepend3 	= '"><div class="kaart_item_dot1">&nbsp;</div><div class="kaart_item_dot2"><div class="kaart_item_label">';
	var append   	= '</div></div></div>';
	
	jQuery(".kaart_item").mouseover(function()
	{	
		var top 	= jQuery(this).css("top");
		var left 	= jQuery(this).css("left");
		
		
		top = str_replace("px", "", top);
		left = str_replace("px", "", left);
		
		var id	= jQuery(this).find("a").attr("title");
		var content = jQuery(".kaart_tekst" + id).html();
		jQuery(this).parent().prepend(
				prepend1 + " temp_label" + prepend2 + 
				"top: " + (top - 5) + "px; left: " + (left - 5) + 
				"px;" + prepend3 + content + append);
	});
	
	jQuery(".temp_label").livequery(function()
	{
		jQuery(this).mouseleave(function()
		{
			jQuery(".temp_label").remove();
		});
	});		
});
