var TimeSettings = new Array(); var MainnavigationTime = 300; var arrHomeNewsTeaser = new Array(); var intHomeNewsTeaserKey = 1; var arrHomeTeaser = new Array(); var intHomeTeaserKey = 1; function openCam (address) { if (hasRightFlashVersion) { camView = window.open(address,'_blank', 'width=640,height=588,left=100,top=200'); camView.focus(); } else { camView = window.open(address + '?noflash=true','_blank', 'width=640,height=588,left=100,top=200'); camView.focus(); } } function shadowboxOpen(pstrPage) { Shadowbox.open({ content: '/_public/child.php?thissite=/' + pstrPage, player: "iframe", title: "", height: 600, width: 800 }); return false; } $(function() { $('.radiobuttonPayment').change(function() { strPayment = $(this).attr('value'); if(strPayment == 'creditcard') { $('#showCreditCard').show(); } else { $('#showCreditCard').hide(); } }); $('#submitPayment').click(function() { $('#paymentData').submit(); }); $('#submitCustomer').click(function() { $('#customerData').submit(); }); $('#showDeliveryAddress').toggle( function() { $('#deliveryAddress').show(); $(this).attr('src','/images/de/buttons/shop/buttons_lieferadresse_nicht.png'); $('#delivery').attr('value',1); }, function() { $('#deliveryAddress').hide(); $(this).attr('src','/images/de/buttons/shop/abweichende_lieferadresse.png'); $('#delivery').attr('value',0); } ); $('.shopAddToCart').click(function() { intProductId = $(this).attr('id'); //alert(intProductId); //return false; }); $('.shopBaskerSelect').change(function() { strId = $(this).attr('id'); $('#changeitem').attr('value',strId); $('#basket').submit(); }); $('.labeled').each( function() { var objInput = $(this); var objParent = objInput.parent(); var strLabel = objInput.attr('label'); var strName = objInput.attr('name'); var strId = objInput.attr('id'); var strOutput = ''; objParent.prepend(strOutput); var objLabel = objParent.children('label'); if (objInput.attr('value')== '') { objLabel.css('display','inline'); } $('#label'+strId).click( function() { $(this).css('display','none'); $('#'+strId).focus(); }) objInput.focus( function() { objLabel.css('display','none'); }); objInput.blur( function() { if (objInput.attr('value')== '') { objLabel.css('display','inline'); } else { objLabel.css('display','none') } }); }); $('.stopplay_media').click(function() { var objPlayMedia = $(this); var objButtons = objPlayMedia.next('div#mediabuttons'); var objPlus = objButtons.children('div#media_plus'); var objMinus = objButtons.children('div#media_minus'); var objInfo = objButtons.next('div#mediainfo'); objInfo.children('div#showmore').toggle(); objPlus.toggle(); objMinus.toggle(); }); $('div#mediainfo').click(function() { var objMedia = $(this); var objButtons = objMedia.prev('div#mediabuttons'); var objPlus = objButtons.children('div#media_plus'); var objMinus = objButtons.children('div#media_minus'); objMedia.children('div#showmore').toggle(); objPlus.toggle(); objMinus.toggle(); }); $('div#mediabuttons').click(function() { var objMedia = $(this); var objButtons = $(this).children(); var objInfo = objMedia.next('div#mediainfo'); objButtons.toggle(); objInfo.children('div#showmore').toggle(); }); $('.BtnOver').hover( function() { $(this).attr('src', $(this).attr('over')); }, function() { $(this).attr('src', $(this).attr('out')); } ); $('a.SliderLink').click( function() { thisSliderBox = $(this).parent('div.SliderBox'); thisSliderContainer = thisSliderBox.parent('div.SliderContainer'); boolSlideDown = true; if (thisSliderBox.hasClass('OpenedSlider')) { boolSlideDown = false; } thisSliderContainer.children('div.OpenedSlider').each( function() { $(this).children('div.SliderContent').hide( ); $(this).removeClass('OpenedSlider'); $(this).addClass('ClosedSlider'); $(this).children('a.SliderLink').children('img').attr('src','/images/SliderArrowClosedSlider.gif'); }) if (boolSlideDown) { thisSliderBox.addClass('OpenedSlider'); thisSliderBox.removeClass('ClosedSlider'); $(this).children('img').attr('src','/images/SliderArrowOpenedSlider.gif'); thisSliderBox.children('div.SliderContent').show( ) } }); $('select.designed').each( function() { var objThis = $(this); var objOptions = objThis.children('option'); var objParent = objThis.parent(); var attrId = objThis.attr('id'); var attrName = objThis.attr('name'); var attrClass = objThis.attr('class'); var attrStyle = objThis.attr('style'); var styWidth = objThis.css('width'); //objParent.css('display','static'); var strHTML = ''; var strOptions = ''; var defOptValue,defOptHTML; var boolDefaultSelected = true; var arrOptions = new Array(); objOptions.each( function() { var objThisOption = $(this); var isSelected = objThisOption.attr('selected'); arrOptions.push( new Array ( objThisOption.attr('value'),objThisOption.html(),isSelected ) ); if (isSelected==true) { boolDefaultSelected = false; } }); for (x=0; x < arrOptions.length;x++) { var strActiveClass = ''; if (x==0 && boolDefaultSelected) { defOptValue = arrOptions[0][0]; defOptHTML = arrOptions[0][1]; strActiveClass = ' Active'; } if (arrOptions[x][2]==true) { defOptValue = arrOptions[x][0]; defOptHTML = arrOptions[x][1]; strActiveClass = ' Active'; } strOptions += '' + '' + '' + arrOptions[x][1] + '' + ''; } strHTML += '
' + '' + '
' + '
' + '' + defOptHTML + '' + '
' + '
' + '
' + '
' + strOptions + '
' + '
' + '' + '' '
'; objParent.html(strHTML); $('#selbox_'+attrId+' > div.SelectboxValue').click( function() { var thisSelectbox = $(this).parent(); var thisSelectboxOptions = thisSelectbox.children('div.SelectboxOptions'); var attrId = thisSelectbox.children('input').attr('id'); GeneralJS.ShowSelectboxLayer(attrId); }); $('#selbox_'+attrId+' > div.SelectboxValue').hover( function() { attrId = $(this).parent().children('input').attr('id'); window.clearTimeout(TimeSettings[attrId]); }, function() { attrId = $(this).parent().children('input').attr('id'); window.clearTimeout(TimeSettings[attrId]); TimeSettings[attrId] = window.setTimeout("GeneralJS.HideSelectboxLayer('"+attrId+"')", MainnavigationTime); } ); $('#selbox_'+attrId+' > div.SelectboxOptions').hover( function() { attrId = $(this).parent().children('input').attr('id'); window.clearTimeout(TimeSettings[attrId]); }, function() { attrId = $(this).parent().children('input').attr('id'); window.clearTimeout(TimeSettings[attrId]); TimeSettings[attrId] = window.setTimeout("GeneralJS.HideSelectboxLayer('"+attrId+"')", MainnavigationTime); } ); $('#selbox_'+attrId+' > div.SelectboxOptions > div.Wrapper > a').hover( function() { attrId = $(this).parent().parent().parent().children('input').attr('id'); window.clearTimeout(TimeSettings[attrId]); }, function() { attrId = $(this).parent().parent().parent().children('input').attr('id'); window.clearTimeout(TimeSettings[attrId]); } ); }); $('.menu_main1_1_link').hover( function() { LayerId = $(this).attr('id'); window.clearTimeout(TimeSettings[LayerId]); TimeSettings[LayerId] = window.setTimeout("GeneralJS.snl('"+LayerId+"')", MainnavigationTime); }, function() { LayerId = $(this).attr('id'); window.clearTimeout(TimeSettings[LayerId]); TimeSettings[LayerId] = window.setTimeout("GeneralJS.hnl('"+LayerId+"')", MainnavigationTime); } ); $('.menu_main1_2').hover( function() { LayerId = $(this).parent().children('a').attr('id'); window.clearTimeout(TimeSettings[LayerId]); TimeSettings[LayerId] = window.setTimeout("GeneralJS.snl('"+LayerId+"')", MainnavigationTime); }, function() { LayerId = $(this).parent().children('a').attr('id'); window.clearTimeout(TimeSettings[LayerId]); TimeSettings[LayerId] = window.setTimeout("GeneralJS.hnl('"+LayerId+"')", MainnavigationTime); } ); $('#newsteaserwrapper').hover( function() { window.clearTimeout(TimeSettings['NewsTeaserInit']); }, function() { TimeSettings['NewsTeaserInit'] = window.setTimeout("GeneralJS.NewsTeaserToggle()", 6000); } ); $('a.noLink').click( function() { return false; }); GeneralJS.flashdetect(); }); var GeneralJS = { snl: function(strlinkid) { var objLayer = $('#'+strlinkid).parent(); objLayer.addClass('hover'); }, hnl: function(strlinkid) { var objLayer = $('#'+strlinkid).parent(); objLayer.removeClass('hover'); }, ShowSelectboxLayer: function (LayerId) { var thisSelectbox = $('#selbox_'+LayerId); var thisSelectboxValue = thisSelectbox.children('div.SelectboxValue').children('div.Wrapper'); var thisSelectboxOptions = thisSelectbox.children('div.SelectboxOptions'); thisSelectboxValue.addClass('Active'); thisSelectboxOptions.css('display','block'); }, HideSelectboxLayer: function (LayerId) { var thisSelectbox = $('#selbox_'+LayerId); var thisSelectboxValue = thisSelectbox.children('div.SelectboxValue').children('div.Wrapper'); var thisSelectboxOptions = thisSelectbox.children('div.SelectboxOptions'); thisSelectboxValue.removeClass('Active'); thisSelectboxOptions.css('display','none'); }, SelectboxLinkInit: function() { $('a.SelectboxLink').click( function(){ var thisLink = $(this); var thisHTML = thisLink.children('span').html(); var thisSelectboxOptionsWrapper = thisLink.parent(); var thisSelectboxOptions = thisSelectboxOptionsWrapper.parent(); var thisSelectbox = thisSelectboxOptions.parent(); var thisSelectboxValue = thisSelectbox.children('input'); var thisSelectboxCont = thisSelectbox.children('div.SelectboxValue'); var thisSelectboxHTML = thisSelectboxCont.children('div.Wrapper').children('span'); thisSelectboxOptionsWrapper.children('a').removeClass('Active'); thisLink.addClass('Active'); thisSelectboxValue.attr('value',thisLink.attr('value')); thisSelectboxCont.attr('title',thisHTML) thisSelectboxHTML.html(thisHTML); thisSelectboxOptions.css('display','none'); GeneralJS.updateCertFinder(); }); }, NewsTeaserInit: function() { $('.newsteaser').each( function() { arrHomeNewsTeaser.push($(this).attr('id')); }); TimeSettings['NewsTeaserInit'] = window.setTimeout("GeneralJS.NewsTeaserToggle()", 6000); }, NewsTeaserToggle: function() { $('.newsteaser').hide(); $('#'+arrHomeNewsTeaser[intHomeNewsTeaserKey]).show(); intHomeNewsTeaserKey++; if (intHomeNewsTeaserKey>=arrHomeNewsTeaser.length) { intHomeNewsTeaserKey = 0; } TimeSettings['NewsTeaserInit'] = window.setTimeout("GeneralJS.NewsTeaserToggle()", 6000); }, HomeTeaserInit: function() { $('.hometeaser').each( function() { arrHomeTeaser.push($(this).attr('id')); }); if (arrHomeTeaser.length>1) { TimeSettings['HomeTeaserInit'] = window.setTimeout("GeneralJS.HomeTeaserToggle()", 6000); } }, HomeTeaserToggle: function() { $('.newsteaser').hide(); $('#'+arrHomeTeaser[intHomeTeaserKey]).show(); intHomeTeaserKey++; if (intHomeTeaserKey>=arrHomeTeaser.length) { intHomeTeaserKey = 0; } TimeSettings['HomeTeaserInit'] = window.setTimeout("GeneralJS.HomeTeaserToggle()", 6000); }, ToggleId: function(strHideId,strShowId) { $('#'+strHideId).hide(); $('#'+strShowId).show(); }, flashdetect: function() { $('object.flashdetect').each(function() { if(!hasRightFlashVersion) { var objflashObject = $(this); var objflashParent = objflashObject.parent(); var objflashId = objflashObject.attr('id'); if (objflashId) { objflashParent.remove(); $('.'+objflashId).css('display','block'); } else { var strNoFlash = '
'+ ''+ 'Get Adobe Flash Player'+ ''+ '
'+ 'Für die Darstellung dieser Seite benötigen Sie den aktuellen Flash Player von Adobe.'+ '
'; objflashParent.html(strNoFlash); } } }); }, openprodlayer: function(thisid) { $('.desclayer').css('display','none'); $('#desclayer'+thisid).css('display','block'); }, closeprodlayer: function() { $('.desclayer').css('display','none'); }, submitbasket: function() { document.getElementById("basket").submit(); }, submitpayment: function() { if (validate('basket',var_1)) { Shadowbox.open({ content: '/_public/wirecard.php', player: "iframe", height: 630, width: 620 }); } } };