﻿/*****************************************************// Kreiert einen Overlay und zeigt das Panoramabild an******************************************************/var panoIframe = ' <iframe name="lunchgate" src="{link}" scrolling="no" frameborder="no" height="{h}" width="{w}"></iframe> ';function centerDiv(div, w, h){	var centerH = $(window).width()/2;	var centerV = $(window).height()/2;		 var left =  (centerH) - (w/2);	 var top = (centerV) - (h/2);	 	 $('#' + div).css({			'width': '1px',			'height': '1px',			'top': centerV + 'px',			'left':centerH + 'px',			'display':'block'		});	 	 $('#' + div).animate({			'width': w + 'px',			'height': h + 'px',			'top': top + 'px',			'left': left + 'px'		}, 2000);}function closePano(){	$('#panoOverlay').fadeOut('fast', function(){		$('#panoOverlay').remove();	});}$(document).ready(function(){	// Datumsfelder initialisieren		$('a[rel="panoLB"]').bind('click', function(){			var panoOverlay = '<div id="panoOverlay"><div id="panoBackground"></div><div id="panoContent">{content}</div><a class="close" href="javascript:void(0);" onclick="closePano();">&nbsp;</a></div>';				// Get the Link and build an iframe				var link = $(this).attr('href');				var vars = link.split('?').pop().split('&');				var w;		var h;				for(i in vars){						try{				if(vars[i].indexOf('w=') != -1)					w = vars[i].split('=').pop();								if(vars[i].indexOf('h=') != -1)					h = vars[i].split('=').pop();			}catch(e){							}		}				//var w = vars[1].split('=').pop();		//var h = vars[2].split('=').pop();				// Set the Content with an iFrame				var thisIframe = panoIframe.replace('{link}', link);		thisIframe = thisIframe.replace('{w}', w);		thisIframe = thisIframe.replace('{h}', h);				panoOverlay = panoOverlay.replace('{content}', thisIframe);				$('body').append(panoOverlay);				centerDiv('panoContent', w, h);				return false;			});});
