
/*
===============================================================================

 template: Template 10 - JS

===============================================================================
*/

/* -------------------------------------------------------------
	jQuery
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	Autor:        i.A. (AB)
	Company:    onOffice Software AG
	Release:    1.0
	------------------------------------------------------------- */

	$(document).ready(function()
	{

		// Zwischenlösungen

		if($('.content .third .news-list').length >= 1)
		{
			$('.content .third .news-list a').each(function()
			{
				if($(this).attr('href') != undefined) {
					var thisHref = $(this).attr('href').split('?');

					$(this).attr('href', 'news.xhtml?' + thisHref[1]);
				}
			});
		}

		//

		/* $('img').each(function()
		{
			if($(this).attr('style') != undefined)
			{
				$(this).removeAttr('style');
			}
		}); */

		$('.partner img').each(function()
		{
			$(this).css('margin-top', (100 - $(this).height()) / 2 + 'px');
		});

		/* -------------------------------------------------------------
		Blank formfields
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$('input[type="text"]').each(function()
		{
			if($(this).val() == '')
			{
				$(this).val($(this).attr('default'));
			}

			$(this).focus(function()
			{
				if($(this).val() == $(this).attr('default'))
				{
					$(this).val('');
				}
			});

			$(this).blur(function()
			{
				if($(this).val() == '')
				{
					$(this).val($(this).attr('default'));
				}
			});
		});

		$('textarea').each(function()
		{
			if($(this).text() == '')
			{
				$(this).text($(this).attr('default'));
			}

			$(this).focus(function()
			{
				if($(this).text() == $(this).attr('default'))
				{
					$(this).text('');
				}
			});

			$(this).blur(function()
			{
				if($(this).text() == '')
				{
					$(this).text($(this).attr('default'));
				}
			});

		});

		$('select').change(function() {
			if($(this).hasClass('default') && $(this).val() != '')
			{
				$(this).removeClass('default');
			}
			else if($(this).val() == '')
			{
				$(this).addClass('default');
			}
		});

		/* -------------------------------------------------------------
		Functions
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$.fn.defaults();
		$.fn.forms();
		$.fn.mediaQueries();

		/* -------------------------------------------------------------
		Grid
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$('.column.third:nth-child(3n)').after('<div class="clear"></div>');

		/* -------------------------------------------------------------
		Top-Bar
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		if($('.top-bar .languages ul li').length == 0)
		{
			$('.top-bar .languages').hide().remove();
		}

		$('.top-bar .languages ul li img').each(function()
		{
			$(this).attr('src', $(this).attr('src').replace('template', 'template/template-9'));

		});

		$('.top-bar .languages ul li.selected img').appendTo('.top-bar .languages .active-language');
		$('.top-bar .languages ul li.selected').hide().remove();

		$('.top-bar .languages i').click(function()
		{
			if($(this).hasClass('icon-angle-down'))
			{
				$(this).removeClass('icon-angle-down');
				$(this).addClass('icon-angle-up');
			}
			else
			{
				$(this).removeClass('icon-angle-up');
				$(this).addClass('icon-angle-down');
			}

			$('.top-bar .languages ul').slideToggle('fast');
		});

		/* -------------------------------------------------------------
		Navigation
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$('.navigation .logo i').click(function()
		{
			$('.navigation nav').slideToggle('fast');
		});

		if($(window).width() >= 640)
		{
			$('.navigation nav ul ul').each(function()
			{
				if($(this).outerWidth() <= $(this).parent('li').outerWidth())
				{
					$(this).css('min-width',($(this).parent('li').outerWidth() + 16)+'px');
					$(this).find('a').css('min-width',($(this).parent('li').outerWidth() + 16)+'px');
				}
			});
		}

		/* -------------------------------------------------------------
		Slider
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		if( !$('.slider-large .animation').hasClass('smartsitebanner-individual') )
		{

			if($('.slider-large .animation img').length >= 1)
			{
				$('.slider-large .animation img').each(function(index)
				{
					var cssTop = '';

					if($(this).attr('data-top') != undefined)
					{
						cssTop = ' background-position: center ' + $(this).attr('data-top');
					}

					$('.slider-large .animation').append('<div style="background-image: url(' + $(this).attr('src') + ');' + cssTop + '" id="slide-' + index + '"></div>');
					$(this).hide().remove();
				});

				if($('.slider-large .animation div').length >= 2)
				{

					var img_timeout = 6500;
					var img_speed   = 4000;

					$('.slider-large .animation div').each(function(index)
					{
						$(this).attr('id', 'slide-' + index);

						$('.slider-large .slider-navigation p').append('<span data-slide="slide-' + index + '"></span>');
					});

					$('.slider-large .animation div:first').fadeIn().addClass('selected');
					$('.slider-large .animation div:last').addClass('last');

					$('.slider-large .slider-navigation p span:first').addClass('selected');

					var slider = setInterval('$.fn.mySlider()', img_timeout);

					$('.slider-large .slider-navigation p span').click(function()
					{
						$('.slider-large .animation div.selected').fadeOut(img_speed).removeClass('selected');
						$('#' + $(this).attr('data-slide')).fadeIn(img_speed).addClass('selected');

						$('.slider-large .slider-navigation p span.selected').removeClass('selected');
						$(this).addClass('selected');

						clearInterval(slider);
						slider = setInterval('$.fn.mySlider()', img_timeout);
					});
				}
				else {
					$('.slider-large .animation div:first').fadeIn().addClass('selected');
				}
			}
		}

		/* -------------------------------------------------------------
		Slider Small static image
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		if ( $('.slider-small .smartsitebanner-individual > img').length )
		{
		   $('.slider-small .smartsitebanner-individual > img').css('opacity', '0');
		}


		if($('.quicksearch').length >= 1 || $('.content .third form').length >= 1)
		{
			$('#rooms-range-min').slider(
			{
				range: 'min',
				value: 0,
				min: 0,
				max: 10,
				slide: function(event, ui)
				{
					$('#rooms-label span').text(ui.value);
					$('#rooms').val(ui.value);
				}
			});

			$('#rooms-label span').text($('#rooms-range-min').slider('value'));
			$('#rooms').val($('#rooms-range-min').slider('value'));

			$('#radius-range-min').slider(
			{
				range: 'min',
				value: '',
				min: '',
				max: 50,
				step: 5,
				slide: function(event, ui)
				{
					if(ui.value == '')
					{
						$('#radius-label span').text('keiner');
						$('#radius').val('');
					}
					else
					{
						$('#radius-label span').text(ui.value + ' km');
						$('#radius').val(ui.value);
					}
				}
			});

			$('#radius-label span').text('keiner');
			$('#radius').val($('#radius-range-min').slider('value'));
		}

		//ALTER CODEBLOCK
		// if($('.slider-small').length >= 1)
		// {

		//     if ( !$('.slider-small .animation').hasClass('smartsitebanner-individual') )
		//     {
		//         var numRand = Math.floor(Math.random() * $('.slider-small .animation img').length);

		//         $('.slider-small').css('background-image', 'url(' + $('.slider-small .animation img:eq(' + numRand + ')').attr('src') + ')');
		//     }

		// }

		//NEUER CODEBLOCK
		if($('.slider-small').length >= 1)
		{
				var numRand = Math.floor(Math.random() * $('.slider-small .animation img').length);

				$('.slider-small').css('background-image', 'url(' + $('.slider-small .animation img:eq(' + numRand + ')').attr('src') + ')');
				$('.slider-small .animation img').remove();
		}

		/* -------------------------------------------------------------
		Object-tabs
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		//ALTER OBJEKLTSLIDER

		// if($('.object-tabs').length >= 1)
		// {
		//     $('.tab-content .image img').css('opacity','0');

		//     $.fn.sliderObjWidth();

		//     $('.tab-content > div.row').each(function()
		//     {
		//         if($(this).find('.list-object').length == 0)
		//         {
		//             $(this).hide().remove();
		//             $('a[href="#' + $(this).attr('id') + '"]').parent('li').hide().remove();
		//         }
		//     });

		//     if($('.tabs li').length == 0)
		//     {
		//         $('.object-tabs').hide().remove();
		//     }

		//     $('.tab-content > div.row:first').addClass('selected');
		//     $('.object-tabs .tabs a:first').addClass('selected');

		//     if($('.tab-content').length >= 1)
		//     {

		//         $('.tab-content .row.selected .image li').addClass('tabcontent-loading');

		//         $('.tab-content .row').each(function()
		//         {
		//             var column_count     = $(this).find('.column').length;
		//             var column_max_width = $(this).find('.column:first').outerWidth();

		//             if( (column_count * column_max_width) >= $('.tab-content').innerWidth() )
		//             {
		//                 $(this).width( column_count * column_max_width + 2 );
		//             }
		//             else
		//             {
		//                 $(this).width('100%');
		//             }
		//         });
		//     }

		//     $('.object-tabs .tabs a').not('selected').click(function()
		//     {
		//         $('.object-tabs .tabs a.selected').removeClass('selected');
		//         $(this).addClass('selected');

		//         $('.tab-content .nav div.prev').hide();

		//         $('.tab-content div.selected').css('left', '0px');
		//         $('.tab-content div.selected').removeClass('selected');
		//         $('.tab-content div' + $(this).attr('href')).addClass('selected');

		//         $.fn.tabContentHomeImages();

		//         var obj_width         = $('.tab-content div.selected .column:first').outerWidth();
		//         var slide_width       = $('.tab-content div.selected .column').length * obj_width + 1;
		//         var tab_content_width = $('.tab-content').outerWidth();

		//         if ( $('.tab-content div.selected').css('left') == '0px' )
		//         {
		//             $('.tab-content .nav div.prev').hide();
		//         }

		//         if ( slide_width <= tab_content_width)
		//         {
		//             $('.tab-content .nav div.next').hide();
		//         }
		//         else
		//         {
		//             $('.tab-content .nav div.next').show();
		//         }

		//         return false;
		//     });

		//     $('.tab-content .nav div').click(function()
		//     {
		//         var direction = '-';
		//         var obj_width = $('.tab-content div.selected .column:first').outerWidth();

		//         if ( $(this).hasClass('prev') )
		//         {
		//             direction = '+';
		//         }

		//         $('.tab-content div.selected').stop(true, true).animate(
		//         {
		//             'left': direction + '=' + obj_width + 'px'
		//         }, 125, function()
		//         {

		//             var slide_width       = $('.tab-content div.selected .column').length * obj_width;
		//             var tab_content_width = $('.tab-content').outerWidth();

		//             var max_value     = tab_content_width - slide_width;
		//             var max_value_val = parseInt(max_value, 10);
		//             var pos_html      = $('.tab-content div.selected');
		//             var pos           = pos_html.position();
		//             var pos_left      = pos.left;
		//             var pos_left_val  = parseInt(pos_left, 10);

		//             if ( pos_left_val >= '0')
		//             {
		//                 $('.tab-content .nav div.prev').hide();
		//                 $('.tab-content .nav div.next').show();
		//             }
		//             else
		//             {
		//                 $('.tab-content .nav div.prev').show();
		//             }

		//             if ( pos_left_val <= max_value_val )
		//             {
		//                 $('.tab-content .nav div.next').hide();
		//             }
		//             else
		//             {
		//                 $('.tab-content .nav div.next').show();
		//             }
		//         });
		//     });
		// }

    var bildschirmbreite = $(window).width();
	
	if ( bildschirmbreite <= 800 ) {


		//NEUER OBJEKTSLIDER

		$('#startseiteobjecttop0 .object-frame, #startseiteobjectall1 .object-frame, #startseiteobjectall2 .object-frame, #startseiteobjectall3 .object-frame, #startseiteobjectall4 .object-frame, #startseiteobjectall5 .object-frame').slick({
		  dots: false,
		  infinite: false,
		  speed: 300,
		  slidesToShow: 4,
		  slidesToScroll: 1,
		  prevArrow: '<button type="button" class="slick-prev"><i class="icon-chevron-sign-left"></i></button>',
		  nextArrow: '<button type="button" class="slick-next"><i class="icon-chevron-sign-right"></i></button>',
		  responsive: [
			{
			  breakpoint: 1024,
			  settings: {
				slidesToShow: 2,
				slidesToScroll: 1,
			  }
			},
			{
			  breakpoint: 600,
			  settings: {
				slidesToShow: 1,
				slidesToScroll: 1
			  }
			},
			{
			  breakpoint: 480,
			  settings: {
				slidesToShow: 1,
				slidesToScroll: 1
			  }
			}
		  ]

		});

		$(window).load(function()
		{
			$('#top-angebote').hide();
			$('#immobilien-kaufen').hide();
			$('#immobilien-mieten').hide();
			$('#referenzen').hide();
			$('#hotel').hide();
			$('#neubau').hide();
			$('.tabs ul li:nth-child(1) a').click();
		});

		if ( !$('#top-angebote .column.fourth').length ) {
			$('.container.tabs ul li#top-tab').remove();
		}
		if ( !$('#immobilien-kaufen .column.fourth').length ) {
			$('.container.tabs ul li#kauf-tab').remove();
		}
		if ( !$('#immobilien-mieten .column.fourth').length ) {
			$('.container.tabs ul li#miet-tab').remove();
		}
		if ( !$('#referenzen .column.fourth').length ) {
			$('.container.tabs ul li#referenz-tab').remove();
		}

		if ( !$('#hotel .column.fourth').length ) {
			$('.container.tabs ul li#hotel-tab').remove();
		}

		if ( !$('#neubau .column.fourth').length ) {
			$('.container.tabs ul li#neubau-tab').remove();
		}

		$('.container.tabs ul li#top-tab a').click(function()
		{
			$('.container.tabs ul li a').removeClass('selected');
			$(this).addClass('selected');
			$('#top-angebote').show();
			$('#immobilien-kaufen').hide();
			$('#immobilien-mieten').hide();
			$('#referenzen').hide();
			$('#hotel').hide();
			$('#neubau').hide();
			$('#startseiteobjectall0  .object-frame').slick('setPosition');
		});

		$('.container.tabs ul li#kauf-tab a').click(function()
		{
			$('.container.tabs ul li a').removeClass('selected');
			$(this).addClass('selected');
			$('#top-angebote').hide();
			$('#immobilien-kaufen').show();
			$('#immobilien-mieten').hide();
			$('#referenzen').hide();
			$('#hotel').hide();
			$('#neubau').hide();
			$('#startseiteobjectall1  .object-frame').slick('setPosition');
		});

		$('.container.tabs ul li#miet-tab a').click(function()
		{
			$('.container.tabs ul li a').removeClass('selected');
			$(this).addClass('selected');
			$('#top-angebote').hide();
			$('#immobilien-kaufen').hide();
			$('#immobilien-mieten').show();
			$('#referenzen').hide();
			$('#hotel').hide();
			$('#neubau').hide();
			$('#startseiteobjectall2  .object-frame').slick('setPosition');
		});

		$('.container.tabs ul li#referenz-tab a').click(function()
		{
			$('.container.tabs ul li a').removeClass('selected');
			$(this).addClass('selected');
			$('#top-angebote').hide();
			$('#immobilien-kaufen').hide();
			$('#immobilien-mieten').hide();
			$('#referenzen').show();
			$('#hotel').hide();
			$('#neubau').hide();
			$('#startseiteobjectall3  .object-frame').slick('setPosition');
		});

		$('.container.tabs ul li#hotel-tab a').click(function()
		{
			$('.container.tabs ul li a').removeClass('selected');
			$(this).addClass('selected');
			$('#top-angebote').hide();
			$('#immobilien-kaufen').hide();
			$('#immobilien-mieten').hide();
			$('#referenzen').hide();
			$('#hotel').show();
			$('#neubau').hide();
			$('#startseiteobjectall4  .object-frame').slick('setPosition');
		});

		$('.container.tabs ul li#neubau-tab a').click(function()
		{
			$('.container.tabs ul li a').removeClass('selected');
			$(this).addClass('selected');
			$('#top-angebote').hide();
			$('#immobilien-kaufen').hide();
			$('#immobilien-mieten').hide();
			$('#referenzen').hide();
			$('#hotel').hide();
			$('#neubau').show();
			$('#startseiteobjectall5  .object-frame').slick('setPosition');
		});

		$(window).load(function()
		{
			$('#top-angebote').hide();
			$('#immobilien-kaufen').hide();
			$('#immobilien-mieten').hide();
			$('#referenzen').hide();
			$('#hotel').hide();
			$('#neubau').hide();
			$('.tabs ul li:nth-child(1) a').click();
		});
	}

		


		/* -------------------------------------------------------------
		Footer
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		if($('.footer .google-maps').length >= 1)
		{
			googleMaps($('.footer .google-maps input').val());
		}

		if($('.meta-tabs a').length >= 1)
		{

			// $('.meta-tabs a').each(function(){

			//  var target_id = $(this).attr('href');
			//  var target_id_sanitized = $(target_id).split(' ').join('-');
			//          console.log(target_id_sanitized);

			// });

			// $('.meta-tab-content p').each(function(){

			//  console.log( $(this).attr('id') );

			//  // var target_id = $(this).attr('href');
			//  // console.log(target_id);

			//  // var target_id_sanitized = $(target_id).replace(' ','-');
			//  // console.log(target_id_sanitized);

			//  // $(this).attr('id', )

			// });

			$('.meta-tabs a').click(function()
			{
				$('.meta-tabs a.selected').removeClass('selected');
				$(this).addClass('selected');

				$('.footer .meta-tab-content p.selected').removeClass('selected');
				$('.footer .meta-tab-content ' + $(this).attr('href')).addClass('selected');

				return false;
			});
		}

		if($('.meta-navigation li').length >= 1)
		{
			$('.meta-navigation li:last').addClass('last');

			$('.meta-navigation li').each(function()
			{
				$(this).find('a').appendTo('.meta-navigation p');

				if(!$(this).hasClass('last'))
				{
					$('.meta-navigation p').append(' - ');
				}
			});

			$('.meta-navigation ul').hide().remove();
		}

		/* -------------------------------------------------------------
		Objects
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		if($('.content .object-frame').length >= 1 && !$('.content .detail').length )
		{
			$('.content > .container > .row > .third:not(.teaser)').hide().remove();
			$('.content > .container > .row > .third:not(.teaser)').css('width', '100%');

			$('.small-width').addClass('full-width').removeClass('small-width');

			$('.object-frame').unwrap('two-thirds');

			if($('.jumpbox-frame span a').length == 1)
			{
				$('.jumpbox-frame').hide().remove();
			}
		}

		if($('.content .detail').length >= 1)
		{
			$('.slider-small h2').text($('.detail > h2').text());

			$('.content .third > div').html('');
			$('.content .sidebar > *').appendTo('.content .third > div');

			// $('.content .third > div .links a:first').append('<i class="icon-star"></i>');

			$('.detail .gallery ul').wrap('<div class="gallery-slide"></div>');

			$('.detail .gallery ul').width((130 * $('.detail .gallery ul li').length) - 10)

			$('.detail .gallery > div:first').append('<span class="nav"><span class="prev" style="display: none;"></span><span class="next" style="display: block;"></span></span>');

			if($('.detail .gallery ul li').length <= 5)
			{
				$('.detail .gallery .nav span.next').hide();
			}

			$('.detail .gallery .nav span').click(function()
			{
				var direction = '-';

				if($(this).hasClass('prev'))
				{
					direction = '+';
				}

				$('.detail .gallery-slide ul').animate(
				{
					left: direction + '=130'
				}, function()
				{
					if($('.detail .gallery-slide ul').css('left') == '0px')
					{
						$('.detail .gallery .nav span.prev').fadeOut('fast');
					}
					else
					{
						$('.detail .gallery .nav span.prev').fadeIn('fast');
					}

					if($('.detail .gallery-slide ul').css('left') == '-' + (($('.detail .gallery-slide li').length * 130) - (5 * 130)) + 'px')
					{
						$('.detail .gallery .nav span.next').fadeOut('fast');
					}
					else
					{
						$('.detail .gallery .nav span.next').fadeIn('fast');
					}
				});
			});
		}

		if( $('.content .list-object').length ) {

			$('.content .list-object').each(function(){

				var sold = $(this).find('.object_sold').val();

				if ( sold == '1' )
				{
					$(this).find('.image > a').addClass('nolink');
				}

			});

		}

		/* -------------------------------------------------------------
		Full-Width
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		if($('.content .full-width').length >= 1)
		{
			var thirdCount = 0;
			var fourthCount = 0;

			$('.content .third').each(function()
			{
				thirdCount++;

				if(thirdCount == 3)
				{
					thirdCount = 0;

					$(this).addClass('no-border-right');
				}
			});

			$('.content .fourth').each(function()
			{
				fourthCount++;

				if(fourthCount == 4)
				{
					fourthCount = 0;

					$(this).addClass('no-border-right').after('<div class="clear"></div>');
				}
			});
		}

		//

		$('.top-frame form select').change(function()
		{
			$(this).parent('form').submit();
		});

		/* -------------------------------------------------------------
		News
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$('.content .third .news-list:last').addClass('last-news');

		$('.content .third .news-list').each(function()
		{
			if($(this).find('.image img').attr('src') == '' || $(this).find('.image img').attr('src') == undefined)
			{
				$(this).find('.image').hide().remove();
			}
			else
			{
				if($(this).find('p').height() <= $(this).find('.image').height())
				{
					$(this).find('p').height($(this).find('.image').height());
				}
			}
		});

		$('.content .two-thirds .news-list:last').addClass('last-news');

		$('.content .two-thirds .news-list').each(function()
		{
			if($(this).find('.image img').attr('src') == '' || $(this).find('.image img').attr('src') == undefined)
			{
				$(this).find('.image').hide().remove();
			}
			else
			{
				if($(this).find('p').height() <= $(this).find('.image').height())
				{
					$(this).find('p').height($(this).find('.image').height());
				}
			}
		});

		$('.content .two-thirds .news-list .image').each(function()
		{
			$(this).find('img').each(function()
			{
				if($(this).attr('src') == '' || $(this).attr('src') == undefined)
				{
					$(this).hide().remove();
				}
			});
		});

		// Soll Image-Box bei fehlendem Image in News-Detailansicht entfernen
		$('.news-details').each(function()
		{
			$(this).find('img').each(function()
			{
				if($(this).attr('src') == '' || $(this).attr('src') == undefined)
				{
					$(this).hide().remove();
				}
			});
		});

		/* -------------------------------------------------------------
		- Objekttracking: Login-Maske
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   */

		// - Submit-Button Klasse und Value vergeben
		$('#object-tracking input[type="submit"]').addClass("submit");
		$('#object-tracking .submit').val('Login');

		/* -------------------------------------------------------------
		- Objekttracking: Listenobjekt
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		// - Tabelle mit Objektdaten Attribute vergeben
		$('.objekttracking .listenobjekt .right div.objektdaten table').attr(
		{
			'cellpadding'   : '0',
			'cellspacing'   : '0',
			'border'        : '0'
		});

		// - Jede zweite Zeile Hintergrundfarbe weiß
		$('.objekttracking .listenobjekt .right div.objektdaten table tr:odd td').css({
			'background'    : '#fff'
		});

		// - Jede zweite Zelle Textausrichtung rechts
		$('.objekttracking .listenobjekt .right div.objektdaten table tr').each(function()
		{
			$(this).find('td:eq(0)').css(
			{
				'text-align'    : 'right'
			});
		});

		/* -------------------------------------------------------------
		- Objekttracking: Detailansicht
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   */

		// - Tracking-Tabelle Attribute vorgeben
		$('.tracking-list table').attr({
			'cellpadding': '0',
			'cellspacing': '0'
		});

		// - Plus-Button für mehr Details - SlideUp und Down als Toggle-Effekt
		$('.showmore').toggle(function()
		{
			$(this).parent().parent().next().find('div#tracking-bemerkung').stop(true, true).slideDown('slow');
			$(this).html('-');
		}, function()
		{
			$(this).html('+');
			$(this).parent().parent().next().find('div#tracking-bemerkung').stop(true, true).slideUp('slow');
		});

		/* -------------------------------------------------------------
		I-service
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   */
		$('.iservice .iservice-listobject').each(function()
		{
			$(this).find('table tr').each(function()
			{

				if ( $(this).find('td:last').html() == 'bis  m²' || $(this).find('td:last').html() == 'bis  €' || $(this).find('td:last').html() == '')
				{
					$(this).hide().remove();
				}
			});

			$(this).find('tr:even td').css('background', 'rgba(0, 0, 0, 0.03)');

		});
		
		/* -------------------------------------------------------------
		Formular - Status
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   */
		
	});

	$(window).load(function()
	{
		$('img').each(function()
		{
			if($(this).attr('src') != '')
			{
				if($(this).attr('data-src') != undefined)
				{
					$(this).attr('src', $(this).attr('data-src'));

					$(this).load(function()
					{
						$(this).fadeIn('fast');
					});
				}
			}
		});


		/* -------------------------------------------------------------
		Sofortanfrage Window-Scroll
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */    

		if ($('#request .status p').length) {
			var fTop = $('#request .status').offset().top - $('header').outerHeight() - 70;
			$(window).scrollTop(fTop);
		}    


		/* -------------------------------------------------------------
		obj details gallery
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$('.detail .gallery').css('background','none');

		$('.detail .gallery > div').fadeTo(400,1);

		if ( $('.detail').length )
		{
			if ( $.trim( $('.links-content').text() ) == '' )
			{
				$('.links').remove();
			}
		}

		/* -------------------------------------------------------------
		Sofortanfrage bei Referenzen entfernen
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		var referenzcheck = $('.referenzen-check').val();

		if(referenzcheck == 1) {
		    $('form#request').remove();
		}

		/* -------------------------------------------------------------
		Slider Small static image
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		if ( $('.slider-small .smartsitebanner-individual > img').length )
		{
		   $('.slider-small .smartsitebanner-individual > img').each(function(){

			   var imgHeight = $(this).height();
			   var boxHeight = $(this).parent().parent('.slider-small').height();
			   var topMargin = (imgHeight - boxHeight) / 2 * -1;

			   $(this).css('margin-top', topMargin+'px').fadeTo(250,1);

		   });
		}

		/* -------------------------------------------------------------
		Tab contents home
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$.fn.tabContentHomeImages();

		$('.tab-content .image img').fadeTo(150,1);

	});

	$(window).resize(function()
	{
		$.fn.mediaQueries();
		// $.fn.sliderObjWidth();
	});

	$('form').submit(function()
	{
		$('input[type="text"]').each(function()
		{
			if($(this).val() == $(this).attr('default'))
			{
				$(this).val('');
			}
		});

		$('textarea').each(function()
		{
			if($(this).text() == $(this).attr('default'))
			{
				$(this).text('');
			}
		});
	});

	$.fn.defaults = function()
	{
		/* -------------------------------------------------------------
		Empty Clear
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$('div.clear').html('');

		/* -------------------------------------------------------------
		External Links
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$('a').each(function()
		{
			if($(this).attr('href') != undefined)
			{
				if($(this).attr('href').indexOf('?link') >= 0)
				{
					var external_link = $(this).attr('href').split('?link=');

					$(this).attr('href', external_link[1]);

					if(external_link[1].indexOf('http') >= 0)
					{
						$(this).attr('target','_blank');
					}
				}
			}
		});

		/* -------------------------------------------------------------
		Table
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$('table').each(function()
		{
			if($(this).attr('cellspacing') == undefined)
			{
				$(this).attr('cellspacing', 0);
			}

			if($(this).attr('cellpadding') == undefined)
			{
				$(this).attr('cellpadding', 0);
			}

			if($(this).attr('border') == undefined)
			{
				$(this).attr('border', 0);
			}
		});

		/* -------------------------------------------------------------
		Images
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$('img').each(function()
		{
			if($(this).attr('src') != '')
			{
				if($(this).attr('data-src') != undefined)
				{
					$(this).hide();
				}
			}

			if($(this).attr('style') != undefined)
			{
				if (($(this).attr('src').indexOf('cmspics')) > 1 && (($(this).attr('style').indexOf('float: left')) > 1 ))
				{
					$(this).css('margin-left','0px').css('margin-top','0px');
				}
				else if (($(this).attr('src').indexOf('cmspics')) > 1 && (($(this).attr('style').indexOf('float: right')) > 1 ))
				{
					$(this).css('margin-right','0px').css('margin-top','0px');
				}
			}
		});
	}

	$.fn.forms = function()
	{
		var url = document.URL.split('?');

		if (url[1] != undefined) {
			url = url[1].split('&');

			for (x = 0; x <= (url.length - 1); x++) {
				var this_parameter = url[x].split('=');

				if (this_parameter != '') {
					var this_name = this_parameter[0].replace(/\%5B/g, '[').replace(/\%5D/g, ']');
					var this_value = '';

					if (this_parameter[1] != undefined) {
						this_value = decodeURI(this_parameter[1].replace(/\+/g, ' ').replace(/\+\%2F\+/g, ' / ').replace(/\%2C/g, ','));
					}

					$('select[name="' + this_name + '"]').each(function() {
						$(this).find('option').each(function() {
							if ($(this).val() == this_value) {
								$(this).attr('selected', 'selected');
								if ($(this).val() == 'grundstueck') {
									$(this).change();
								}
							}
						});
					});

					$('input[name="' + this_name + '"]').not('.nofill').each(function() {
						if ($(this).attr('type') == 'text' || $(this).attr('type') == 'hidden') {
							if (this_value != '') {
								$(this).val(this_value);
							}
						} else if ($(this).attr('type') == 'checkbox') {
							if (this_value != '') {
								$(this).attr('checked', 'checked');
							}
						} else if ($(this).attr('type') == 'radio' && $(this).val() == this_value) {
							$(this).attr('checked', 'checked');
						} else if ($(this).attr('type') == 'number' || $(this).attr('type') == 'hidden') {
							if (this_value != '') {
								$(this).val(this_value);
							}
						}
					});
				}
			}
		}
	}

	$.fn.mediaQueries = function()
	{

	}

	/* -------------------------------------------------------------
	Slider
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

	$.fn.mySlider = function()
	{
		var fadeTime = 2000;

		if($('.slider-large .animation div.selected').hasClass('last'))
		{
			$('.slider-large .animation div.last').fadeOut(fadeTime);
			$('.slider-large .animation div:first').fadeIn(fadeTime).addClass('selected');
			$('.slider-large .animation div.last:first').removeClass('selected');

			$('.slider-large .slider-navigation p span:last').removeClass('selected');
			$('.slider-large .slider-navigation p span:first').addClass('selected');
		}
		else
		{
			$('.slider-large .animation div.selected').fadeOut(fadeTime);
			$('.slider-large .animation div.selected').next('div').fadeIn(fadeTime).addClass('selected');
			$('.slider-large .animation div.selected:first').removeClass('selected');

			$('.slider-large .slider-navigation p span.selected').next('span').addClass('selected');
			$('.slider-large .slider-navigation p span.selected:first').removeClass('selected');
		}

		if($('.slider-small .animation div.selected').hasClass('last'))
		{
			$('.slider-small .animation div.last').fadeOut(fadeTime);
			$('.slider-small .animation div:first').fadeIn(fadeTime).addClass('selected');
			$('.slider-small .animation div.last:first').removeClass('selected');

			$('.slider-small .slider-navigation p span:last').removeClass('selected');
			$('.slider-small .slider-navigation p span:first').addClass('selected');
		}
		else
		{
			$('.slider-small .animation div.selected').fadeOut(fadeTime);
			$('.slider-small .animation div.selected').next('div').fadeIn(fadeTime).addClass('selected');
			$('.slider-small .animation div.selected:first').removeClass('selected');

			$('.slider-small .slider-navigation p span.selected').next('span').addClass('selected');
			$('.slider-small .slider-navigation p span.selected:first').removeClass('selected');
		}
	}

	/* -------------------------------------------------------------
	Google Maps
	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

	function googleMaps(addressInput)
	{
		var address = '';
		var geocoder = '';
		var lat = '';
		var lng = '';

		address = addressInput;
		geocoder = new google.maps.Geocoder();

		geocoder.geocode(
		{
			'address': address
		}, function(results, status)
		{
			if (status == google.maps.GeocoderStatus.OK)
			{
				lat = results[0].geometry.location.lat();
				lng = results[0].geometry.location.lng();

				var latlng = new google.maps.LatLng(lat,lng);

				var myOptions =
				{
					zoom: 15,
					center: latlng,
					mapTypeControl: false,
					scaleControl: false,
					panControl: false,
					rotateControl: false,
					streetViewControl: false,
					scrollwheel: false,
					zoomControl: false,
					draggable: false,
					mapTypeId: google.maps.MapTypeId.ROADMAP
				};

				var map = new google.maps.Map(document.getElementById("map-canvas"), myOptions);

				var marker = new google.maps.Marker(
				{
					position: latlng
				});

				marker.setMap(map);
			}
		});
	}

	$.fn.imagePosition = function()
	{
		$('.image').each(function(index)
		{
			var thisDiv = $(this);
			var thisImage = $(this).find('img');

			if($(thisImage).height() != undefined)
			{
				if($(thisImage).height() > $(thisDiv).height() && thisImage.height() != undefined)
				{
					$(thisImage).css('margin-top', '-' + (($(thisImage).height() - thisDiv.height()) / 2) + 'px');
				}

				if($(thisImage).width() > $(thisDiv).width() && thisImage.width() != undefined)
				{
					$(thisImage).css('margin-left', '-' + (($(thisImage).width() - thisDiv.width()) / 2) + 'px');
				}

				$(thisImage).delay(75 * index).fadeTo(1000,1);
			}
		});
	}

	// $.fn.sliderObjWidth = function() {

	//     var frame_width = $('.tab-content').innerWidth();

	//     if( $(window).width() <= 480 ) {

	//         /** Mobile Hochformat **/
	//         $('.tab-content div .object-frame').each(function() {
	//             $(this).find('.column').css('max-width', frame_width + 'px').outerWidth(frame_width);
	//         });

	//     } else if( $(window).width() <= 680 ) {

	//         /** Mobile Querformat **/
	//         $('.tab-content div .object-frame').each(function() {
	//             $(this).find('.column').css('max-width', (frame_width / 2) + 'px').outerWidth(frame_width / 2);
	//         });

	//     } else if( $(window).width() <= 768 ) {

	//         /** Tablet Hochformat **/
	//         $('.tab-content div .object-frame').each(function() {
	//             $(this).find('.column').css('max-width', (frame_width / 3) + 'px').outerWidth(frame_width / 3);
	//         });

	//     } else if( $(window).width() <= 1024 ) {

	//         /** Tablet Querformat **/
	//         $('.tab-content div .object-frame').each(function() {
	//             $(this).find('.column').css('max-width', (frame_width / 4) + 'px').outerWidth(frame_width / 4);
	//         });

	//     } else {

	//         /** Desktop **/
	//         $('.tab-content div .object-frame').each(function() {
	//             $(this).find('.column').css('max-width', (frame_width / 4) + 'px').outerWidth(frame_width / 4);
	//         });

	//     }
	// }

	$.fn.tabContentHomeImages = function() {

		/* -------------------------------------------------------------
		Tab content home
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

		$('.tab-content .row.selected .image li').each(function(){

			var img_height = $(this).find('img').height();
			var li_height  = $(this).height();
			var diff_vert  = li_height - img_height;

			if ( diff_vert < 0 ) {

				var diffvert_halved = diff_vert / 2;

				$(this).find('img').css('margin-top', diffvert_halved + 'px');

			} else if ( diff_vert > 0 ) {

				$(this).find('img').css({
					'height' : $(this).height(),
					'width' : 'auto',
					'max-width' : 'none'
				});

				var img_width  = $(this).find('img').outerWidth();
				var li_width   = $(this).outerWidth();
				var diff_horiz = li_width - img_width;

				if ( diff_horiz < 0 ) {

					var diffhoriz_halved = diff_horiz / 2;

					$(this).find('img').css('margin-left', diffhoriz_halved + 'px');

				}

			}

		});

	}

	function status( params ) {

		if( $('.list-object').length ) {
			
			$('.list-object').each(function(index) {

				if( $(this).find('ul li span').length ) {

					sThisType = $(this).find('ul li span').attr('class');

					if( sThisType == 'status-top' ) {
						$(this).find('ul li span').text(params.top_name);
					}

					if( sThisType == 'status-rented' ) {
						$(this).find('ul li span').text(params.rented_name);
					}

					if( sThisType == 'status-reference' ) {
						$(this).find('ul li span').text(params.reference_name);
					}

					if( sThisType == 'status-new' ) {
						$(this).find('ul li span').text(params.new_name);
					}

					if( sThisType == 'status-sold' ) {
						$(this).find('ul li span').text(params.sold_name);
					}

					if( sThisType == 'status-reduced' ) {
						$(this).find('ul li span').text(params.reduced_name);
					}

					if( sThisType == 'status-reserved' ) {
						$(this).find('ul li span').text(params.reserved_name);
					}

					if( sThisType == 'status-courtage_free' ) {
						$(this).find('ul li span').text(params.courtage_free_name);
					}

					if( sThisType == 'status-exclusive' ) {
						$(this).find('ul li span').text(params.exclusive_name);
					}

					$(this).find('ul li span').css('background-image', '');
				}
			});
		}

	}

	function bodyClass( contentkey ) {

		var body_class = contentkey.split('.');

		$('body').addClass( 'body-' + body_class[0] );

	}

	function breadcrumb( params ) {

		if( $('.breadcrumb').length == 0 ) {
			return false;
		}

		var site = 0;

		if( params.request_page != '' ) {
			site = params.request_page;

			if( site > 1 ) {
				$('.breadcrumb ul').append('<li><a href="' + params.website_current + '?p[obj0]=' + site +'">' + params.page_name + ' ' + site + '</a></li>');
			}
		}

		if( params.request_id != '' ) {
			var id = params.request_id;
			var id_external = $('.details').attr('id');

			if( id_external != undefined ) {
				if( site > 1 ) {
					$('.breadcrumb ul li:last a').attr('href', $('.breadcrumb ul li:last a').attr('href') + '#object-' + id);
					$('.breadcrumb ul').append('<li><a href="' + params.website_current + '?p[obj0]=' + site +'&id[obj0]=' + id + '">' + params.object_name + ' ' + id_external + '</a></li>');
				} else {
					$('.breadcrumb ul li:last a').attr('href',$('.breadcrumb ul li:last a').attr('href') + '#object-' + id);
					$('.breadcrumb ul').append('<li><a href="' + params.website_current + '?id[obj0]=' + id + '">' + params.object_name + ' ' + id_external + '</a></li>');
				}
			}
		}

		$('.breadcrumb ul li a.selected').removeClass('selected');
		$('.breadcrumb ul li:last a').addClass('selected');

		$('.breadcrumb ul li').each(function() {
			if( !$(this).find('a').hasClass('selected') ) {
				$(this).append('&nbsp;/&nbsp;');
			}
		});

		if( params.website_current != params.website_home ) {
			$('.breadcrumb ul').prepend('<li>' + params.label_name + ':&nbsp;</li><li><a href="' + params.website_home + '" target="_self">' + params.home_name + '</a>&nbsp;/&nbsp;</li>');
		}

	}

/*!
 * jQuery UI Touch Punch 0.2.3
 *
 * Copyright 2011–2014, Dave Furfero
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * Depends:
 *  jquery.ui.widget.js
 *  jquery.ui.mouse.js
 */
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);



		/* -------------------------------------------------------------
		Map (Search)
		- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
		$('.map-main').maphilight({
			fillColor: 'FFFFFF',
			strokeColor: '323840',
			strokeOpacity: 0
		});

		var search_toggle = true;

		$('.search-fields').each(function()
		{
			var this_div = $(this);
			var selected = false;
			var search_checkbox = false;

			$(this_div).find('.hidden select').each(function(index)
			{
				search_checkbox = false;

				if($(this).hasClass('region') || $(this).hasClass('ort'))
				{
					search_checkbox = true;
				}

				$(this).find('option').each(function()
				{
					$(this_div).find('.select:eq(' + index + ') ul').append('<li>' + $(this).text() + '</li>');

					if(search_checkbox == true && $(this).val() != '' && $(this).val() != '1-ESPM')
					{
						$(this_div).find('.select:eq(' + index + ') ul li:last').prepend('<input type="checkbox" class="checkbox" value="' + $(this).val() + '" data-region="' + $(this).attr('data-region') + '" />');
					}

					if($(this).attr('selected') == 'selected')
					{
						selected = true;

						$(this_div).find('.select:eq(' + index + ') span').text($(this).text());
					}
				});
			});

			if(selected == false)
			{
				$(this_div).find('.select span').text($(this_div).find('.select ul li:first').text());
			}

			$(this_div).find('.select click').click(function()
			{
				if( search_toggle == true ) {
					$(this_div).find('ul.open').slideToggle('fast');
					$('ul.open').removeClass('open');

					if(!$(this).parent('.select').find('ul').hasClass('open'))
					{
						$(this).parent('.select').find('ul').slideToggle('fast');
						$(this).addClass('open');
					}
				} else {
					search_toggle = true;
				}
			});

			$(this_div).find('.select ul li input').click(function(e)
			{
				e.stopPropagation();

				inputClick = true;

				$(this).parent('li').click();
			});

			$(this_div).find('.select ul li').click(function()
			{
				var map_li = $(this);
				var this_select = $(this).parent().parent();
				var li_text = $(this).text();

				if($(this).find('input').length >= 0)
				{
					var li_value = $(this).find('input').val();
				}

				if($(this).find('input').length >= 0)
				{
					if(typeof inputClick !== 'undefined' && inputClick == true )
					{
						if($(this).find('input').attr('checked') == 'checked')
						{
							if( typeof inputClick !== 'undefined' && inputClick == true )
							{
								inputClick = undefined;
							}
							else
							{
								$(this).find('input').attr('checked', true);
							}
						}
						else
						{
							$(this).find('input').attr('checked', false);
						}
					}
					else
					{
						if($(this).find('input').attr('checked') == 'checked')
						{
							$(this).find('input').attr('checked', false);
						}
						else
						{
							$(this).find('input').attr('checked', true);
						}
					}
				}

				$(this_div).find('.hidden select option').each(function()
				{
					if($(this).parent('select').hasClass('price'))
					{
						if($(this).text() == li_text)
						{
							$(this).attr('selected', 'selected');

							$(this).parent('select').val($(this).val());
							$(this).parent('select').change();

							$('.search-fields .hidden .price-max').val($(this).attr('data-max'));

							$(this_select).find('span').text(li_text);

							$(this_select).find('click').click();
						}
					}
					else if($(this).parent('select').hasClass('ort'))
					{
						if($(this).val() == li_value)
						{
							var ort_value_array = [];
							var ort_text_array = [];

							$('.ortsliste input:checked').each(function()
							{
								ort_value_array.push($(this).val());
								ort_text_array.push($(this).parent('li').text());
							});

							if(ort_value_array.length === 0)
							{
								$(this_select).find('span').text('Alle Orte');
								$('input.regionaler-zusatz').val('');
								$('input.regionaler-zusatz').removeClass('city');
							}
							else
							{
								$(this_select).find('span').text(ort_text_array);
								$('input.regionaler-zusatz').val(ort_value_array);
								$('input.regionaler-zusatz').addClass('city');
							}

							if( typeof mapClick !== 'undefined' && mapClick == true )
							{
								mapClick = undefined;

								return false;
							}

							$(this_select).find('click').click();
						}
					}
					else if($(this).parent('select').hasClass('region'))
					{
						if($(this).val() == li_value)
						{
							var click_area = $('.search-map area[href="' + $(map_li).find('input').val() + '"]');
							var click_data = click_area.mouseout().data('maphilight') || {alwaysOn: false};

							click_data.alwaysOn = !click_data.alwaysOn;

							click_area.data('maphilight', click_data).trigger('alwaysOn.maphilight');

							var region_value_array = [];
							var region_text_array = [];

							$('.regionenliste input:checked').each(function()
							{
								if($(this).val().indexOf(',') >= 0)
								{
									var southwest = $(this).val().split(',');

									$.each(southwest, function(index, value)
									{
										region_value_array.push(value);
									});
								}
								else
								{
									region_value_array.push($(this).val());
								}

								region_text_array.push($(this).parent('li').text());
							});

							if(region_value_array.length === 0)
							{
								$(this_select).find('span').text('Region (wahlweise)');

								$('.ortsliste li').show();

								if(!$('input.regionaler-zusatz').hasClass('city'))
								{
									$('input.regionaler-zusatz').val('');
								}
							}
							else
							{
								$('.ortsliste li').not(':first').hide();

								$('.ortsliste li').each(function()
								{
									if($.inArray($(this).find('input').attr('data-region'), region_value_array) >= 0)
									{
										$(this).show();
									}
								});

								$(this_select).find('span').text(region_text_array);

								if(!$('input.regionaler-zusatz').hasClass('city'))
								{
									$('input.regionaler-zusatz').val(region_value_array);
								}
							}

							if( typeof mapClick !== 'undefined' && mapClick == true )
							{
								mapClick = undefined;

								return false;
							}

							$(this_select).find('click').click();
						}
					}
					else
					{
						if($(this).text() == li_text)
						{
							$(this).attr('selected', 'selected');

							$(this).parent('select').val($(this).val());
							$(this).parent('select').change();

							$(this_select).find('span').text(li_text);

							$(this_select).find('click').click();
						}
					}
				});

				if ( $(this).find('input').val() == '74-ESPMSw73' ) {

					search_toggle = false;

					$(this_div).find('.select ul li input[value="91-ESPMSw90"]').parent('li').click();
				}

			});
		});

		$('.search-map area').click(function()
		{
			var area_text = $(this).attr('href');

			$('.regionenliste li').each(function()
			{
				if($(this).find('input').val() == area_text)
				{
					mapClick = true;

					$(this).click();
				}
			});

			return false;
		});