/**
 * Script to resize the text and images of the page
 * @author coster UTILO www.utilo.eu
 */

/**
 * set the bigger height of an element
 * @param elment the element to set the height
 */
 

 
 //alert(navigator.appName);
function biggerHeight(element){
	
	element.css({
      	  height: function(index, value) {
      				return parseFloat(value) * 1.3;
      			 }
    });
	
}
/**
 * set the bigger width of an element
 * @param element the element to set the width
 */
function biggerWidth(element){
	
	element.css({
	      width: function(index, value) {
        			return parseFloat(value) * 1.3;
      			 }
    });
	
}
/**
 * set the bigger height and width of an element
 * @param element the element to get bigger
 */
function biggerWidthHeight(element){
	
	biggerHeight(element);
	biggerWidth(element);
	
}
/**
 * set bigger font sizes
 */
function biggerFont(){
	
	$('h1').css({
	      'font-size': function(index, value) {
			return parseFloat(value) * 1.3;
		  }
	});
	$('div#menu ul li a').css({
	      'font-size': function(index, value) {
		return parseFloat(value) * 1.3;
	  }
	});
	
	$('h2').css({
	      'font-size': function(index, value) {
			return parseFloat(value) * 1.3;
		  }
	});
	
	$('h3').css({
	      'font-size': function(index, value) {
			return parseFloat(value) * 1.3;
		  }
	});
	
	$('h3').css({
	      'line-height': function(index, value) {
			return parseFloat(value) * 1.3+'px';
		  }
	});
	
	$('h4').css({
	      'font-size': function(index, value) {
			return parseFloat(value) * 1.3;
		  }
	});
	
	$('h5').css({
	      'font-size': function(index, value) {
			return parseFloat(value) * 1.3;
		  }
	});
	
		$('div#menu2 ul li a').css({
	      'font-size': function(index, value) {
		return parseFloat(value) * 1.3;
	  }
	});
	
	$('div#menu ul li b').css({
	      'font-size': function(index, value) {
		return parseFloat(value) * 1.3;
	  }
	});
	
	$('div#menu2 ul li b').css({
	      'font-size': function(index, value) {
		return parseFloat(value) * 1.3;
	  }
	});
	
	$('.label').css({
	      'font-size': function(index, value) {
		return parseFloat(value) * 1.3;
	  }
	});
	
	$('.label_long').css({
	      'font-size': function(index, value) {
		return parseFloat(value) * 1.3;
	  }
	});
	
	$('.radio_label').css({
	      'font-size': function(index, value) {
		return parseFloat(value) * 1.3;
	  }
	});
	
	$('.knopf input').css({
	      'font-size': function(index, value) {
		return parseFloat(value) * 1.3;
	  }
	});
	
	$('#main_left table').css({
	      'font-size': function(index, value) {
		return parseFloat(value) * 1.3;
	  }
	});
	
	$('.overview-news p').css({
	      'font-size': function(index, value) {
		return parseFloat(value) * 1.3;
	  }
	});
	
}
/**
 * set normal font sizes
 */
function smallerFont(){
	
	$('h1').css({
	      'font-size': function(index, value) {
			return parseFloat(value) / 1.3;
		  }
	});
		
	$('h2').css({
	      'font-size': function(index, value) {
			return parseFloat(value) / 1.3;
		  }
	});
	
		$('h3').css({
	      'font-size': function(index, value) {
			return parseFloat(value) / 1.3;
		  }
	});
	
		$('h3').css({
	      'line-height': function(index, value) {
			return parseFloat(value) / 1.3+'px';
		  }
	});
	
		$('h4').css({
	      'font-size': function(index, value) {
			return parseFloat(value) / 1.3;
		  }
	});
	
		$('h5').css({
	      'font-size': function(index, value) {
			return parseFloat(value) / 1.3;
		  }
	});
	
	$('div#menu ul li a').css({
	      'font-size': function(index, value) {
		return parseFloat(value) / 1.3;
	  }
	});
	$('div#menu2 ul li a').css({
	      'font-size': function(index, value) {
		return parseFloat(value) / 1.3;
	  }
	});
	
	$('div#menu ul li b').css({
	    'font-size': function(index, value) {
		return parseFloat(value) / 1.3;
	  }
	});
	$('div#menu2 ul li b').css({
	      'font-size': function(index, value) {
		return parseFloat(value) / 1.3;
	  }
	});
	
	$('.label').css({
	      'font-size': function(index, value) {
		return parseFloat(value) / 1.3;
	  }
	});
	
	$('.label_long').css({
	      'font-size': function(index, value) {
		return parseFloat(value) / 1.3;
	  }
	});
	
	$('.radio_label').css({
	      'font-size': function(index, value) {
		return parseFloat(value) / 1.3;
	  }
	});
	
	$('.knopf input').css({
	      'font-size': function(index, value) {
		return parseFloat(value) / 1.3;
	  }
	});
	
	$('#main_left table').css({
	      'font-size': function(index, value) {
		return parseFloat(value) / 1.3;
	  }
	});
	
	$('.overview-news p').css({
	      'font-size': function(index, value) {
		return parseFloat(value) / 1.3;
	  }
	});
	
}
/**
 * set normal width of an element
 * @param element the element to set the normal width
 */
