function oxGN2init(){
// Allgemeine "first" und "last" klassen, bei allen UL-Elementen
$("ul li:first-child").addClass('first');
$("ul li:last-child").addClass('last');
// Wenn man in das Suchfeld klickt, wird der Text automatisch geloescht
$('form.search input.textbox').click(function(){
$(this).attr('value',"");
});
///////////////////////////////////////////////////////////
// 2-COL Dropdown
///////////////////////////////////////////////////////////
var listOddMargin = 25; // Abstand zwischen den zwei Columns
var minListpoints = 3; // Mindestanzahl von Listenpunkten für Zweizeiligkeit
$('#navigation li ul').each(function(){
if( $(this).find('li').size() > minListpoints ){
$(this).addClass('dropdown-col2');
var dropDownCount = 0;
var dropDownWidth1 = 0;
var dropDownWidth2 = 0;
$(this).find('li').each(function(){
dropDownCount = (dropDownCount + 1) % 2;
if(dropDownCount > 0){ // odd
$(this).addClass('listCol-odd');
var liWidth = $(this).width() + 1;
if(liWidth > dropDownWidth1){ dropDownWidth1 = liWidth; }
} else { // even
$(this).addClass('listCol-even');
var liWidth = $(this).width() + 1;
if(liWidth > dropDownWidth2){ dropDownWidth2 = liWidth; }
}
});
$(this).find('li.listCol-odd').attr('style', 'width:'+dropDownWidth1+'px; margin: 0 '+listOddMargin+'px 0 0;');
$(this).find('li.listCol-even').attr('style', 'width:'+dropDownWidth2+'px; margin: 0;');
ulWidth = dropDownWidth1 + dropDownWidth2 + listOddMargin;
$(this).attr('style', 'width:'+ulWidth+'px; display: none; left: 0;');
} else {
$(this).attr('style', 'display: none; left: 0;');
}
}); 
///////////////////////////////////////
// NAVIGATION DROPDOWN SLIDE
///////////////////////////////////////
$('#navigation li').hoverIntent({
sensitivity: 3,
over: function(){ var dropdown = $(this).find('ul'); if(dropdown.size() > 0){ dropdown.slideDown(500); } },
out: function(){ var dropdown = $(this).parent().find('ul'); if(dropdown.size() > 0){ dropdown.slideUp(500); } }
});
///////////////////////////////////////
// ARTICLEBOX 
///////////////////////////////////////
$('ul.js-articleBox li').mouseover(function(){
var box = $(this).parent();
var img = $(this).find('div.articleBoxImage');
if(img.is(':hidden')){
box.find('div.articleBoxImage').slideUp();
box.find('li.active').removeClass('active');
$(this).addClass('active');
img.slideDown();
}
});
$('li.productData').hover(function(){
$(this).find('.listDetailsContainer').fadeIn(250);
}, function(){
$(this).find('.listDetailsContainer').fadeOut(250);
});
///////////////////////////////////////
// VIDEO CLICK SHOW/HIDE
///////////////////////////////////////
var vidDuration = 1000;  // Zeit fuer Ueberblendungen
$('ul.vids a').click(function(){
if( !($(this).parent().hasClass('active')) ){
var href = $(this).attr('href');
$('#media .youtubeVideo-layer').fadeIn(vidDuration);
$('#media .youtubeVideo').fadeOut(vidDuration);
$(href).fadeIn(vidDuration);
jQuery('#otherPictures ul li').removeClass('active');
jQuery(this).parent().addClass('active');
}
return false;
});
$('ul.pics a').click(function(){
jQuery('#otherPictures ul li').removeClass('active');
jQuery(this).parent().addClass('active');
$('#media .youtubeVideo').fadeOut(vidDuration);
$('#media .youtubeVideo-layer').fadeOut(vidDuration);
});
///////////////////////////////////////
// BASKET POPUP AUSBLENDEN
///////////////////////////////////////
if( $('#basketFlyout.newProdInBasket').size() > 0){
setTimeout('basketPopupFadeIn()', 1000);
setTimeout('basketPopupFadeOut()', 6000);
}
$('#basketFlyout.newProdInBasket .closePop').click(function(){
$('#basketFlyout.newProdInBasket').removeClass('newProdInBasket');
});
///////////////////////////////////////
// PLAIN POPUP
///////////////////////////////////////
$('.plainPopUp').fancybox({
'type' : 'iframe',
'width' : 650,
'height' : 500,
'scrolling' : 'yes',
'overlayShow' : true,
'centerOnScroll':true,
'autoScale' : false,
'hideOnOverlayClick' : true
});
///////////////////////////////////////
// iPHONE/iPOD KLICK BUGFIX
///////////////////////////////////////
if( isiPhone() ){
$('ul#navigation li ul li a').live('touchend', function(e) {
    var el = $(this);
    var link = el.attr('href');
    window.location = link;
});
}
///////////////////////////////////////
// WEITER BUTTON - PAYMENT SEITE
///////////////////////////////////////
$('#page.checkout-payment div.lineBox.top button').click(function(){
$('form#payment').submit();
});
}
function isiPhone(){
    return (
        (navigator.platform.indexOf("iPhone") != -1) ||
        (navigator.platform.indexOf("iPod") != -1)
    );
}
function basketPopupFadeIn(){
$('#basketFlyout.newProdInBasket').fadeIn(1000);
}
function basketPopupFadeOut(){
$('#basketFlyout.newProdInBasket').fadeOut(1000);
$('#basketFlyout.newProdInBasket').removeClass('newProdInBasket');
}
