/**
**/
/*** DESIGNSTUFF ***/
sizeme = function(){
$('#holder').css({height:'auto'});
$('#content').css({height:'auto'});
if($('#holder:not(.start) #content').height()<$('body').height()-172){
$('#holder:not(.start) #holder').css({height:$('body').height()});
$('#holder:not(.start) #content').css({background:'#fff',height:$('body').height()-172});
}
if($('#holder.start #content').height()<$('body').height()-370){
$('#holder.start #holder').css({height:$('body').height()});
$('#holder.start #content').css({background:'#fff',height:$('body').height()-370});
}
}
$(document).ready(function(){sizeme();});
$(window).resize(sizeme);
/*** BACKLINKS ***/
$(document).ready(function(){
$('a.back').click(function(){
history.back();
return false;
});
});
/*** GLOSSAR ***/
$(document).ready(function(){
function showLetter(l){
$('table#alphabet').find('td.letter a:not(:contains('+l+'))').removeClass('active');
$('table#alphabet').find('td.letter a:contains('+l+')').addClass('active');
if(l=='all'){
$('#glossar').children('li').fadeIn();
window.location.hash='';
return;
}
l = l.toLowerCase().substr(0,1);
if(l==''){
l = 'a';
}
var cls = '.glossar-'+l;
//if($('#glossar').children('li'+cls).length){
$('#glossar').children('li').hide();
$('#glossar').children('li'+cls).fadeIn();
window.location.hash='#'+l;
//}
}
$('table#alphabet').find('td.letter a').click(function(){
// $('table#alphabet').find('td.letter a').removeClass('active');
$(this).addClass('active');
showLetter($(this).html());
return false;
});
$('table#alphabet').find('td.all').click(function(){
showLetter('all');
});
if($('table#alphabet').length>0){
showLetter('a');
}
if($('table#alphabet').length>0){
showLetter('a');
$('td.letter a:first').addClass('active');
}
});
/**** PRODUKTE ****/
$(document).ready(function(){
var pg = 1;
if($('#productlist').length){
$('.products_info .clearer').before('
');
var newDiv = $('');
$('#productlist').children('li').each(function(i,e){
$(newDiv).append(e);
if((i+1)%3==0){
$('#productlist').append(newDiv);
newDiv = $('');
}
});
if($(newDiv).children().length>0)
$('#productlist').append(newDiv);
function showPage(n){
if(n>=$('#productlist').children('div').length){
n=$('#productlist').children('div').length;
}
if(n<=1){
n=1;
}
if($('#productlist').children('div').length>1){
$('.page').parent().show();
}
$('.showall').css({fontWeight:'normal'});
$('.showfirst').css({fontWeight:'bold'});
pg = n;
if(n==$('#productlist').children('div').length){
$('.next').css({visibility:'hidden'});
}else{
$('.next').css({visibility:'visible'});
}
if(n==1){
$('.prev').css({visibility:'hidden'});
}else{
$('.prev').css({visibility:'visible'});
}
$('.page').html('page '+n+' of '+$('#productlist').children('div').length);
window.location.hash='#'+n;
$('#productlist').children('div:not(nth-child('+n+'))').hide();
$('#productlist').children('div:nth-child('+n+')').show();
}
function showAll(){
window.location.hash='#all';
$('.page').parent().hide();
$('.showall').css({fontWeight:'bold'});
$('.showfirst').css({fontWeight:'normal'});
$('#productlist').children('div').show();
}
$('#productlist').children('div:not(:first)').hide();
$('.prev').css({visibility:'hidden'});
if($('#productlist').children('div').length<=1){
$('.next').hide();
$('.page').parent().hide();
}
var sp = window.location.hash.replace(/#/g,'');
if(sp=='all'){
showAll();
}else{
showPage(sp);
}
$('.showall').click(function(){
showAll();
return false;
});
$('.showfirst').click(function(){
showPage(1);
return false;
});
$('.next').click(function(){
pg++;
showPage(pg);
return false;
});
$('.prev').click(function(){
pg--;
showPage(pg);
return false;
});
showAll();
}
});
/*** STARTPAGE HEADER ***/
$(document).ready(function(){
var i = 1;
$('#startrota').children('li:not(:first)').hide();
$('#startrota').find('div').hide();
function showText(){
$('#startrota').children('li').hide();
var curr = $('#startrota').children('li:nth-child('+i+')');
$(curr).show();
$(curr).find('div:first').fadeIn({
duration:1000,
complete:function(){
$(this).next('div').fadeIn({
duration:1000,
complete:function(){
$('#startrota').animate(
{
opacity:1
},{
duration:2000,
complete:function(){
showText();
}
});
}
});
}
});
i++;
}
showText();
});
/*** GALLY ***/
$(document).ready(function(){
//$('#headpic').parent().css({height:$('#headpic').height()});
$('#headpic').load(function(){
//$('#headpic').parent().css({height:$('#headpic').height()});
//$(this).hide();
$(this).animate({opacity:1});
});
$('.rt_gally li a').click(function(){
if($('#headpic').attr('src')!=$(this).attr('href')){
$('#headpic').css({opacity:0});
$('#headpic').attr({src:$(this).attr('href')});
$('.rt_gally .inf').hide().html($(this).children('p').html()).fadeIn();
}
return false;
});
});
$(document).ready(function(){
var oldtext = $('input.text').val();
$('input.text').focus(function(){
if($(this).val()==oldtext){
$(this).val('');
}
});
$('input.text').blur(function(){
if($(this).val()==''){
$(this).val(oldtext);
}
});
});
/****** DROPDOWNS ************/
$(document).ready(function(){
$('.dd').css({position:'relative'});
$('a.selectbox, a.searchbox').each(function(i,e){
$(e).data('oldtxt',$(e).html());
});
$('.dd ul')
.css({position:'absolute',zIndex:99,left:0,top:$('.dd a:first').height()})
.hide();
$('.dd>a').click(function(){
$('.dd ul.open').not($(this).next('ul')).removeClass('open').fadeOut();
$(this).parents('ul.open').removeClass('open').fadeOut();
if(!$(this).next('ul').hasClass('open')){
$(this).next('ul').addClass('open').fadeIn();
}else{
$(this).next('ul').removeClass('open').fadeOut();
}
return false;
});
});
/**** BERICHTE ***/
$(document).ready(function(){
$('.berichte').hide();
$('.selectcol li a,.searchcol li a').click(function(){
$('.branchhide').hide();
$('.berichte').hide();
$(this).parents('ul').hide();
$(this).parents('ul').prev('a').html($(this).html());
if($('.'+$(this).attr('id')).length>0){
$('.branchnores').hide();
}else{
$('.branchnores').fadeIn();
}
$('.'+$(this).attr('id')).fadeIn();
});
});
$(document).ready(function(){
function showResult(res){
var obj = JSON.parse(res);
var cls = (obj.res).toString();
$('.branchhide').hide();
$('.berichte').hide();
$(this).parents('ul').hide();
if($(cls).length>0 && cls!=''){
$('.branchnores').hide();
}else{
$('.branchnores').fadeIn();
}
$(cls).fadeIn();
return false;
}
$('.searchcol .text').focus(function(){
$('.dd ul.open').fadeOut().removeClass('open');
$('.selectcol, .searchcol').removeClass('active');
$(this).parent('.searchcol').addClass('active');
});
$('.searchcol .submit').click(function(){
$('.dd ul.open').fadeOut().removeClass('open');
$('.selectcol, .searchcol').removeClass('active');
$(this).parent('.searchcol').addClass('active');
if($(this).prev('input').val()!=''){
$.post('/index.php?id=21', {q:escape($(this).prev('input').val())}, showResult, "text");
}
});
});
$(document).ready(function(){
$('a.selectbox.dl').click(function(){
$('.dd ul.open').fadeOut().removeClass('open');
$('.selectcol, .searchcol').removeClass('active');
$(this).parent('.searchcol, .selectcol').addClass('active');
$('a.selectbox,a.searchbox').each(function(i,e){
$(e).html($(e).data('oldtxt'));
});
$(this).html($(this).attr('rel'));
$('.branchhide').hide();
$('.berichte').hide();
var cls = $(this).attr('id').toString();
cls = '.'+cls;
if($(cls).length>0){
$('.branchnores').hide();
}else{
$('.branchnores').fadeIn();
}
$(cls).fadeIn();
});
$.getScript('http://www.google-analytics.com/ga.js',
function() {
var pageTracker = _gat._getTracker("UA-16012675-1");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
});
});