function smallerWidth(element){
	
	element.css({
	      width: function(index, value) {
        			return parseFloat(value) / 1.3;
      			 }
    });
	
}
/**
 * set the normal height of an element
 * @param element the element to set the normal height
 */
function smallerHeight(element){
	
	element.css({
      	  height: function(index, value) {
      				return parseFloat(value) / 1.3;
      			 }
    });
	
}
/**
 * set the normal width and height of an element
 * @param element the element to set the normal width and height
 * @return
 */
function smallerWidthHeight(element){
	
	smallerWidth(element);
	smallerHeight(element);
	
}
/**
 * set the default styles for page
 */
function setNormalStyle(){

function deletecook()
{
    var d = new Date();
    document.cookie = "@@bigstyle@@;expires=" + d.toGMTString() + ";" + ";";

    //alert(document.cookie);
}

deletecook();

	
	//link entfernen um nicht nochmals vergroessern zu koennen:
	$('#biggerStyle').show();
	$('#normalStyle').hide();
	
	//container vergroessern
	$('#containerRight').css('height','677px');
	$('#container').css('height','677px');
	$('#containerRight').css('width','923px');
	$('#container').css('width','923px');	
	smallerWidth($('#container_bottom'));
	
	//header vergroessern
	smallerWidth($('#header'));
	smallerWidthHeight($('#menu'));
	smallerWidthHeight($('#menu2'));
	
	//main Bereich vergroessern
	smallerWidthHeight($('#main'));
	smallerWidthHeight($('#main_left'));
	smallerWidthHeight($('#main_right'));
	smallerWidthHeight($('.change'));
	
	//Kontaktformular
	smallerWidthHeight($('.defbreite'));
	smallerWidthHeight($('.defbreite_big'));
	
	//text bereich vergroessern
	smallerHeight($('#txt1'));
	smallerWidthHeight($('#picUeberschrift'));
	smallerWidthHeight($('#notdienstImage'));
	smallerFont();

	//bild links vergroessern
	//das Bild links muss immer die id="mainLeftImg" besitzen
	smallerWidthHeight($('#mainLeftImg'));
	smallerWidthHeight($('.mainLeftImg'));
	smallerWidthHeight($('.main_left_big'));
	smallerWidthHeight($('.main_right_small_text'));
	smallerWidthHeight($('.overview-news'));
	smallerWidthHeight($('#artweger-small img'));
	smallerWidthHeight($('#geberit-small img'));
	smallerWidthHeight($('.box img'));
	smallerWidthHeight($('.video img'));
	
	//einzelne anpassungen die nicht dynamisch erzeugt werden koennen:
	//schatten unten tauschen:
	$('#menu2').css('background','url(./pics/navi_verlauf_2.jpg)');
	$('#menu').css('background','url("./pics/navi_verlauf_1.jpg") repeat-y scroll right center transparent');
	$('#header').css('background','url("./pics/header.jpg") no-repeat scroll right center transparent');
	$('#container_bottom').css('background','url(./pics/shadow_bottom.png) no-repeat scroll 0 0 transparent');
	$('#bottom_line').css('height','20px');
	$('#bottom_lineSmall').css('height','20px');
	$('#bottom_line').css('background','url("./pics/footer_verlauf_right_two.jpg") no-repeat scroll center bottom transparent');
	$('#bottom_lineSmall').css('background','url("./pics/footer_verlauf_right_two_small.jpg") no-repeat scroll center bottom transparent');
	$('#bottom_line').css('height','19px');
	$('#bottom_lineSmall').css('height','19px');
	$('#kontaktfeldright').css('height','448px');
	$('.level0').css('height','22px');
	$('.level1').css('height','22px');
	$('#main_right').css('width','497px');
	$('#main').css('width','904px');
	$('#notdienst').css('width','100px');
	$('#bottom_line').css('margin-top','2px');
	$('#bottom_lineSmall').css('margin-top','2px');
	$('.nivo-caption h3').css('font-size','20px');
	$('.nivo-caption h4').css('font-size','16px');
	if(navigator.appName != 'Microsoft Internet Explorer') {
		$('#solar').css('width','497px');
		$('#solar').css('height','504px');

	}
	
	else {	
		$('#solar').css('width','496px');
		$('#solar').css('height','500px');
		$('#menu').css('height','22px');
		$('#menu2').css('height','22px');
		$('#bottom_line').css('height','20px');
		$('#bottom_line').css('margin-top','1px');
		$('#bottom_lineSmall').css('height','20px');
		$('#bottom_lineSmall').css('margin-top','1px');
		$('#main_right_small_text').css('width','297px');
	}


}
/**
 * scale the text and images to an bigger style
 */
