if(navigator.appVersion.indexOf("MSIE 7")>-1){
document.write('<link rel="stylesheet" type="text/css" href="fileadmin/bos/style/ie7.css" />');
}else if(navigator.appVersion.indexOf("MSIE 6")>-1){
document.write('<link rel="stylesheet" type="text/css" href="fileadmin/bos/style/ie6.css" /> <script type="text/javascript" src="iepngfix_tilebg.js"></script><style type="text/css">img, div { behavior: url(iepngfix.htc) }</style>');
}else{
document.write('<link rel="stylesheet" type="text/css" href="fileadmin/bos/style/all.css" /> ');
}



jQuery(document).ready(
	function(){
	
		jQuery(".head_navigation ul li").hover(
			function(){
				var position = jQuery(this).position();
				jQuery(this).find("ul").show();
			},
			function () {
			jQuery(this).find("ul").hide();
			}
		);
		
    jQuery(".head_navigation ul li").each(
    function(){
      if( jQuery(this).next("ul").length ){
        jQuery(this).append( "<ul style='z-index:10'>"+jQuery(this).next("ul").html()+"</ul>" );
        jQuery(this).next("ul").remove();
      }
    }
  );	
  jQuery(".font_s").click( function(){
      jQuery("body").css({
        "font-size" : 12
      }) ;
  } );
   jQuery(".font_r").click( function(){
      jQuery("body").css({
        "font-size" : 14
      }) ;
  } );
  
   jQuery(".font_l").click( function(){
      jQuery("body").css({
        "font-size" : 16
      });
      
  } );
  

  
  jQuery(".send_email").click(
  function(){
  jQuery.get("ajax/email_senden.php",function(data){
    
  jQuery("#opener").html(data).dialog({
    title: "Seite empfehlen",
    modal:true,
    width : 400,
    height : 400,
    buttons : {
        "senden" : function(){
          //var anhang = jQuery("#formular_seite_senden").serialize();
          jQuery.get("ajax/formular_seite_senden.php",jQuery("#formular_seite_senden").serialize(),function(data){
                jQuery("#opener").dialog("close");
          });
        },
        
        "abbrechen" : function(){
          jQuery(this).dialog("close");
        }
      }
    });
  });
  });
  
  jQuery(".print").click(function(){
    window.print();
  });
  
  jQuery("#pro_style img").each(
    function(){
      jQuery(this).css({
        opacity : 0.4
      });
      
    }
  );
  
  jQuery("#pro_style a img").hover(
    function(e){
     
   
      var ide = jQuery(this).closest("a").attr("href").substring(13, 20);
    
     jQuery("#opener")
      .html(jQuery(".cont_left ul ul li[id*="+ide+"] a").html())
      .css({
        position : "absolute",
        top : e.pageY,
        left : e.pageX,
        "z-index" : 2,
        padding : 5,
        background : "#ffffff",
        border : "solid 1px #888"
      }).show();
    },
    function(){
       jQuery("#opener").hide();
    }
  );
  
  
  
  jQuery("#pro_style a[href*="+jQuery("#pageid").val()+"] img").css({
    opacity : 1
  });
  
  jQuery(".orthetiknav li").hover(
  function(){
    var wohin = jQuery(this);
    jQuery.get("ajax/ueberschriften.php",{pid : jQuery(this).attr("id")},function(data){
      if(data){
        wohin.append(data);
        wohin.find(".ueber:eq(0)").fadeIn();
        //jQuery(".ueber:eq(1)").remove();
      }
    });
  },
  function(){
    jQuery(this).find(".ueber").fadeOut();
  }
);

jQuery(".prothetiknav li").hover(
  function(){
    var wohin = jQuery(this);
    jQuery.get("ajax/ueberschriften.php",{pid : jQuery(this).attr("id")},function(data){
      if(data){
        wohin.append(data);
        wohin.find(".ueber:eq(0)").fadeIn();
        //jQuery(".ueber:eq(1)").remove();
      }
    });
  },
  function(){
    jQuery(this).find(".ueber").fadeOut();
  }
);
  
  jQuery(".orthetiknav li, .prothetiknav li").hover(
    function(){
    var ide = jQuery(this).attr("id").substring(2, 10);
      jQuery(".uebersicht_de a[href*="+ide+"] img").css({
        opacity : 1
      });
    },
    function(){
    jQuery(".uebersicht_de a img").css({
      opacity : 0.4
    });
    }
  );
   jQuery(".uebersicht_de a img").hover(
    function(){
    jQuery(".ueber").remove();
     var ide = jQuery(this).closest("a").attr("href").substring(13, 20);
     jQuery(".inhalt li[id*="+ide+"] a").css({
        "font-weight" : "bold"
      });
      jQuery.get("ajax/ueberschriften.php",{pid : ide},function(data){
      if(data){
        jQuery("#e_"+ide).append(data);
        jQuery("#e_"+ide+" .ueber:eq(0)").fadeIn();
        jQuery("#e_"+ide+" .ueber:eq(1)").remove();
        
      }
    });
      jQuery(this).css({
        opacity : 1
      });
    }, function(){
    
      jQuery(".inhalt li a").css({
        "font-weight" : "normal"
      });
      jQuery(this).css({
        opacity : 0.4
      });
      
    }
   );

   if( jQuery(".inhalt .content_bos").not(".standorte .content_bos").length > 1 ) {
   jQuery(".inhalt .content_bos").not(".standorte .content_bos").each(
    function(){
      var hohe = jQuery(this).height();
      if( hohe > 160 ){
      jQuery(this).append('<div class="more_balken"><span>weiterlesen</span></div>').css({
        height : 160
      }).click(
        function(){
        jQuery(".inhalt .content_bos").not(jQuery(this)).each(
          function(){
            var hohe2 = jQuery(this).height();
             if( hohe2 > 160 ){ 
              jQuery(this).animate({
                height : 160
              },300).find(".more_balken").fadeIn();
             }
          });
          jQuery(this).find(".more_balken").fadeOut();
          jQuery(this).animate({
            height:hohe
          },300);
        }
      );
      }
    }
   ); }
  
  
   jQuery("a[href$='AlleStandorte']").addClass("alleStandorte");
   jQuery("a[t3url='145']").addClass("backStandorte");
   jQuery(".inhalt p a").each(
    function(){
      if(jQuery(this).html()=="Wegbeschreibung"){
        jQuery(this).addClass("Wegbeschreibung")
      }
    }
   );
   
   jQuery("form[name=kontaktformular]").submit(
    function(){
      var wechsel = jQuery(this).closest("div");
      jQuery(this).find("input[rel=pruf],textarea[rel=pruf]").removeClass("alarm");
      jQuery(this).find("input[rel=pruf],textarea[rel=pruf]").each(
        function(){
          if( jQuery(this).val() == "" ){
            jQuery(this).addClass("alarm");
          }
        }
      );
      
      if(jQuery(this).find(".alarm").length){
        jQuery("#opener").html("Bitte f&uuml;llen Sie mindestens alle markierten Felder aus!").dialog({
          title : 'Achtung'
        });
      }else{
        jQuery.get("ajax/kontaktformular_senden.php?"+jQuery(this).serialize(),function(data){
          if(data){
            wechsel.html(data);
          }
        });
      }
      
      return false;
    }
   );
  jQuery(".alleStandorte").click(
    function(){
      jQuery(".tx-wecmap-pi2").dialog({
        title : 'BOS Standort&uuml;berblick',
        modal:true,
        width:530,
        height:570
      });
      return false;
    }
  ); 
  
  jQuery("a[rel*=lightbox]").each(
    function(){
      
      jQuery(this).append('<img src="fileadmin/bos/bilder/lupe.jpg" style="border:none;"/>');
    }
  );
  
  jQuery("ul, p").each(function(){
    jQuery(this).css({
    "text-align" : "left"
});
});
  
 jQuery(".bodytext").each(
  function(){
    if( jQuery(this).html().length<10 ){
      jQuery(this).remove();
    }
  }
 );
 
 if( jQuery("#sword").length ){
  var suchwort=jQuery("#sword").val();
  var suchwortg=jQuery("#sword").val();
  suchwortg = suchwortg.substr(0, 1).toUpperCase() + suchwortg.substr(1);
  suchwort = suchwort.substr(0, 1).toLowerCase() + suchwort.substr(1);
  
    jQuery(".csc-searchResultHeader a, .csc-searchResult").each(
  
      function(){
           var jetzt = jQuery(this).html();
           jQuery(this).html(jetzt.replace(suchwort, '<span class="csc-sword">'+suchwort+'</span>'));
           
           var jetztneu = jQuery(this).html(); 
           jQuery(this).html(jetztneu.replace(suchwortg, '<span class="csc-sword">'+suchwortg+'</span>'));
      }
    );
  
    } 


 jQuery(".csc-textpic-imagewrap").each(
  function(){
   jQuery( this ).find("a[rel*=lightbox]:first").closest(".csc-textpic-image").show();
  }
 );
 jQuery(".inhalt .contenttable").each(
    function(){
        jQuery(this).closest(".content_bos").css({
        margin : 0
    })
    }
);
	}// ende document ready
);

