fb = (window.console && window.console.firebug) ? 1 : 0;
debug = 0;

$(document).ready(function(){
	if (fb && debug) console.log('init');
	
  $('#social').html('<p><a href="http://www.mister-wong.de/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fwww.renehornig.com&amp;bm_description=Webdesign+Berlin" class="external" rel="nofollow" title="Bookmarken bei Mister Wong"><img src="http://static.renehornig.net/img/social/wong.gif" width="20" height="20" alt="" title="" /></a><a href="http://www.oneview.de/quickadd/neu/addBookmark.jsf?URL=http%3A%2F%2Fwww.renehornig.com&amp;title=Webdesign+Berlin" class="external" rel="nofollow" title="Bookmarken bei Oneview"><img src="http://static.renehornig.net/img/social/oneview.gif" width="20" height="20" alt="" title="" /></a><a href="http://www.folkd.com/submit/http://www.renehornig.com" class="external" rel="nofollow" title="Bookmarken bei folkd.com"><img src="http://static.renehornig.net/img/social/folkd.gif" width="20" height="20" alt="" title="" /></a><a href="http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.renehornig.com&amp;title=Webdesign+Berlin" class="external" rel="nofollow" title="Bookmarken bei del.icio.us"><img src="http://static.renehornig.net/img/social/delicious.gif" width="20" height="20" alt="" title="" /></a><a href="http://linkarena.com/bookmarks/addlink/?url=http%3A%2F%2Fwww.renehornig.com&amp;title=Webdesign%20Berlin&amp;desc=Freier%20Webdesigner%20aus%20Berlin.%20Bietet%20Gestaltung%20und%20Entwicklung%20von%20Internetseiten.&amp;tags=Webdesign,%20Berlin,%20Freelancer,%20CSS,%20Internet,%20Internetseite,%20erstellen,%20gestalten,%20Gestaltung,%20Homepage" class="external" rel="nofollow" title="Bookmarken bei LinkARENA"><img src="http://static.renehornig.net/img/social/linkarena.gif" width="20" height="20" alt="" title="" /></a></p>');
  
  $('#footer #cp').append('<p id="enth">Für Web-Enthusiasten:<a href="http://validator.w3.org/check?uri=http://www.renehornig.com/" class="external" rel="nofollow" title="Verweis zum W3C Validator">valide Strukturen</a>und <a href="http://jigsaw.w3.org/css-validator/validator?uri=http://static.renehornig.net/css/rh.css&amp;profile=css3" class="external" rel="nofollow" title="Verweise zum W3C CSS Validator">Style</a></p>');
  $('#footer #prom').append('<p class="xing"><p class="fb"><a name="fb_share" type="button" share_url="http://www.renehornig.com/" href="http://www.facebook.com/sharer.php">Teilen</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></p>');
	
	
	$('body').removeClass('nojs');
	
	
	if($('#wentries-more').length > 0) {
		
		$('#wentries-more .entry .im dl a img').each(function(){
			$(this).before('<div class="zoom"></div>');
		});
		
		$('#wentries-more .entry .im dl a').fancybox({
		  'padding': 5,
			'hideOnContentClick': true,
			'zoomOpacity'			: true,
			'overlayShow'			: false,
			'zoomSpeedIn'			: 700,
			'zoomSpeedOut'			: 600,
			'imageScale': false,
			'centerOnScroll' : false,
			'easingIn'				: 'easeOutBack',
			'easingOut'				: 'easeInBack'      
		}); 
		
	}
	
	var $old_ie = false;
  if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 7) {
    	$old_ie = true;
  };
  
  if($old_ie) {
    $('#hnav li').each(function(){
  	  $(this).hover(
  	    function(){
  	      $(this).find('ul').css({'display': 'block'});
  	    },
  	    function(){
  	      $(this).find('ul').css({'display': 'none'});
  	    }
  	  );
  	});
  }

  if(!$old_ie) {
    $('#hnav li ul').css({'border':'0 none'});
    $('#hnav li').hover(
      function(){
        $(this).find('ul').slideDown(200).fadeIn(500,function(){
          $(this).dropShadow({left: 2, top: 2, opacity: 0.1, blur: 2});
        })
      },
      function(){
        $(this).find('ul').removeShadow();
        $(this).find('ul').fadeOut(300);
      }
    );
  }
  
  
  $('#hnav li').children().each(function(){
    $(this).removeAttr('title');
    $(this).find('acronym').removeAttr('title');
    $(this).find('abbr').removeAttr('title');
  });

  
  $('#mnav a').each(function(){
    $(this).removeAttr('title');
  })
	
	
	
	
	
	if($('#thumbs').length > 0) {
		var thmbs = $('#thumbs img');		

		var view = $('#detailview img');
		var viewdefsrc = view.attr('src');

		thmbs.each(function() {			
			
			$(this).wrap("<div class=\"im\"></div>");
			
			$(this).bind('mouseenter',function() {
				view.attr({src: $(this).attr('src')});
				if(fb && debug) console.log('enter');
			});
			
			$(this).bind('mouseleave',function() {
				view.attr({src: viewdefsrc});
				if(fb && debug) console.log('leave');
			});

		});
	}
	
});