$(document).ready(function() {

	$('.slider_box a img').each(function() {
		$(this).before('<ins class="l"></ins><ins class="r"></ins><ins class="t"></ins><ins class="b"></ins><b class="tl"></b><b class="tr"></b><b class="bl"></b><b class="br"></b>');
		$(this).parent().addClass('photo-decor').addClass('photo-decor-small');
		if (! $(this).parent().attr('href'))
			$(this).parent().attr('href', $(this).attr('src'));
	});

	$('#catalogue-card .description img').addClass('fancybox');
	$('#catalogue-card table img').addClass('fancybox');

	$('img.fancybox').each(function(){
		$(this).removeClass('fancybox');
		var href = $(this).attr('src');
		$(this).wrap('<a class="fancybox" href="' + href + '" />');
	});
	$('.album, .slider_box').each(function() {
		$(this).tinycarousel({ display: 2 });
	});
	startList = function() {
		if (document.all&&document.getElementById)	{
			navRoot = document.getElementById("navigation")
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover=function()	{
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
	window.onload=startList;

	$(".fancybox, .slider_box .overview a").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600,
		'speedOut'		:	200,
		'overlayShow'	:	false
	});

	$('a.photo-change').click(function() {
		$('#card-main-photo img').attr('src', $(this).attr('rel'));
		$('#card-main-photo').attr('href', $(this).attr('href'));
		return false;
	});

	$('.toggle-hint').each(function() {
		$(this).data('val', $(this).val());
		$(this).click(function() {
			if ($(this).val() == $(this).data('val'))
				$(this).val('');
		}).blur(function() {
			if ($(this).val() == '')
				$(this).val($(this).data('val'));
		});
	});

	$('table tr:first').addClass('first');

	$('#addtofav').click(function() {
	 if (document.all  && !window.opera) {
     if (typeof window.external == "object") {
        window.external.AddFavorite (document.location, document.title);
        return true;
      }
      else return false;
	 } else {
		  target.href=document.location;
		  target.title=document.title;
		  target.rel = "sidebar";
		  return true;
		}
	});

	$('#sendmail').click(function() {
	});
});



