//Funktion  um die Randspalten-Breite an das Browserfenster anzupassen

function adjust_window() {
  var width = jQuery(document).width();
  var height = jQuery(document).height();
	colWidth = (width - 845)/2;
  if (colWidth > 394) { colWidth = 394 }
  
  if (width < 830) {
    attribute = 'none';
    jQuery("#bg_right").css("display", attribute );
    jQuery("#bg_left").css("display", attribute );  
  }
  else {
    attribute = 'block';
    jQuery("#bg_right").css("width", colWidth );
    jQuery("#bg_left").css("width", colWidth );
    //$("#bg_right").css("height", height );
    //$("#bg_left").css("height", height );
    jQuery("#bg_right").css("display", attribute );
    jQuery("#bg_left").css("display", attribute ); 
  }
} 

$(document).ready(adjust_window);
$(window).resize(adjust_window);

$(document).ready(function() {
	$('#page48 form div.imgButton').hide();
	$('<p class="error-text" style="color:red;">Sie m&uuml;ssen mindestens 18 jahre alt sein, um sich f&uuml;r den Newsletter anzumelden.</p>').prependTo('form p.infotext');
	$('p.error-text').hide();
	
	$('#page48 input[name="opt_2"]').keyup(function(){
		if (!(/^\d*$/.test($(this).val()))) $(this).val('');
		if ($(this).val().length > 1)
		{
			if (parseInt($(this).val()) < 18)
			{
				$('#page48 form div.imgButton').fadeOut('fast');
				$('p.error-text').fadeIn('fast');
			}
			else
			{
				$('p.error-text').fadeOut('fast');
				$('#page48 form div.imgButton').fadeIn('fast');
			}
		}
	});
	
	$('#page48 input[name="opt_2"]').keyup();
	
});