$(function() {
	
	
	
	//------ Global Vars----------------------------------------------------------------

	// Erstmal ein paar grundlegende Elemnte chachen.
	var $header      = $('header'),
		$bgImage     = $('#bg_image'),
		arrowUp      = '',
		arrowDown    = '',
		infoBtn      = '',
		$wrapper 	 = '',
		$scrollUl    = '',
		$fullImgDesc = '',
		
		// Abstand der Galerie links && richtung der info boxen
		offsetLeft 	 = 0,
		infoBoxDir   = '220px',
		
		// Gallery int bool
		isGallery    = 0,
		// Hintergrundbild für Start / Info festlegen
		startImg     = 'tl_files/patricekunte/images/galerie/reportage/SIMSON/20.jpg',
		galerieImg   = 'tl_files/patricekunte/images/galerie/bg_galerie.jpg',		
		infoImg		 = 'tl_files/patricekunte/images/galerie/reportage/Seesause/12_20100808_Maschseefest_Kunte_40.jpg',
		impressumImg = 'tl_files/patricekunte/images/galerie/reportage/SIMSON/34.jpg',
		vitaImg      = 'tl_files/patricekunte/images/galerie/reportage/Seesause/12_20100808_Maschseefest_Kunte_40.jpg',
		kontaktImg   = 'tl_files/patricekunte/images/info/kontakt-kl.jpg',
		referenzImg  = 'tl_files/patricekunte/images/galerie/reportage/Vom_Bleiben_und_Aufhoeren/04.jpg',
		
		// Startbilder
		startImg01     = 'tl_files/patricekunte/images/start/start01.jpg',
		startImg02     = 'tl_files/patricekunte/images/start/start02.jpg',
		startImg03     = 'tl_files/patricekunte/images/start/start03.jpg',
		startImg04     = 'tl_files/patricekunte/images/start/start04.jpg',

		// Hintergrundbild array
		currBgImg    = 0,
		bgImages	 = [startImg01, startImg02, startImg03, startImg04],
		
		// Multimedia int bool
		multimedia   = 0,
		
		// boolean ob der Browser IE ist, nicht optimal aber es funktioniert
		isIE		 = $.browser.msie,
		// Die Version fuer Versionspsezifische Fixes Ermitteln
		IEVersion 	 = (isIE) ? $.browser.version : '',
		// Fix weil IE nicht mit % bei animationen klar kommt 
		// (wenn eine andere Animation gewaehlt wird wird dies Ueberfluessig)
		percentage	 = (isIE) ? document.documentElement.clientHeight / 100 : window.innerHeight / 100,
		innerHeight  = (isIE) ? document.documentElement.clientHeight - 60 : window.innerHeight - 60,
		bgImageSize  = [$bgImage.find('img').height(), $bgImage.find('img').width(), $bgImage.find('img').css('bottom')];
		
		
		
	//------ Laden des zufaelligen Hintergrundbildes -----------------------------------------------------------	
		//randomBgImage();
		
		var bgImgInt = setInterval(function() {randomBgImage()}, 10000);




	//------ Get The New Menu -----------------------------------------------------------
	
		function getCats(url) {
			clearInterval(bgImgInt);
			// nur ausfuehren wenn man sich auf der Hauptseite befindet
		//	if (location.hash === '#' || location.hash === '' || $('html').hasClass('hashAction') || !$('body').hasClass('2ndLevel')) {
			if (!$('body').hasClass('2ndLevel')) {
				var newColour = ($header.hasClass('orange')) ? 'rgb(216,125,23)' : '#1f8400',
					once = 0;
				
				$('nav').find('li a').addClass('current').parent().css({position: 'relative', overflow: 'hidden', color: newColour}).animate({height: '4px', top: '-100px'}, function() {
					if (once === 0) {
						$('nav').before("<div id='newNav' class='secondLevel' />");
						
						if (isIE && parseInt(IEVersion) < 9) {
							// Fix fuer IE Version < 9 fuer HTML5 KompatibiltÃ¤t
							$('#newNav').loadShiv(url + ' nav', function() {
								$('.secondLevel nav').find('li a').css({
									height: '42px',
									lineHeight: '42px'
								});
							
							
								$('.secondLevel nav').find('li a').each(function() {
									menuItemAni($(this));
								});	
							
							});

						} else {
							$('#newNav').load(url + ' nav', function() {
								$('.secondLevel nav').find('li a').css({
									height: '42px',
									lineHeight: '42px'
								});
								
								var catsLength = $(this).find('li').length;
								
								$('.secondLevel nav').find('li a').each(function(i) {
									menuItemAni($(this));
									
									if (i === catsLength - 1) {
										$('body').trigger('catsLoaded');
									}
									
								});	
							
							});
						}
						
						once++;
					}
				});
				
				$('html').removeClass('hashAction');
				
				
			}
		}
	

	//------ Gallery Stuff --------------------------------------------------------------
	
	function indexImages(element) {
		// Jedem Bild eine Nummer zu ordnen
		// (weil jQuery es nicht mochte :nth-child() dafÃ¼r zu verwenden, aus irgendeinem Grund...)
		var index = 1;
		element.each(function() {
			$(this).addClass(index + '');
			index++;
		});
		
	}
	
	// Vertical Scrolling
	
	function initVertScrollBig() {
	
	    $wrapper = $('.imgScrollingWrapper');
		$scrollUl = $('.imgScrolling');
		
		$wrapper.css({
			height: innerHeight + 60,
			width: bgImageSize[1],
			bottom: bgImageSize[2]
		}).fadeIn(100);
		
		
		$scrollUl.empty().html("<li class='1'><img alt='image' title='hier titel einfuegen' src='#' /></li>");
		
		
		$scrollUl.find('li').css({
			height: innerHeight + 60,
			width: bgImageSize[1],
			bottom: bgImageSize[2]
		}).fadeIn(100);
		
		
		$scrollUl.find('li img').css({
			height: bgImageSize[0],
			width: bgImageSize[1],
			bottom: bgImageSize[2]			
		});
		
		$scrollUl.find('li:first-child img').attr('src', galerieImg);
		
		$wrapper.animate({scrollTop:0}, 1);
		
		
		$bgImage.hide();
		
 	} // END FUNCTION
	
	
	
	function arrowAction(parentEl) {
	
		var nextImage,
			numElements = parentEl.find('li').length;
		
		arrowUp.click(function() {
			nextImage = parseInt($wrapper.attr('id')) - 1;
			
			nextImage = (nextImage <= 0) ? 1 : nextImage;


			$wrapper.animate({scrollTop: '-=' + (innerHeight + 60)}, 500);
			
			
			
		});
		
		arrowDown.click(function() {
			nextImage = parseInt($wrapper.attr('id')) + 1;
			nextImage = (nextImage > numElements) ? parentEl.find('li').length : nextImage;
			

			$wrapper.animate({scrollTop: '+=' + (innerHeight + 60)}, 500);
			
		});
		
		
		
		// info button
		
		
		kontPopUp();
		
		infoBtn.click(function() {
		
		
			if ($('#fullImgDesc:hidden').length) {
				$('#fullImgDesc').fadeIn(400);
			} else {
				$('#fullImgDesc').fadeOut(400);
			}
			
			
		
		});
		 
		
		
				
	}
	
	// Funktion um die Bilderreihe zum laufen zu bekommen.
	
	function enableGallery() {
		var gallery = $('#galleryUl'),
			srcPath,
			path;
		
		initVertScrollBig();
		
		indexImages(gallery.find('li img'));
	
		$('#arrowContainer').remove();
		$('#fullImgDesc').remove();
		
		$('#mainCont').css('height', innerHeight);
		
		if (parseInt(offsetLeft) > 300) {
			infoBoxDir = '-220px';
		} else {
			infoBoxDir = '220px';
		}
		
		gallery.css('left', offsetLeft);
		
		// Plugin welches das Scrollen Uebernimmt initialisieren

		gallery.hoverscroll({
			vertical: true,
			width: window.innerWidth - 100,
			arrows: false,
			height: innerHeight
		});
		
		
		// Die Infotafeln rein/raus bewegen
		gallery.find('li').hover(function() {
			$(this).find('.imgInfo').stop().animate({left: infoBoxDir});
		}, function() {
			$(this).find('.imgInfo').stop().animate({left: '0px'});
		});
		

	//------ Full View --------------------------------------------------------------------
		
		
		gallery.find('li a').click(function(e) {
			e.preventDefault();
			
			var url = $(this).attr('href');
				$fullImgDesc = $('#fullImgDesc');
			
			if (multimedia === 0) {
			// Load the images into the ul
			
				$('.imgScrolling').fadeOut(250, function() {
					
					$(this).load(url + ' ul', function() {
					
						$scrollUl.find('li').css({
							height: innerHeight + 60,
							width: bgImageSize[1],
							overflow: 'hidden'
						});
						
						
						$scrollUl.find('li img').css({
							height: bgImageSize[0],
							width: bgImageSize[1],
							display: 'block'	
						});
					
						$(this).fadeIn();
					});
					
				
				});
				
				$('#mainCont').fadeOut(700);
				
				$header.css('overflow', 'hidden').animate({height: '4px'}).addClass('small');
				
				// Die Arows einblenden
				
				$('#arrowContainer').fadeIn(250);
				
				
				// Den Infotext Laden
				$fullImgDesc.fadeIn(150);		
				$fullImgDesc.find('.imgTitle').fadeOut().html($(this).parent().find('.imgTitle').html()).fadeIn(150);
				$fullImgDesc.find('p').fadeOut().html($(this).parent().find('.fullCatDesc p').html()).fadeIn(150);
			
			} else {
				
				$scrollUl.find('li:first-child').fadeOut();
				
				$fullImgDesc.find('.imgTitle').empty().hide();
				$fullImgDesc.find('p').empty().hide();
				
				
				$fullImgDesc .css({
					height: '480px',
					width: '640px',
					left: '250px',
					top: '30px'
				});
				
				
				
				if ($fullImgDesc.find('iframe').length) {
					$fullImgDesc.find('iframe').attr('src', 'http://player.vimeo.com/video/' + url + '?title=0&amp;byline=0&amp;portrait=0').parent().fadeIn();
					$fullImgDesc.find('p').html($(this).parent().find('.fullCatDesc p').show().html()).fadeIn();
				} else {
					$fullImgDesc.prepend('<iframe src="http://player.vimeo.com/video/' + url + '?color=1F8400&amp;title=0&amp;byline=0&amp;portrait=0" width="640" height="480" frameborder="0"></iframe>').fadeIn(); 
					$fullImgDesc.find('p').html($(this).parent().find('.fullCatDesc p').show().html()).fadeIn();
					$('#arrowContainer').hide();
					$('.close').hide();
				}

				
				
				
				
				// Header und strip ausblenden
				
				$('#mainCont').fadeOut(700);
				
				$header.css('overflow', 'hidden').animate({height: '4px'}).addClass('small');
			
			}



			
		}); // END .click() FUNCTION
		
		
		
		
		
		// Show/Hide the gallery when in full view
		$('header, #galleryUl').mouseenter(function() {
			if ($header.hasClass('small')) {
				$('#mainCont').stop(false, true).fadeIn(500);
				$header.css('overflow', 'visible').stop().animate({height: '56px'}, 250);
				arrowUp.animate({top: percentage * (-30) + 'px'});
				arrowDown.animate({top: percentage * 120 + 'px'});
			}
		});
		
		
		// Show/Hide the gallery when in full view
		gallery.mouseleave(function() {
			if ($header.hasClass('small')) {

					$('#mainCont').delay(500).stop(false, true).fadeOut(400);

				
				$header.css('overflow', 'hidden').stop().delay(500).animate({height: '4px'}, 250);
			}
		}); // END FUNCTION
		
		// Prepend the new #fullImgDesc & the Arrows
		$('#ajaxCont')
			.after("<div id='fullImgDesc'><span class='close'>X</span><span class='imgTitle'></span><p></p></div>")
			.after("<div id='arrowContainer'><span class='arrow up'></span><span class='arrow down'></span><span class='info'></span></div>");
		$('.arrow').css('left', window.innerWidth/2 - 30);	
		arrowUp = $('.arrow.up');
		arrowDown = $('.arrow.down');
		infoBtn = $('#arrowContainer .info');
		$('#arrowContainer').hide();
		// Full Image Description Stuff
		$('#fullImgDesc').draggable().find('.close').click(function() {
			$(this).parent().fadeOut(); 
		});
		
		// Enable Arrows for navigating
		arrowAction(gallery);
		
	
		
	} // END FUNCTION
	
	
	
	
	//------ AJAX Stuff -----------------------------------------------------------------
	
	function loadContent(url) {
		$('#preloader').fadeIn('fast');
		getCats(url);
	//	var hash = url.split('/');
	//	location.hash = hash[1].substr(0, hash[1].length - 5);
		$('body').addClass('2ndLevel');
		$('#ajaxCont').empty()
	
	//------ sprachwahl nur auf der startseite -----------------------------------------------------------
	
			$('#lang').hide();

		
		if (isIE && parseInt(IEVersion) < 9) {
			
			// Wieder der IE HTML5 Fix
			$('#ajaxCont')
				.loadShiv(url + ' #mainCont', function() {
						if (isGallery === 1) {
							enableGallery();
						}
					$('#ajaxCont').trigger('loaded');
					$('#mainCont').css('height', innerHeight);
					$('#preloader').fadeOut('fast');

				});
				

			
		} else {
			// Fuer richtige Browser
			$('#ajaxCont')
				.load(url + ' #mainCont', function() {
						if (isGallery === 1) {
							enableGallery();
						}
					$('#ajaxCont').trigger('loaded');
					$('#mainCont').css('height', window.innerHeight - 60);
					$('#preloader').fadeOut('fast');

				});
		
		}
		
	}
	
	
	
	
	
	//------ Default Stuff -----------------------------------------------------------------
	
 	// Menu
	
	$header.delegate('nav li a', 'click', function(e) {
		if (!$(this).hasClass('extern')) {
		
		if (!$('html').hasClass('hashAction')) {
			($header.hasClass('atTop')) ? location.hash = location.hash.split('/')[0] + '/' + $(this).text() : location.hash = $(this).text() + '/';
		}
		
		$('html').removeClass('hashAction');
		
		$('nav li a.mainLink').removeClass('current');
		
		if ($(this).hasClass('mainLink')) {
		
			$(this).addClass('current');
			
		} else {
			$(this).parent().find('a:first-child').addClass('current');
		}
		
		// sonderregelung fuer die multimedia inhalte
		if ($(this).hasClass('multimedia')) {
		
			multimedia = 1;
		
		} else {
			multimedia = 0;
		}
		
		// abstand fuer den filmstrip
		
		if ($header.hasClass('atTop') && isGallery === 1) {
			offsetLeft = $(this).offset().left - 100;
		}
		
		if (!$header.hasClass('atTop')) {	
		
			isGallery = 1;
			
			$header.stop().animate({top: '0%', height: '56px'}, 500).addClass('atTop').find('#topbar').slideDown(150);
		//	$('#logo a').html("<img src='tl_files/patricekunte/img/home.png' height='25px' alt='home' />").css({background: '#000', height: '25px'}).animate({width: '60px'}, 400);
		
			$('#logo a').empty().addClass('inUse').css({height: '32px'}).animate({width: '85px'}, 400);
		
			$('#newNav').remove();
			
			// Wenn es ein der Infobutton ist, ein paar Sonderbefehle ausfuehren
			// (neues Bild laden, orange faerben, etc.)
			if ($(this).text() === 'info') {
				var imagePath = ($(this).text().toLowerCase() === 'info') ? 'vita' : $(this).text().toLowerCase();
				$header.addClass('orange');
				$bgImage.fadeOut(150, function() {
					$(this).find('img').attr('src', infoImg).parent().delay(100).fadeIn(350)
				});
				$('#logo a').addClass('info');
				isGallery = 0;
			} else {
				$('#logo a').addClass('gallery');
			}			
			
		}
		
		
		// Fuer jeden Infounterpunkt das neue Hintergrundbild laden
		if ($header.hasClass('orange')) {
			// undbind the loaded event from the $('#ajaxCont') element
			$('#ajaxCont').unbind('loaded');
			
			$('.imgScrollingWrapper').hide();
		
			var thisText = $(this).text().toLowerCase(),
				whichImg = '';

			$bgImage.fadeOut(250, function() {
				
			
			
				switch (thisText) {
					case 'galerie':
						whichImg = galerieImg;
						break;
					case 'vita':
						whichImg = vitaImg;
						break;
					case 'impressum':
						whichImg = impressumImg;
						break;
					case 'imprint':
						whichImg = impressumImg;
						break;					
					case 'kontakt':
						whichImg = kontaktImg;
						break;
					case 'contact':
						whichImg = kontaktImg;
						break;					
					case 'references':
						whichImg = referenzImg;
					case 'referenzen':
						whichImg = referenzImg;
						
						$('#ajaxCont').bind('loaded', function() {
							$.getScript('http://www.patricekunte.de/tl_files/patricekunte/js/jquery.tools.min.js', function() {
								// main vertical scroll
								$("#main").scrollable({
								// basic settings
								vertical: true,
								// up/down keys will always control this scrollable
								keyboard: 'static',
								// assign left/right keys to the actively viewed scrollable
								onSeek: function(event, i) {
								    if(horizontal)
										horizontal.eq(i).data("scrollable").focus();
								}
								// main navigator (thumbnail images)
								}).navigator("#main_navi");
	
								// horizontal scrollables. each one is circular and has its own navigator instance
								var horizontal = $(".scrollable").scrollable({ circular: true }).navigator(".navi");
								// when page loads setup keyboard focus on the first horzontal scrollable
								horizontal.eq(0).data("scrollable").focus();
							});
						});
						
						break;
				}			
			
			
				$(this).find('img').attr('src', whichImg).load(function() {
					$(this).parent().fadeIn(350);
				});
				
			}); // END CALLBACK FUNCTION
			
		}
		
		
		e.preventDefault();
		
		// IE Fix, da IE7 absolute URLs verwendet muss angepasst werden, da ich nicht weiss, ob Contao
		// absolute oder relative URLs ausspuckt muss es evtl. geaendert werden.
		//if (isIE && parseInt(IEVersion) === 7) {
			
		loadContent($(this).attr('href'));
		
			
		}
			
	//	} else {
		
			// Einfach ein schoenes IF-Statement...	
			//($('.secondLevel').length) ? loadContent(location.hash.substr(1).split('/')[0] + '/' + $(this).attr('href')) : loadContent($(this).attr('href'));
		//}
		//
		
	});
	
	// Logo:
	
	$('#logo a').click(function(e) {
		if ($header.hasClass('atTop')) {
			$header.removeClass('orange');
			$('html').removeClass('hashAction');
			$header.stop().animate({top: '40%', height: '70px'}, 500).removeClass('atTop').find('#topbar').slideUp(150);
			$('#logo a').removeClass('inUse').removeClass('info').removeClass('gallery').html("<img src='tl_files/patricekunte/img/sz_pk.png' alt='home' />").animate({width: '230px'}, 400);
			$header.removeClass('small');
			$('#ajaxCont').empty();
			$('#newNav').remove();
			$('nav li').css({position: 'static', color: '#ffffff'}).animate({height: '70px', top: '0'});
			$('#arrowContainer').remove();
			$('.imgScrollingWrapper, .imgScrolling').unbind('mousemove');
			
			if ($scrollUl) {
				$scrollUl.unbind('click');
				$scrollUl.empty();
				$wrapper.hide();
			}
			$('.imgScrollingWrapper').hide();
			$('#fullImgDesc').remove();
			
			location.hash = '';
			$('body').removeClass('2ndLevel');
					$('#lang').show();
		}
		
		randomBgImage();
		//$bgImage.find('img').attr('src', startImg).parent().delay(500).fadeIn(350)
		
		bgImgInt = setInterval(function() {randomBgImage()}, 15000);
		
		$('nav li a.mainLink').removeClass('current');
		
//		$('.imgScrollingWrapper').fadeIn(150);
		
		// undbind the lodaed event from the $('#ajaxCont') element
		$('#ajaxCont').unbind('loaded');
		
		offsetLeft = 0;
		isGallery = 0;
		multimedia = 0;
		
		e.preventDefault();
		
		
	});
	
	
	//--- Window resize event --------------------------------------------------------
	
	$(window).bind('resize', function() {

		percentage	 = (isIE) ? document.documentElement.clientHeight / 100 : window.innerHeight / 100;
		innerHeight  = (isIE) ? document.documentElement.clientHeight - 60 : window.innerHeight - 60;
		
		if (isGallery === 1) {
		
		$wrapper.animate({scrollTop: '0'}, 10);
		
		$bgImage.show();
		bgImageSize[0] = $bgImage.find('img').height();
		bgImageSize[1]  = $bgImage.find('img').width();
		bgImageSize[2]  = $bgImage.css('bottom');
		$bgImage.hide();
		
		}
		
		if ($scrollUl) {
		
			$('#ajaxCont, #mainCont, .hoverscroll, .listcontainer').css('height', innerHeight);
		
		
			$wrapper.css({
				height: innerHeight + 60,
				width: bgImageSize[1]
			});

			$scrollUl.find('li').css({
				height: innerHeight + 60,
				width: bgImageSize[1],
				bottom: bgImageSize[1],
				overflow: 'hidden'
			});
			
			
			$scrollUl.find('li img').css({
				height: bgImageSize[0],
				width: bgImageSize[1],
				display: 'block'	
			});
		}
	});
	
	
	//------ Hash Actions ---------------------------------------------------------------
	function hashActions() {
		if (location.hash !== '#' && location.hash !== '') {
			$('html').addClass('hashAction');
			
			if (location.hash.substr(1).split('/')[1]) {

				$('body').bind('catsLoaded', function() {
					$(".secondLevel a.menuItemAni:contains\('" + location.hash.substr(1).split('/')[1] + "')").trigger('click');
					$(this).unbind('catsLoaded');
				});
			}
			
			
			$("nav a.menuItemAni:contains\('" + location.hash.substr(1).split('/')[0] + "')").trigger('click');
	
		}
		
	} // END FUNCTION hashActions()
	
	// Funktion fuer das Animieren der Menuepunkte
	
	function menuItemAni(element) {
		//element.html("<span>" + element.html() + "</span>");	
		element.parent().css({overflow: 'hidden', height: element.outerHeight()})
			   .append("<a class='menuItemAni current " + element.attr('class') + "'></a>").find('.menuItemAni').attr('href', element.attr('href'))
			   .css({
			   		display: 'block',
			   		height: element.outerHeight(),
			   		width: element.width(),
			   		lineHeight: element.css('line-height')
			   }).html(element.html());
	
		element.parent().hover(function() {
		
			element.stop(true, true).animate({marginTop: '-' + element.outerHeight()}, 150);
		
		}, function() {
			element.stop(true, true).animate({marginTop: '0px'}, 150);
		
		});	
		
		element.addClass('mainLink');
		
		
	} // END menuItemAni() FUNCTION	
		
		
		
	$('nav li a').each(function(i) {
		menuItemAni($(this));

		if (i === 2) {
			hashActions();
		}
		
	});	


	
	// Funcktion fuer die unterschld. Hintergrundbilder
	
	function randomBgImage() {
		$bgImage.fadeOut(350, function() {
			var max    = bgImages.length,
				newImg = Math.floor(Math.random()*max+1) - 1;
				
			currBgImg = (newImg === currBgImg) ? Math.floor(Math.random()*max+1) - 1 : newImg;
			
			//console.log(currBgImg);
			
			$bgImage.find('img').attr('src', bgImages[currBgImg]);
				
			$bgImage.find('img').load(function() {
				$bgImage.fadeIn(350);
			});
			
		});	
	} // END randomBgImage() FUNCTION

	$('#preloader').fadeOut();
	
	
	
	
	
	
	
	/*******************************************************************************
	*
	* Kontakdaten PopUp
	*
	********************************************************************************/
	
	function kontPopUp() {
	
		
			
		
		
			$("<span class='kontakt' />").appendTo('#arrowContainer');
				
				$('.kontakt').click(function() {
					
					if ($('#kontaktPopUp').length) {
						($('#kontaktPopUp:visible').length) ? $('#kontaktPopUp').hide() : $('#kontaktPopUp').fadeIn();
					} else {
					
						$("<div id='kontaktPopUp' />").insertAfter('#fullImgDesc').html("<span class='close'>X</span><span class='title'>Kontakt</span><p class='altlink'>Patrice Kunte<br />Caroline-Herschel-Weg 11<br />31535 Neustadt&nbsp;&nbsp;&nbsp; <br />Germany<br /><br />+49 (0)172 6493643<br /><a href='&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#105;&#110;&#x66;&#x6F;&#x40;&#x70;&#x61;&#116;&#114;&#x69;&#99;&#x65;&#107;&#117;&#110;&#116;&#101;&#x2E;&#x64;&#101;'>&#105;&#110;&#x66;&#x6F;&#x40;&#x70;&#x61;&#116;&#114;&#x69;&#99;&#x65;&#107;&#117;&#110;&#116;&#101;&#x2E;&#x64;&#101;</a></p>").draggable().find('.close').click(function() {
																	$(this).parent().fadeOut();
						
																});
					}
				});
			
	} // END kontPopUp() FUNCTION
	
	
	
	
	
	
	
	
	
	
	
});
