
  
	function gross(cont_h) { 
				 var wgross= $(window).height();
			
			      $("#drei").css('height', wgross - 575); // 675
				  $(".scroll").css('height', wgross - 575);  //675
				  $("#inhalt").css('height', wgross - 22);  
				  if ((page=="") || (page=="start")) {$("#all_content").css('height', wgross - 100); }
				   else {
				     if (cont_h < wgross) {temp=wgross;} else {temp=cont_h + 30 ;}
					 $("#all_content").css('height', temp); 
					 
				   }
				   
				   
				 } 
			
				
			$(document).ready(function(){ 
			
			    $('#head_links1_2').hide();
			 	if ($.cookie("logok")!="" && $.cookie("logok")!=null)  $('#head_links1_2').show();
 
            	
				$("ul.sf-menu").supersubs({ 
					minWidth:    12,   // minimum width of sub-menus in em units 
					maxWidth:    23,   // maximum width of sub-menus in em units 
					extraWidth:  2     // extra width can ensure lines don't sometimes turn over 
									   // due to slight rounding differences and font-family 
				}).superfish();  // call supersubs first, then superfish, so that subs are 
								 // not display:none when measuring. Call before initialising 
								 // containing tabs for same reason. 
								 
				
			   $('.spalte1').vTicker({
				   speed: 1700,
				   pause: 6000,
				   showItems: 5,
				   mousePause: true,
				   direction: 'up',
				   height: 100
				});
				
				 $('.spalte2').vTicker({
				   speed: 1700,
				   pause: 6000,
				   showItems: 5,
				   mousePause: true,
				   direction: 'up',
				   height: 100
				});
				
				 $('.spalte3').vTicker({
				   speed: 1700,
				   pause: 6000,
				   showItems: 5,
				   mousePause: true,
				   direction: 'up',
				   height: 100
				});
				
				
				var cont_h = $(document).height();
				gross(cont_h);				 								 
			    $(window).resize(function(){gross(cont_h)});
			  
			   
						   
			   
				$("#in_suche").focus(function() {
			        $(this).filter(function() {
			         	return $(this).val() == "" || $(this).val() == "<? echo $tx_site_sitesuche; ?>"
			        }).removeClass("watermarkOn").val("");
				});
			
				$("#in_suche").blur(function() {
					$(this).filter(function() {
						return $(this).val() == ""
					}).addClass("watermarkOn").val("<? echo $tx_site_sitesuche; ?>");
                });
				$("#in_suche").mouseover(function() {
			        $(this).filter(function() {
			         	return $(this).val() == "" || $(this).val() == "<? echo $tx_site_sitesuche; ?>"
			        }).removeClass("watermarkOn").val("");
				});
			
			    $("#in_suche").mouseout(function() {
					$(this).filter(function() {
						return $(this).val() == ""
					}).addClass("watermarkOn").val("<? echo $tx_site_sitesuche; ?>");
                });
			
				$("#bt_such").click(function(){
				   document.cookie = 'suche=' + $("#in_suche").val() ;
				   document.location='find.html' ;
			       //document.forms["suchen"].submit();
   			    });
				
				
				$("#head_rechts").click(function(){
				  document.location='index.php' ;
				});
				$("#head_rechts").mouseover(function(){
				  this.style.cursor = 'pointer' ;
				});
				$("#head_rechts").mouseout(function(){
				  this.style.cursor = 'auto' ;
				});
	
	
	       $('#bilderwechsel').innerfade({
				speed: 'slow',
				timeout: 5000,
				animationtype: 'fade', // fade, slide
				type: 'random_start'        // random, random_start, sequence
			});

	       $('.textrahmen').css('visibility', 'visible'); 
	
	       
		   $(".pdf_datei").click(function(){
		     pdf=$(this).attr("pdf");
			 logja=$(this).attr("log");
			 datname=db_feld("pdf","filename","id=" + pdf);
			  logok=$.cookie("logok");
			  gast=$.cookie("gast");
			 if (file_exist("pdf/" + datname + ".pdf")=="true")
			  {  if (logja=="0" || logok=="ok")
				   { gastdown(pdf,gast,"<? echo $_SESSION['sprache']; ?>",datname);
				     fenster=window.open("pdf/" + datname + ".pdf"); 
				   }
				  else
				   {  $('#logja').click(); }
			   } 
			   else alert('<? echo $tx_file; ?>');	   
		   });
	
	
	$('#logja').fancybox({

	            'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'autoDimensions'	: true,
				'width'				: 300,
				'height'			: 290,
				'href'				: 'phps/logja.php',
				'centerOnScroll'    : 'true',
				'type'              : 'iframe',
				'onClosed'			: 
				      function(){
					    logok=parent.document.getElementById("templog").value;
						gast=parent.document.getElementById("gast").value;
					    $.cookie("logok",logok); 
						$.cookie("gast",gast);
					  }
			});		
			
	
	$('#daten').fancybox({
	            'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'autoDimensions'	: true,
				'width'				: 350,
				'height'			: 600,
				'href'				: 'phps/meinedaten.php',
				'centerOnScroll'    : 'true',
				'type'              : 'iframe'
			});	
			
	
	$('#datenneu').fancybox({
	            'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'autoDimensions'	: true,
				'width'				: 350,
				'height'			: 615,
				'href'				: 'phps/meinedatenneu.php',
				'centerOnScroll'    : 'true',
				'type'              : 'iframe'
			});	
				
	
   $('#meinedaten').click(function(){
      $('#daten').click();
   });
   
   $('#abmelden').click(function(){
     document.getElementById("templog").value="";
	 document.getElementById("gast").value="";
	 $.cookie("logok","");
	 $.cookie("gast","");
	 $('#head_links1_2').hide();
   });
   
   
   
	
	function db_feld(db,feld,bed){ 
   
         var wert = $.ajax({ async:false,
        		             type: "POST",
 						     url:  "intern/ajax/db_feld.php?<? echo SID; ?>",
							 data: "&db=" + db + "&feld=" + feld + "&bed=" + bed,
							 dataType: "html"
				 }).responseText;	
		 return wert;	   
	};
	

	
	
	function file_exist(filename){
         file="../../" + filename;
		  var wert= $.ajax({async:false,
					type: "POST",
					url:  "intern/ajax/fileexist.php?<? echo SID; ?>",
					data: "file=" + file ,
					dataType: "html"
					}).responseText;	
		  return (wert);
	};
	
	
	function gastdown(pdf,gast,sp,file){
        var wert =  $.ajax({async:false,
				type: "POST",
				url:  "intern/ajax/gastdown.php?<? echo SID; ?>",
				data: "pdf=" + pdf + "&gast=" + gast + "&sp=" + sp + "&file=" + file,
				dataType: "html"
			   }).responseText;	
			  
		 //return wert;	
	};
	
	
			}); 

           
