

Cufon.replace('h2', {
    color: '#014260',
    fontSize : '20px'
});

Cufon.replace('.text h1', {
	
	color: '#014260',
    	fontSize : '28px'
});


Cufon.replace('.slider .boxtext', {
	
	color: '#333333',
    	fontSize : '14px'
});

Cufon.replace('.slider .fusslink', {
	
	color: '#014260',
    	fontSize : '14px'
});

$(function() {
    
    $('#jsliderbig').jcarousel({
        
        scroll : 1,
        wrap : "last"
    });
});

$(function() {
    
    $('#jslidermini').jcarousel({
        
        scroll : 1,
        auto : 5,
        wrap : "last"
    });
});

var hovercheck = true;
var t;

$(function() {
    
    $('.lihover').hide();
    
    if (!IE6 && !IE7)
    var overlay = $('#layoutrahmen').prepend('<div id="overlay"></div>');
    
    var IE6 = false;
    var IE7 = false;
    
    if($.browser.msie && $.browser.version=="6.0") IE6 = true;
    if($.browser.msie && $.browser.version=="7.0") IE7 = true;
    
    $('#sum_541 li').mouseenter(function() {
          
          var pid_str = $(this).attr("id");
          var pid = pid_str.split("p").join("");
          
          if (pid){
            
            hovercheck = true;
            
            t = window.setTimeout(function() {
              
                if (hovercheck){
                  
                  show_overlay(pid);
                }
                else
                {
                  clearTimeout(t);
                }
                
            }, 200);
            
          }
          else
          {
              $('#p'+ pid +' .lihover').html("");
              $('.lihover').hide();
              $('#overlay').hide();
              hovercheck = false;
              clearTimeout(t);
          }
            
    }). mouseleave(function() {
        
        hovercheck = false;
        clearTimeout(t);
        
        var pid_str = $(this).attr("id");
        var pid = pid_str.split("p").join("");
        
        //maus geht vom link runter
        $('#p'+ pid +' .lihover').html("");
        $('.lihover').hide();
        $('#overlay').hide();
    });
    
    
    function show_overlay(pid){
          
      var url = coreurl+"httprequest.php?_k="+ kunde +"&tiefe="+ tiefe +"&go_target=navigation_hover_show&punkt_id="+ pid;
      
      $.ajax({ 
          url: url, 
          cache: true,
          success: function(data) {
              
              if (data){
                
                //bg abdunkeln
                //$('#overlay').css ({opacity:0.3});
                
                if (!IE6 && !IE7){
                  
                  $('#overlay').show();
                  
                  var w = $("#kontentwrap").width() + 20;
				  var h = $("#layoutrahmen").height() - 415;
                  
                  $('#overlay').css ({
                      
                      display: 'block',
                      width: w,
                      height: h,
                      top : "415px"
                  });
                }
                
                
                $('#sum_541 #p'+ pid +' .lihover').show();
                $('#sum_541 #p'+ pid +' .lihover').html(data);
              }
          }
      }); 
    }
    
    
    //Sprache
    //karte zeigen
    $('#chooselink').click(function() {
        
        $('#karte').css ({opacity:0}).animate({opacity:1}, 500);
        
        $('#karte').css ({
            
            display: 'block',
            width: $("#karte").width(),
            height: $("#karte").height()
        });
    });
    
    $('.kartepoint .showlink').click(function() {
        
        $('.adresse').hide();
        
        var x = $(this).parent().css('left');
        var y = $(this).parent().css('top');
        
        x = parseInt(x.split("px").join(""));
        y = parseInt(y.split("px").join(""));
        
        newx = (x + 9) + 'px';
        
        var versatz = $(this).parent().next('.adresse').height();
        
        if (y + versatz > 300)
        {
          newy = (y - versatz) + 'px';
        }
        else
        {
          newy = (y + 9) + 'px';
        }
        
        $(this).parent().next('.adresse').css({ top : newy, left : newx });
        $(this).parent().next('.adresse').toggle('fast');
        
        return false;
    });
    
    $('.closelink').click(function() {
        
        $('.adresse').hide();
        return false;
    });
    
    
    
    
});

