jQuery(document).ready(function(){
   
	document.getElementById('nlOpen').href = "#"
   var viewportwidth;
 var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }

	sliderposition = (viewportwidth/2)-490
	breite = 980+(viewportwidth-980)/2
	abstand = ((viewportwidth-980)/2)+20
	posOut = "560"
	posIn = "0"
	document.getElementById('kontaktbox').style.top = "-"+posOut+"px"
	
	
   
   
   jQuery('#nlClose').click(function(event) {
	jQuery('#kontaktbox')
	 .animate(
	  { top: -posOut }, {
	   duration:400,
	   easing: 'easeOutCirc'
	  })
   document.getElementById('nlClose').style.display = "none"
	});
   
   
   jQuery('#nlOpen').click(function(event) {
	actualPosition=document.getElementById('kontaktbox').style.top
	
	
	if (actualPosition=="0px") {
		jQuery('#kontaktbox')
	 .animate(
	  { top: posIn }, {
	   duration: 400,
	   easing: 'easeOutCirc' }
		
	  )
	 document.getElementById('nlClose').style.display = "none"
	 }
	 
	 else {
		 jQuery('#kontaktbox')
	 .animate(
	  { top: 0 }, {
	   duration: 400,
	   easing: 'easeOutCirc' }

	  )
	 document.getElementById('nlClose').style.display = "block"
	 }
	 
	 
   });


if(document.getElementById('meldung')!=null) {
	document.getElementById('kontaktbox').style.top = "0px";}


});
