$(document).ready(function() {
	$("a[rel=group]").fancybox({
		transitionIn: 'none',
		transitionOut: 'none',
		titlePosition: 'over',
		titleFormat: function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
		}
	});
	$(".fancybox").fancybox({
		transitionIn: 'none',
		transitionOut: 'none',
		titlePosition: 'over'
	});
	$(".accordion").accordion({
		autoHeight: false,
		active: false,
		collapsible: true
	});
	$(".coda-slider").codaSlider({
		autoSlide: true,
		autoSlideInterval: 5000,
		autoSlideStopWhenClicked: true,
		dynamicArrows: true,
		dynamicTabs: true,
		dynamicTabsPosition: 'bottom',
		dynamicArrowLeftText: ' ',
		dynamicArrowRightText: ' ',
		panelTitleSelector: 'div.icon',
	});
});

Obj1 = null;

function view(zahl) {
  if (document.getElementById('a_'+zahl)) {
  	Obj=document.getElementById('a_'+zahl);
    disable();
    Obj1 = null;
    for (var i=0;i<Obj.parentNode.childNodes.length;i++) {
		if (Obj.parentNode.childNodes[i].nodeType == 1 && Obj.parentNode.childNodes[i].nodeName == "UL") {
			Obj1 = Obj.parentNode.childNodes[i];
		}
    }
    if (Obj1) {
		Obj2 = document.getElementById("menutopcontainer");
		Obj3 = document.getElementById("maincontainer");
		Obj4 = document.getElementById("li_"+zahl);
		Obj1.style.height = "auto";
		if (navigator.appName == "Netscape" || navigator.appName == "Opera" || navigator.appVersion.indexOf("MSIE 8.0") > -1) {
			if (navigator.appVersion.indexOf("Safari") > -1) {
				// Chrome, Safari
				Obj1.style.left = (Obj.offsetLeft - 6) + "px";
				Obj1.style.top = (Obj2.offsetTop + 45) + "px";
			}
			else {
				// Firefox 3, Firefox 2, Opera, IE8
				Obj1.style.left = (Obj.offsetLeft - 6) + "px";
				Obj1.style.top = (Obj2.offsetTop + 45) + "px";
			}
      } else {
			if (navigator.appVersion.indexOf("MSIE 7.0") > -1) {
				//IE 7
				Obj1.style.left = (Obj.offsetLeft + Obj3.offsetLeft + Obj4.offsetLeft + 215) + "px";
				Obj1.style.top = (Obj2.offsetTop + Obj3.offsetTop + 46) + "px";
			} else {
				//IE 6, IE 5.5, IE 5.0
				Obj1.style.left = (Obj.offsetLeft + Obj3.offsetLeft + Obj4.offsetLeft + 215) + "px";
				Obj1.style.top = (Obj2.offsetTop + Obj3.offsetTop + 44) + "px";
			}
      }
      Obj1.style.visibility = "visible";
    }
  }
}

function disable() {
  if (Obj1) {
    Obj1.style.visibility = "hidden";
    Obj1.style.height = "1px";
  }
}
