(function($) {
	$.fn.emailencode = function(options) {
		var settings = jQuery.extend({
			atsign: "(klammeraffe)"
		}, options);

		return this.each(function() {
			var address = $(this).attr("href");
			var formatedAddress = address.replace(settings.atsign, "@");
			$(this).attr("href", "mailto:" + formatedAddress);
		});
	};
})(jQuery);

jQuery(document).ready(function () {
  // obfuscate email
  $(".mailto").emailencode();
  // rightclick
  $(document).bind("contextmenu",function(e){
    return false;
  });
  // selectable
  $.fn.unselectable = function() {
    return this.each(function() {
      $(this)
        .css('-moz-user-select', 'none')                // FF
        .css('-khtml-user-select', 'none')              // Safari, Google Chrome
        .css('user-select', 'none');                    // CSS 3
      if ($.browser.msie) {                             // IE
        $(this).each(function() {
          this.ondrag = function() { return false; };
        });
        $(this).each(function() {
          this.onselectstart = function() {
            return (false);
          };
        });
      } else if($.browser.opera) {
        $(this).attr('unselectable', 'on');
      }
    });
   };
  $('#main').unselectable();
  //show content
  jQuery('#content0').show();
});

function showContent (nmb) {
  jQuery('.content').hide(0, function() {
    jQuery('#content' + nmb).show();
  });
}

function showqrvcard() {
  if (!($('#qrvcard').is(':visible'))) {
    myoffset = $('#qrvcard_thumb').offset();
    myleft = myoffset.left - 158;
    mytop = myoffset.top;
    $('#qrvcard').css('left', myleft);
    $('#qrvcard').css('top', mytop);
    $('#qrvcard').css({cursor: 'none'});
    $('#qrvcard').show();
  }
}

function hideqrvcard() {
  $('#qrvcard').hide();
}

