jQuery(document).ready(function() {


	//jQuery('.product_images_carousel').jcarousel({
	//	auto: 2,
	//	scroll: 1,
    //	wrap: 'circular'
    //});

	jQuery(".images_thumbnails li:nth-child(3n)").addClass("end_of_row");

	if (jQuery(".content_presentation:first .cp_images li").length > 1) {
		jQuery(".content_presentation:first .cp_images").jCarouselLite({
			auto: 3000,
			speed: 1500,
			visible: 1
		});
	}

	jQuery("li.page_navigation_active").parentsUntil("ul.special_list").addClass("active_branch");
	jQuery("ul.special_list li:not(.active_branch)").addClass("inactive_branch");
	jQuery("li.page_navigation_active").removeClass("inactive_branch").addClass("active_branch");
	jQuery("li.page_navigation_active").siblings().removeClass("inactive_branch").addClass("active_branch");
	jQuery("li.page_navigation_active").parent().parent().siblings().removeClass("inactive_branch").addClass("active_branch");
});



/**
 * Carousel
 */


// jQuery(document).ready(function() {
// 	jQuery('.images_carousel').jcarousel({
// 		auto: 5,
// 		scroll: 1,
// 		wrap: 'circular',
// 	});
// });


/**
 * UI
 */


jQuery(document).ready(function() {

	/**
	 * Filter
	 */

	jQuery("#immo_features .filter .filter_params").buttonset();
	jQuery("#immo_features .filter .filter_param input:checkbox").button();
	

	//jQuery("#immo_features .filter").addClass("yui3-g");
	//jQuery("h3, .params, .button.search", "#immo_features .filter").addClass("yui3-u");

	//jQuery("#immo_features .filter .params").addClass("yui3-g");
	//jQuery("#immo_features .filter .param").addClass("yui3-u");

	jQuery("#immo_features .filterby input:submit").button();


	jQuery(".page_button", ".immo_results").buttonset();
	jQuery(".page_button a, span.act", ".immo_results").button();
	


	/**
	 * Sorting
	 */
	
	jQuery("select", "#immo_features .sorting_container").selectmenu({style:'dropdown'});

	jQuery(".sorting_radio", "#immo_features .sorting_container").buttonset();

	jQuery("a.button.sort", "#immo_features .sorting_container").button();

	/**
	 * Immo. Objects
	 */
	
	jQuery("a.button", ".object_info_segment").button();


	

	// .tx_powermail_pi1_formconfirmation_back,
	// .tx_powermail_pi1_formconfirmation_submit,
	// .tx_powermail_pi1_fieldwrap_html_submit {

	// 	input {

	/**
	 * Search
	 */

	jQuery("input.tx-indexedsearch-searchbox-button").button();
	

	/**
	 * Sitemap
	 */

	var wrapstr = '<div class="sitemap-column yui3-u" />';
	jQuery("#page-25 .cs_text #c85").wrap('<div class="sitemap-column sitemap-left yui3-u" />');
	jQuery("#page-25 .cs_text #c576").wrap('<div class="sitemap-column sitemap-middle yui3-u" />');
	jQuery("#page-25 .cs_text #c577").wrap('<div class="sitemap-column sitemap-right yui3-u" />');

	jQuery("#page-25 .sitemap-column").wrapAll('<div class="sitemap-container yui3-g" />');


	/**
	 * Top-Color-Line
	 */
	var content_stage_bg = jQuery(".content_stage_color").css('backgroundColor');
	

	if(content_stage_bg) {
		jQuery(".microsite #page_body #page_body_header").css('borderBottomColor', content_stage_bg);
	}


	/**
	 * Remove links 
	 */

	jQuery(".mietwohnungen-section .pfd_form_links #gewerbeflaeche").remove();
	jQuery(".gewerbeflaechen-section .pfd_form_links #wohnung").remove();



	jQuery(".mietwohnungen-section #immo_links #rental_unit").addClass("active");
	jQuery(".gewerbeflaechen-section #immo_links #commercial_space").addClass("active");
	jQuery(".specials-section #immo_links #specials").addClass("active");

	/**
	 * powermail
	 */

	// jQuery(".tx_powermail_pi1_fieldwrap_html_button, .tx_powermail_pi1_fieldwrap_html_submit").removeClass("tx_powermail_pi1_fieldwrap_html");
	// jQuery(".tx_powermail_pi1_fieldwrap_html_button, .tx_powermail_pi1_fieldwrap_html_submit").wrapAll('<div class="field-buttons yui3-g"/>');
	// jQuery("div, .field-buttons).addClass('yui3-g');

	/* jQuery(".tx-srfreecap-pi2-image,span.tx-srfreecap-pi2-cant-read,div.tx_powermail_pi1_fieldwrap_html_captcha_description", ".tx_powermail_pi1_fieldwrap_html").wrapAll('<div class="cpt-req yui3-u"/>'); */

	jQuery(".tx_powermail_pi1_fieldwrap_html").addClass("yui3-g");
	jQuery(".tx_powermail_pi1_fieldwrap_html label").addClass("yui3-u");
	jQuery(".tx_powermail_pi1_fieldwrap_html .realtypow").addClass("yui3-u");
	jQuery(".tx_powermail_pi1_fieldwrap_html input").addClass("yui3-u");
	jQuery(".tx_powermail_pi1_fieldwrap_html textarea").addClass("yui3-u");

	jQuery(".tx-srfreecap-pi2-image,span.tx-srfreecap-pi2-cant-read,div.tx_powermail_pi1_fieldwrap_html_captcha_description", ".tx_powermail_pi1_fieldwrap_html").wrapAll('<div class="cpt-req yui3-u"/>');
	jQuery(".tx-srfreecap-pi2-image", ".tx_powermail_pi1_fieldwrap_html").after('<br />');
		/* tx-srfreecap-pi2-cant-read */

	jQuery("#powermaildiv_uid28").removeClass("yui3-g");
	

	jQuery(".tx_powermail_pi1_fieldwrap_html_button input, .tx_powermail_pi1_fieldwrap_html_submit input").wrapAll('<div class="yui3-g rh-form-buttons"/>');;

	
	jQuery(".rh-form-buttons input").button();
	//jQuery("input.powermail_submit_uid3").button();
	jQuery("input.tx-powermail-pi1_confirmation_back").button();
	jQuery("input.tx-powermail-pi1_confirmation_submit").button();
	jQuery("input.tx-powermail-pi1_mandatory_submit").button();
	
	

});




