
// Eingeführt am 2010-07-09
// Daten zu den Einträgen im select-Element werden von bdointernatinal.com
// dynamisch geladen.

$(document).ready(function() {
	var allWebsites=new Array();
	try {
		allWebsites=bdoWebsites; //uses remote DNSs on BDOInternational.com
	}
	catch (err){
		allWebsites=bdoWebsitesLocal; //uses Local DNSs found in the BDOInternationalWebsiteAddressesLocal.js
	}

	$('#locationSelector').html('');
	$('<option value="">BDO locations</option>').appendTo('#locationSelector');
	var theDNS=location.host;

	$.each(allWebsites, function(key, data) {
		var thisDataDNS=data.dns;
		var thisDataDNStrimmed=thisDataDNS.slice((thisDataDNS.indexOf('//')+2),thisDataDNS.length);
		if (thisDataDNStrimmed!=theDNS) {
			$('<option value="'+data.dns+'">'+data.country+'</option>').appendTo('#locationSelector');
		};
	});

	//set max height
	$('#locationSelector').sSelect({ddMaxHeight: '300px'}); //set max height of the drop-down

	$('#locationSelector').change(function() { //onChange then open a new window
		if ($(this).val()!="") {
			window.open($(this).val());
		}
	});
});

$(document).ready(function(){
	//set max height
	$('#quicklinkSelector').sSelect({ddMaxHeight: '150px'});
	$('#topicSelector').sSelect({ddMaxHeight: '150px'});
	$('#publicationSelector').sSelect({ddMaxHeight: '150px'});
	$('#authorSelector').sSelect({ddMaxHeight: '150px'});
	$('#yearSelector').sSelect({ddMaxHeight: '150px'});
});
