// JavaScript Document

$(document).ready(function()
{	

	if ( $(document).width() < 1008 && $(document).width() > 720 )
	{
		$('#MaxWidth').css({'width':'auto'});
	}
	if ( $(document).width() <  720 )
	{
		$('#MaxWidth').css({'width':'720px'});
	}

	// console.info('START');
	// correct missleading root page from ssl.zs-l.de
	if( self.location.protocol == 'https:')
	{
		// console.debug('HTTPS');
		// console.debug("Aktueller Pfad: " + self.location.pathname);
		var parts = self.location.pathname.split('/');
		// console.debug(parts);
		$('a[href|="/"]').attr('href', 'http://' + parts[1]);
	}
	
	// Page: uid = 384 - PETITION
	/* 
	if( $('#b384').length )
	{
		var counterHtml = '<div id="counter"></div>' ;
		counterHtml    += '<h5 style="margin: 0 -3px; text-align: center;">... haben die e-Petition bereits gezeichnet.</h5>'
		$('#RechteSpalte').prepend(counterHtml);		
		$.get('counter.php', function(data) {
		  $('#counter').html(data);		  
		});
	}
	*/
	
	/* Manipulate mailform formular */
	$('div.csc-mailform-field input[type="checkbox"]').parent('div').removeClass('csc-mailform-field').addClass('jq-csc-mailform-checkbox-row');
	$('div.csc-mailform-field input[type="submit"]').parent('div').removeClass('csc-mailform-field').addClass('jq-csc-mailform-submit');
	$('.jq-csc-mailform-checkbox-row:first').css({'padding-top':'1.5em'});

});
