jQuery(function() {
	//alert("t");
	//jQuery('.a2a_dd').css({'padding-left': '23' + 'px'});
	fix_height();
	jQuery(".styleswitch").click(function() {
		fix_height();
	});
	
	jQuery(window).scroll(function() {
		fix_height();
	});
});



jQuery (function() {
if ( jQuery(window).width() < 1200){
jQuery('.sim-box h4 a').css({'font-size': '14' + 'px'});
//alert (jQuery(window).width());
home_box_height = Math.round(jQuery(window).width()*0.20);
prod_group_box_height = Math.round(jQuery(window).width()*0.35);
jQuery('.box-home').css({'height': home_box_height + 'px'});
jQuery('.prod-group-box').css({'height': prod_group_box_height + 'px'});
jQuery('.prod-group').css({'height': (prod_group_box_height * 0.78) + 'px'});
jQuery('#infobox').css({'top': '235' + 'px'});
jQuery('.bl').css({'margin-bottom': '5' + 'px', 'display' : 'block'});
}
});




function fix_height() {
	jQuery("#nav").css("height", (jQuery("#mc-inner").height() + jQuery("#mc-inner").offset().top + 150) + "px");
	
// 	alert("fixing");
}

jQuery(function() { 
	new_width = Math.round(jQuery(window).width()/2);
	if ( jQuery(window).width() > 1300){new_width = Math.round(jQuery(window).width()/2.5);}
	jQuery(".top-slider")./*width(new_width).*/attr("width", new_width);

smallwidth = Math.round(jQuery(".prod-pic-bottom").width()/6.2);
smallheight =  Math.round( smallwidth *0.67);;
jQuery(".lightbox-enabled img").each(function() { 
jQuery(this).attr("src", jQuery(this).attr("src").replace("h=90", "h=" + smallheight));
jQuery(this).attr("src", jQuery(this).attr("src").replace("w=133", "w=" + smallwidth));
});
	
jQuery(function() { 
jQuery('#mail-us').replaceWith('<a title="Sie haben Fragen zum Thema Treppenlift? Schreiben Sie uns!" id="mail-us" href="mailto:info@ktt-technik.de">info@ktt-technik.de</a>');
});



jQuery("img").each(function() { 
	
	if(jQuery(this).attr("src").search("timthumb") > -1) {
		
		var the_height = parseInt(jQuery(this).attr("src").match(/h=([0-9]+)/)[1]);
		var the_width = parseInt(jQuery(this).attr("src").match(/w=([0-9]+)/)[1]);
		
		var factor = 1200 / the_width;
		
		single_large_width  = Math.round(jQuery(window).width()/factor);
		single_large_height =  Math.round( the_height * single_large_width / the_width);
		
		jQuery(this).attr("src", jQuery(this).attr("src").replace(/h=([0-9]+)/, "h=" + single_large_height));
		jQuery(this).attr("src", jQuery(this).attr("src").replace(/w=([0-9]+)/, "w=" + single_large_width));
		
		jQuery(this).height(single_large_height).width(single_large_width);
		
		fix_height();
	}
});
});








