var TimeSettings = new Array();
var MainnavigationTime = 300;
var action = true;
var intendpos;
var intstartpos;
$(document).ready( function() {
$('.BtnOver').hover(
function() {
$(this).attr('src', $(this).attr('over'));
},
function() {
$(this).attr('src', $(this).attr('out'));
}
);
$('.initTopLayer').hover(
function() {
$('#FooterOverlay').css('display','block');
},
function() {
$('#FooterOverlay').css('display','none');
if ($(this).css('height') != '20px') {
$(this).animate({
height: '20px'
}, "fast", function() {
$(this).addClass('SelectClosed');
});
}
}
);
$('.initTopLayer > a.Arrow').click( function() {
var thisSelector = $(this).parent('div.initTopLayer');
if (thisSelector.css('height') == '20px') {
thisSelector.removeClass('SelectClosed');
var newHeight = thisSelector.attr('setHeight')+'px';
thisSelector.animate({
height: newHeight
}, "fast" );
} else {
var newHeight = '20px';
thisSelector.animate({
height: newHeight
}, "fast", function() {
thisSelector.addClass('SelectClosed');
});
}
});
$('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]);
}
);
});
$('div#hometeaser').each(function() {
var intsliderwidth = 960;
var hometeaser = $(this);
var arrowleft = hometeaser.children('a#arrowleft');
var arrowright = hometeaser.children('a#arrowright');
var hometeaserwrapper = hometeaser.children('div.Wrapper');
var slider = hometeaserwrapper.children('a');
var intslidercount = slider.length;
if (intslidercount>1) {
var strslidercontent = hometeaserwrapper.html();
intstartpos = 0 - intslidercount * intsliderwidth;
intendpos = intstartpos - (intslidercount * intsliderwidth - intsliderwidth);
hometeaserwrapper.append(strslidercontent+strslidercontent);
hometeaserwrapper.css('left',intstartpos+'px');
arrowleft.css('display','block');
arrowright.css('display','block');
arrowright.click(function() {
if (action) {
action = false;
var curpos = parseInt(hometeaserwrapper.css('left'));
var newpos = curpos-intsliderwidth;
hometeaserwrapper.animate({
left: newpos+'px'
}, 500, function() {
if (newpos < intendpos) {
hometeaserwrapper.css('left',intstartpos+'px');
}
action = true;
});
}
});
arrowleft.click(function() {
if (action) {
action = false;
var curpos = parseInt(hometeaserwrapper.css('left'));
var newpos = curpos+intsliderwidth;
hometeaserwrapper.animate({
left: newpos+'px'
}, 500, function() {
if (newpos > intstartpos) {
hometeaserwrapper.css('left',intendpos+'px');
}
action = true;
});
}
});
hometeaser.hover(
function(){
window.clearTimeout(TimeSettings['HomeTeaserInit']);
},
function(){
TimeSettings['HomeTeaserInit'] = window.setTimeout("GeneralJS.slidehometeaser()", 5000);
}
);
TimeSettings['HomeTeaserInit'] = window.setTimeout("GeneralJS.slidehometeaser()", 10000);
}
});
});
$(function() {
$('.ShowTopNaviLayer').hover(
function() {
var LayerId = $(this).attr('layerid');
if (LayerId) {
window.clearTimeout(TimeSettings[LayerId]);
TimeSettings[LayerId] = window.setTimeout("GeneralJS.ShowMainnavigationLayer('"+LayerId+"')", MainnavigationTime);
}
},
function() {
var LayerId = $(this).attr('layerid');
if (LayerId) {
window.clearTimeout(TimeSettings[LayerId]);
TimeSettings[LayerId] = window.setTimeout("GeneralJS.HideMainnavigationLayer('"+LayerId+"')", MainnavigationTime);
}
}
);
$('.TopNaviLayer').hover(
function() {
var LayerId = $(this).attr('layerid');
window.clearTimeout(TimeSettings[LayerId]);
},
function() {
var LayerId = $(this).attr('layerid');
TimeSettings[LayerId] = window.setTimeout("GeneralJS.HideMainnavigationLayer('"+LayerId+"')", MainnavigationTime);
}
);
$('#search').focus(
function() {
$('.SearchContainer').addClass('SearchContainerFocus');
}
)
$('#search').blur(
function() {
if ($(this).attr('value')=='') {
$('.SearchContainer').removeClass('SearchContainerFocus');
}
}
)
$('a.noLink').click( function() { return false; })
$(".LocationsMap").hover(
function() {
var newImages = 'LocationMap'+$(this).attr('href');
$('img#LocationMap').attr('src',$('img#'+newImages).attr('src'));
},
function() {
var newImages = 'LocationMap'+$('input#ActiveLocationMap').attr('value');
$('img#LocationMap').attr('src',$('img#'+newImages).attr('src'));
}
);
$(".LocationsMap").click(
function() {
var newImagesId = $(this).attr('href');
var newImages = 'LocationMap'+newImagesId;
$('input#ActiveLocationMap').attr('value',newImagesId);
$('img#LocationMap').attr('src',$('img#'+newImages).attr('src'));
$('div#resultcontainer').css('display','none');
$.get('/_public/getLocations.php',
{continents_id:newImagesId},
function(returned_data)
{
$('select#distribution').html('');
$('div#LocationLetterbox').html(returned_data);
$('div#LocationLetterbox').fadeIn('slow', function() {
var intContinentId = $('input#ActiveLocationMap').attr('value');
$.get('/_public/getLocations.php',
{countries_search:'Global',continents_id:intContinentId},
function(returned_data)
{
$('select#distribution').html(returned_data).change(
function(){
var intCountriesId = $(this).attr('value');
$.get('/_public/getLocations.php',
{countries_id:intCountriesId},
function(returned_data)
{
$('div#resultcontainer').html(returned_data);
$('div#resultcontainer').css('display','block');
}
)
}
);
}
)
$('a.letters').click(
function() {
$('div#resultcontainer').css('display','none');
var strCountriesSearch = $(this).attr('href');
var intContinentId = $('input#ActiveLocationMap').attr('value');
$.get('/_public/getLocations.php',
{countries_search:strCountriesSearch,continents_id:intContinentId},
function(returned_data)
{
$('select#distribution').html(returned_data).change(
function(){
var intCountriesId = $(this).attr('value');
$.get('/_public/getLocations.php',
{countries_id:intCountriesId},
function(returned_data)
{
$('div#resultcontainer').html(returned_data);
$('div#resultcontainer').css('display','block');
}
)
}
);
}
)
return false;
}
);
});
}
);
return false;
}
);
$('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');
});
$('table#cetificate_finder a.SelectboxLink').click( function(){
GeneralJS.updateCertFinder();
});
});
var GeneralJS = {
slidehometeaser: function() {
action = false;
var intsliderwidth = 960;
var hometeaser = $('div#hometeaser');
var hometeaserwrapper = hometeaser.children('div.Wrapper');
var curpos = parseInt(hometeaserwrapper.css('left'));
var newpos = curpos-intsliderwidth;
hometeaserwrapper.animate({
left: newpos+'px'
}, 500, function() {
if (newpos < intendpos) {
hometeaserwrapper.css('left',intstartpos+'px');
}
action = true;
});
TimeSettings['HomeTeaserInit'] = window.setTimeout("GeneralJS.slidehometeaser()", 8000);
},
/*Language: GeneralLanguage.setLanguage(),*/
/**
Einblenden der Mainnavigation Layers.
Wegen der Zeitsteuerung muss hier eine function verwendet werden.
Aufruf GeneralJS.ShowMainnavigationLayer();
**/
ShowMainnavigationLayer: function (LayerId) {
$('#nav_'+LayerId).addClass('ShowLayer');
$('#img_'+LayerId).attr('src',$('#img_'+LayerId).attr('over'));
},
/**
Ausblenden der Mainnavigation Layers.
Wegen der Zeitsteuerung muss hier eine function verwendet werden.
Aufruf GeneralJS.HideMainnavigationLayer();
**/
HideMainnavigationLayer: function (LayerId) {
$('#nav_'+LayerId).removeClass('ShowLayer');
$('#img_'+LayerId).attr('src',$('#img_'+LayerId).attr('out'));
},
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');
},
updateCertFinder: function() {
var where_countries = $('#where_countries_id').attr('value');
var where_addresses = $('#where_addresses_id').attr('value');
var where_category = $('#where_category_id').attr('value');
var strurlfinder = '/_public/getCertFinder.php';
var strurldownloads = '/_public/getCertDownloads.php';
var strurl = '?where[countries_id]='+where_countries
+'&where[addresses_id]='+where_addresses
+'&where[category_id]='+where_category
+'&field=';
$.get(strurlfinder+strurl+'countries_id', function(TXT) {
$('#SelectboxOpt_where_countries_id > div.Wrapper').html(TXT);
GeneralJS.SelectboxLinkInit();
});
$.get(strurlfinder+strurl+'addresses_id', function(TXT) {
$('#SelectboxOpt_where_addresses_id > div.Wrapper').html(TXT);
GeneralJS.SelectboxLinkInit();
});
$.get(strurlfinder+strurl+'category_id', function(TXT) {
$('#SelectboxOpt_where_category_id > div.Wrapper').html(TXT);
GeneralJS.SelectboxLinkInit();
});
$.get(strurldownloads+strurl, function(TXT) {
$('#certpreview').html(TXT);
});
},
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();
});
}
};