var base64s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

var slide=false;

function decode(encStr) {
	var bits;
	var decOut = '';
	var i = 0;
	for(; i<encStr.length; i += 4) {
		bits = (base64s.indexOf(encStr.charAt(i))    & 0xff) <<18 |
			 (base64s.indexOf(encStr.charAt(i +1)) & 0xff) <<12 |
			 (base64s.indexOf(encStr.charAt(i +2)) & 0xff) << 6 |
			  base64s.indexOf(encStr.charAt(i +3)) & 0xff;
		decOut += String.fromCharCode((bits & 0xff0000) >>16, 
		(bits & 0xff00) >>8, bits & 0xff);
		}
	if(encStr.charCodeAt(i -2) == 61) { return(decOut.substring(0, decOut.length -2)); }
	else if(encStr.charCodeAt(i -1) == 61) { return(decOut.substring(0, decOut.length -1));	}
	else {return(decOut)};
	}


function tiodtsuj(a,text) { var text=text || 'NULL'; var x=decode(a);temp=x.split('###');document.write('<a href="mai');document.write('lto:'+temp[1]);document.write('@');document.write(temp[0]+'">'); if (text=="NULL") { document.write(temp[1]);document.write('@');document.write(temp[0]); } else document.write(text); document.write('</a>');} 	


$(document).ready(function(){ 	
	
	$("ol#hauptmenu > li").hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); });
	
	$("ol#list > li").hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); });
	
	$("#reiter > div").hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); });
	
	$("#wrapper h1").click(function() { location.href='http://www.zib.at'; });
	
	$(".shop-item").click(function() { location.href=$(this).attr("rel"); });

	$('a.lightbox').lightBox({
		overlayBgColor: '#FFFFFF',
		overlayOpacity: 0.8,
		imageLoading: '/incs/jquery/images/lightbox-ico-loading.gif',
		imageBtnClose: '/incs/jquery/images/lightbox-btn-close.gif',
		imageBtnPrev: '/incs/jquery/images/lightbox-btn-prev.gif',
		imageBtnNext: '/incs/jquery/images/lightbox-btn-next.gif',
		containerResizeSpeed: 350,
		txtImage: 'Bild',
		txtOf: 'von'
		});

   $("#gallery-container a.gallery").lightBox({
		overlayBgColor: '#FFFFFF', 
		overlayOpacity: 0.8,
		imageLoading: '/incs/jquery/images/lightbox-ico-loading.gif',
		imageBtnClose: '/incs/jquery/images/lightbox-btn-close.gif',
		imageBtnPrev: '/incs/jquery/images/lightbox-btn-prev.gif',
		imageBtnNext: '/incs/jquery/images/lightbox-btn-next.gif',
		containerResizeSpeed: 350,
		fixedNavigation:true,
		txtImage: 'Bild',
		txtOf: 'von'
		});

	if (slide==true) $("#slideshow").easySlider({ auto: true, continuous: true, dots: true, numeric: false });

	$("#close-zibi-overlay").click(function() { 
											$("#overlay-zibi").fadeOut("slow"); 
											$("#overlay-back").hide();
											}); 
	
						   
		$("#ZiBmap area").hover(function() { if ($(this).attr("rel")!=18) $("#overs").html('<img src="http://www.zib.at/img/floorplans/ZiB_Shop_'+$(this).attr("rel")+'.png" width="854" height="512" />'); }, function() { $("#overs").html(''); });
		
		$("#shoplist li").hover(function() { if ($(this).attr("rel")!=18) $("#overs").html('<img src="http://www.zib.at/img/floorplans/ZiB_Shop_'+$(this).attr("rel")+'.png" width="854" height="512" />'); }, function() { $("#overs").html(''); });
				   
		$('#ZiBmap > area').tooltip({ 
			track: true, 
			delay: 0, 
			showBody: " - ", 
			fade: 0, 
			opacity: 1, 
			fixPNG: true,
			left: -87,
			top:-100,
			showURL: false
			});		   

	}); 
	

