function dominit() {

/* --------------------------------------------------- Highlight Cheffe in Kommentaren */

$('.comments strong').each(function(i){
	var string = $(this).text().substring(0,10);
	if ((string == "S. Stiener") || (string == "Stefan Sti") || (string == "Velotraum.")) {
		$(this).parent().addClass('chef');
	}
});

/* --------------------------------------------------- Haendlerliste sortieren */

$("#haendler").tablesorter({sortList: [[0,0]]}); 

/* --------------------------------------------------- Exzerpt Paragraph fett */

$('.newsarticle').each(function(i) {
	var firstpara = $(this).find('p')[1];
	$(firstpara).addClass('first');
});


/* --------------------------------------------------- Suchergebnisse: Textkorrektur */

var sh = $('#searchheadline')[0];
if ($(sh).text() == "1 Suchergebnisse") { $(sh).text("1 Suchergebnis"); }
if ($(sh).text() == "0 Suchergebnisse") { $(sh).text("Kein Suchergebnis"); }

/* --------------------------------------------------- Kundengalerie: Linie vor Paginierung */

$('#kundengalerie > div.konzeptpaging').prev().addClass('last');

/* --------------------------------------------------- Headline h1 ist unten bündig, yay! */

myh1 = $('#content > h1:first-child')[0];
blogh1 = $('#content > div:first-child h1')[0];
if ($(myh1).height() > 40) {
	$(myh1).css('padding-top','1.65em')
};
if ($(blogh1).height() > 40) {
	$('.startpage #content').css('padding-top','5.85em')
};

/* --------------------------------------------------- Viewport-Vermessung */

if ($('body').width() < 1053) {
	$('body').addClass('slimscreen');
} else {
	$('body').addClass('widescreen');
}
if ($('body').width() < 1053) {
	$('body').addClass('slimscreen');
} else {
	$('body').addClass('widescreen');
}

/* --------------------------------------------------- Inputfelder Texteingabe */
loginboxtext = "";
$('#search input.text').focus(function(){ 
	loginboxtext = this.value;
	this.value = "";
}).blur(function(){
	if (this.value == "") { 
		this.value = loginboxtext; 
	}
});

/* --------------------------------------------------- Einrückung bei einigen Absätzen (nicht allen) */

$('p + p').not('div.newsarticle p + p, p.teaser + p').addClass('follow-p');


/* --------------------------------------------------- Dynamische Bildleiste */

var images = [];
$("#headerimages img").each(function(i) {		
	images.push(this.src);
});
$("#headerimages *").remove();
$('#headerimages').prepend('<div id="slot1"></div><div id="slot2"></div>');
showimg(images, false, "1");

function showimg(images, exclude, slot) {
  do { nr = Math.floor(Math.random()*images.length); } while (nr == exclude);
  $('#slot'+slot).append('<img src="'+images[nr]+'" alt="" />').hide().fadeIn(1800).delay(3000).fadeIn(1, function(){
    if (slot == "1") { newslot = "2"; } else { newslot = "1"; }
    showimg(images, nr, newslot);
  }).fadeOut(2500, function(){
    $(this).find('img').remove();
  });
}
  
/* old flash version - uncool!
$("#headerimages").prepend("<div id='replaceImages'></div>");

var flashvars = { pic: images };
var params = { wmode: "transparent" };
var attributes = false;
swfobject.embedSWF("/flash/leiste.swf", "replaceImages", "450", "120", "8.0.0","/flash/expressInstall.swf", flashvars, params, attributes);
}
*/

/* --------------------------------------------------- Hauptnavigation */

globalclick = false;

$('body').click(function(){
	if (!globalclick) {
		$('#nav-main > li').removeClass('active');
	}
	globalclick = false;
});

$('#nav-main > li > span').click(function(){
	globalclick = true;
	var myparent = $(this).parent();
	$('#nav-main > li').not(myparent).removeClass('active');
	$(myparent).toggleClass('active');
});

$('#nav-main a, #content, #sidebar').click(function(){
	globalclick = true;
});

$('#menu_modelle ul').before('<ul class="sub1 hidden"></ul><ul class="sub2 hidden"></ul>').find('li').each(function(i){
	if (i < 7) { 
		$(this).appendTo('#menu_modelle .sub1');
	} else {
		$(this).appendTo('#menu_modelle .sub2');
	}
});
$('#menu_modelle ul:last-child').remove();



/* --------------------------------------------------- Bildergalerie */


if ($('.dhonishow').length == 1) {


links = $('.dhonishow a');
images = $('.dhonishow img');

dhonis = new Array();

$.each(images, function(i, value){
	dhonis[i] = new Object();
	dhonis[i]['src'] = value.src;
	dhonis[i]['title'] = value.title;
	dhonis[i]['alt'] = value.alt;
	dhonis[i]['height'] = value.height;
	dhonis[i]['width'] = value.width;
});

$.each(links, function(i, value){
	dhonis[i]['href'] = value.href;
});

number = dhonis.length;

$('.dhonishow').empty().append('<ul class="dhonishow-element"><li></li></ul><div class="dhonishow-navi"><h3></h3><div class="dhonishow-picture-alt"></div></div>');

if (number > 1) { 
	$('.dhonishow .dhonishow-navi').append('<a title="Nächstes Bild" class="dhonishow-next-button">Nächstes Bild</a><p class="dhonishow-paging"></p><a title="Voriges Bild" class="dhonishow-previous-button">Voriges Bild</a>');
}

$('.dhonishow-next-button').click(function(){
	currentpic += 1;
	if (currentpic == (number-1)) {
		$('.dhonishow-next-button').hide();
	} else {
		$('.dhonishow-next-button').show();
	}
	$('.dhonishow-previous-button').show();
	showpic(currentpic);
});

$('.dhonishow-previous-button').click(function(){
	currentpic -= 1;
	if (currentpic == 0) {
		$('.dhonishow-previous-button').hide();
	} else {
		$('.dhonishow-previous-button').show();
	}
	$('.dhonishow-next-button').show();
	showpic(currentpic);
});

function showpic(i) {
	$('.dhonishow-element li').empty().append('<a href="'+dhonis[i]['href']+'" class="thickbox'+i+'" rel="galerie"><img src="' + dhonis[i]['src'] + '" title="'+dhonis[i]['alt']+'" width="' + dhonis[i]['width'] + '" height="' + dhonis[i]['height'] + '" /><span></span></a>');
	$('.dhonishow-navi h3').empty().append(dhonis[i]['alt']);
	//$('.dhonishow-picture-alt').empty().append(superTextile(dhonis[i]['title']));
	$('.dhonishow-picture-alt').empty().append(dhonis[i]['title']);
	tb_init('.thickbox'+i);
}


currentpic = 0;
$('.dhonishow-previous-button').hide();
showpic(0);


}



}