$(document).ready(function() {
						   
						
	function browserHeight() {

			outer = $('#outercontent').height();


					inneraccum = $('#rightbottomline').offset().top + 51;
					$('.outertable').css("height", inneraccum);


				if($('#rightbottomline').offset().top >= $('#bottomline').offset().top) {
					inneraccum = $('#rightbottomline').offset().top + 51;
					$('.outertable').css("height", inneraccum);
				} else if($('#bottomline').offset().top >= $('#rightbottomline').offset().top) {
					inneraccum = $('#bottomline').offset().top + 51;
					$('.outertable').css("height", inneraccum);
				}


			
			if($('#bottomline').offset().top < $(window).height() && $('#rightbottomline').offset().top < $(window).height()){
				
				$('.outertable').css("height", $(window).height());
				
				hallo = document.body.offsetHeight;
				
				
				
			}

		
	}
	
	$(window).resize(function(){
		browserHeight();
	});
	
	
	browserHeight();
	
	
	
	$('.menulist').find('li:eq(4)').css('margin-top', 19);
	
	
	
	$(".commentbutton").hover(function() {
		
		$(this).removeClass('commentnormal').addClass('commenthover');
		
	},function(){
		$(this).removeClass('commenthover').addClass('commentnormal');
	});
	
	
	

	var inputfieldtext = $(".inputfield").attr('value');
	$(".inputfield").focus(function () {
		
		
		if($(this).attr('value') == inputfieldtext) {		
         $(this).attr('value', '');
		}
				
         
    });

	
	$(".inputfield").blur(function () {
									
		if($(this).attr('value') == undefined) {		
         $(this).attr('value', inputfieldtext);
		}
    });
	

	
	$(".productlink").hover(function() {
		
		$(this).find('span').removeClass('productlinknormal').addClass('productlinkhover');
		
	},function(){
		$(this).find('span').removeClass('productlinkhover').addClass('productlinknormal');
	});
	
	
	
	$(".writecomments").hover(function() {
		
		$(this).removeClass('productlinknormal').addClass('productlinkhover');
		
	},function(){
		$(this).removeClass('productlinkhover').addClass('productlinknormal');
	});
	
	

	
    $(".commentbutton").mousedown(function () { 
      $(this).removeClass('commenthover').addClass('commentclick');
	  

	  if( $(this).parent().parent().find('.commentcontainer').hasClass('displaycomments') ){
		  
		 $(this).parent().parent().find('.commentcontainer').removeClass('displaycomments').addClass('hidecomments');
		 $(this).removeClass('commentminus').addClass('commentplus');
		 
		 
		 
	  } else if( $(this).parent().parent().find('.commentcontainer').hasClass('hidecomments') ){
		  
		 $(this).parent().parent().find('.commentcontainer').removeClass('hidecomments').addClass('displaycomments');
		 $(this).removeClass('commentplus').addClass('commentminus');
		 
	  }
	  
	  
	  
	  browserHeight();
		 
		
	  
	  
	  
    });
	
    $(".commentbutton").mouseup(function () { 
      $(this).removeClass('commentclick').addClass('commenthover');
    });
    
  $(".writetip").mousedown(function () { 
      $(this).removeClass('writetip').addClass('writetipclick');
    });
   $(".writetip").mouseup(function () { 
      $(this).removeClass('writetipclick').addClass('writetip');
    });
    
  $(".writetip").click(function() {
  	$("#writetip").show();
	$("#thankyoutip").hide();
  	$(this).parent().parent().find('.hiddenfield').removeClass('hidecomments').addClass('displaycomments');
  	$(this).parent().parent().find('.hiddenfield').css('top', $(this).offset().top - 320);
		 $(this).parent().parent().find('.hiddenfield').css('left', $(this).offset().left - 400);
		return false;
	});


	$(".writecomments").click(function() {

		
	  if( $(this).parent().parent().find('.hiddenfield').hasClass('displaycomments') ){
		 $(this).parent().parent().find('.hiddenfield').removeClass('displaycomments').addClass('hidecomments'); 
	  } else if($(this).parent().parent().find('.hiddenfield').hasClass('hidecomments') ){
  
  
  
  
	
		 $(this).parent().parent().find('.hiddenfield').css('top', $(this).offset().top - 250);
		 $(this).parent().parent().find('.hiddenfield').css('left', $(this).offset().left - 300);
	
  

  
  
  
		for(var i=0; i<= $('.writecommentopen').size()-1; i++) {
			$('.hiddenfield:eq('+i+')').removeClass('displaycomments').addClass('hidecomments');
		}
		
		$(this).parent().parent().find('.hiddenfield').removeClass('hidecomments').addClass('displaycomments');
		
	  }
		browserHeight();
		
		 
			
	});
	
	
	
	$(".closecommentbox").hover(function() {
		
		$(this).removeClass('closecommentnormal').addClass('closecommentover');
		
	},function(){
		$(this).removeClass('closecommentover').addClass('closecommentnormal');
	});
	
	
	$(".closecommentbox").click(function() {
		 $(this).parent().parent().parent().parent().find('.hiddenfield').removeClass('displaycomments').addClass('hidecomments'); 
		 
 
	});
	
	
	$(".logolink").click(function() {
		 document.location="/"; 
	});
	
	
	
	
	
	
	
	$(".mailbutton").hover(function() {
		
		$(this).removeClass('mailbuttonnormal').addClass('mailbuttonhover');
		
	},function(){
		$(this).removeClass('mailbuttonhover').addClass('mailbuttonnormal');
	});





	$(".afmeldbutton").hover(function() {
		
		$(this).removeClass('afmeldbuttonnormal').addClass('afmeldbuttonhover');
		
	},function(){
		$(this).removeClass('afmeldbuttonhover').addClass('afmeldbuttonnormal');
	});



	$(".backforward").hover(function() {
		
		$(this).removeClass('backforwardnormal').addClass('backforwardhover');
		
	},function(){
		$(this).removeClass('backforwardhover').addClass('backforwardnormal');
	});










 var blank = new Image();
 blank.src = '/1image/1x1spacer.gif';
 
 $(document).ready(function() {
   var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
   if (badBrowser) {
	
	//$('.newslettercontent').css("background-image", "none").css("filter", "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/1image/rightsidecontent.png', sizingMethod='scale')");
   
	   
     // get all pngs on page
     $('img[src$=.png]').each(function() {
       if (!this.complete) {
         this.onload = function() { fixPng(this) };
       } else {
         fixPng(this);
       }
     });
   }
 });
 
 function fixPng(png) {
   // get src
   var src = png.src;
   // set width and height
   if (!png.style.width) { png.style.width = $(png).width(); }
   if (!png.style.height) { png.style.height = $(png).height(); }
   // replace by blank image
   png.onload = function() { };
   png.src = blank.src;
   // set filter (display original image)
   png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
 }

});