function setBigStyle(){

	var ablauf = new Date();
	var infuenfTagen = ablauf.getTime() + (5 * 24 * 60 * 60 * 1000);
	ablauf.setTime(infuenfTagen);
	document.cookie = "@@bigstyle@@; expires=" + ablauf.toGMTString();

	
	//link entfernen um nicht nochmals vergroessern zu koennen:
	$('#biggerStyle').hide();
	$('#normalStyle').show();
	
	//container vergroessern
	$('#containerRight').css('height','841px');
	$('#container').css('height','841px');
	$('#containerRight').css('width','1194px');
	$('#container').css('width','1194px');	
	biggerWidth($('#container_bottom'));
	
	//header vergroessern
	biggerWidth($('#header'));
	biggerWidthHeight($('#menu'));
	biggerWidthHeight($('#menu2'));
	
	//main Bereich vergroessern
	biggerWidthHeight($('#main'));
	biggerWidthHeight($('#main_left'));
	biggerWidthHeight($('#main_right'));
	biggerWidthHeight($('.change'));
	
	//Kontaktformular
	biggerWidthHeight($('.defbreite'));
	biggerWidthHeight($('.defbreite_big'));
	
	//text bereich vergroessern
	biggerHeight($('#txt1'));
	biggerWidthHeight($('#picUeberschrift'));
	biggerWidthHeight($('#notdienstImage'));
	biggerFont();

	//bild links vergroessern
	//das Bild links muss immer die id="mainLeftImg" besitzen
	biggerWidthHeight($('#mainLeftImg'));
	biggerWidthHeight($('.mainLeftImg'));
	biggerWidthHeight($('.main_left_big'));
	biggerWidthHeight($('.main_right_small_text'));
	biggerWidthHeight($('.overview-news'));
	biggerWidthHeight($('#artweger-small img'));
	biggerWidthHeight($('#geberit-small img'));
	biggerWidthHeight($('.box img'));
	biggerWidthHeight($('.video img'));
	
	//einzelne anpassungen die nicht dynamisch erzeugt werden koennen:
	//schatten unten tauschen:
	$('#menu2').css('background','url(./pics/navi_verlauf_2_big.jpg)');
	$('#menu').css('background','url("./pics/navi_verlauf_1_big.jpg") repeat-y scroll right center transparent');
	$('#header').css('width','1174px');	
	$('#header').css('background','url("./pics/header_big.jpg") no-repeat scroll right center transparent');
	$('#container_bottom').css('background','url(./pics/shadow_bottom_big.png) no-repeat scroll 0 0 transparent');
	$('#bottom_line').css('height','35px');
	$('#bottom_lineSmall').css('height','35px');
	$('#kontaktfeldright').css('height','583px');
	$('#notdienst').css('width','145px');
	$('#koordination').css('width','200px');
	$('#kleinesbad').css('width','190px');
	$('#bottom_line').css('margin-top','11px');
	$('#bottom_lineSmall').css('margin-top','11px');
	$('#solaroel').css('width','283px');
	$('#pumpe').css('width','237px');
	$('#solar').css('width','646px');
	$('#solar').css('height','654px');
	$('.level0').css('height','28px');
	$('.level1').css('height','28px');
	$('#unserteam').css('width','99px');
	$('#normalStyle').css('padding','0');
	$('#bottom_line').css('background','url("./pics/footer_verlauf_right_big.jpg") no-repeat scroll center bottom transparent');
	$('#bottom_line').css('height','27px');
	$('#bottom_lineSmall').css('background','url("./pics/footer_verlauf_right_big.jpg") no-repeat scroll center bottom transparent');
	$('#bottom_lineSmall').css('height','27px');	
	$('.nivo-caption h3').css('font-size','20px');
	$('.nivo-caption h4').css('font-size','16px');
	
	if(navigator.appName != 'Microsoft Internet Explorer') {
		$('#bottom_line').css('margin-top','10px');
		$('#bottom_lineSmall').css('margin-top','10px');

	}
	
	else {	
		$('#bottom_line').css('margin-top','11px');
		$('#bottom_lineSmall').css('margin-top','11px');
	}
	
}

$(document).ready(function() {
var a = document.cookie;
var cookiewert = a.split('@@');
var wert = cookiewert[1];
//alert(a);
//alert(wert);
     if(wert == "bigstyle") {
	//alert('Cookie gesetzt');
	setBigStyle();
 }
});

