/*
	*** Illustratoren Organisation Berlin ***
	JavaScript for www.illustratorenberlin.de
	(c) Mareike Hybsier - http://www.die-programmiererin.de
*/


// All genres and the corresponding illustrators
// The first element should be the genre itself.

// Animation
var animation = new Array('animation', 'badel', 'biederstaedt', 'bonnke', 'hybsier', 'kull', 'marcus', 'matthes', 'pfeiffer', 'riske', 'runkel', 'schroeter', 'surrey');
// Belletristik
var belletristik = new Array('belletristik', 'badel', 'baltzer', 'beitmann', 'bonnke', 'brandes', 'christoph', 'funke', 'graf','guhr', 'gumpert', 'heinlein', 'heinzel', 'juch', 'kull', 'lehmann','luckhaus', 'mallinckrodt', 'menne', 'muetter', 'rauth', 'riske', 'roerig', 'runkel', 'schaalburg', 'schech', 'schmidt', 'schroeter', 'surrey', 'wolfermann', 'wowra');
// Cartoon & Comic
var comic_cartoon = new Array('comic_cartoon', 'badel', 'baltzer', 'beitmann', 'biederstaedt', 'gumpert', 'hybsier', 'juch', 'kiefersauer', 'kull', 'lehmann','luckhaus', 'mallinckrodt', 'menne', 'muetter', 'runkel', 'strahl', 'surrey', 'wieker', 'wilke', 'wowra');
// Editorial
var editorial = new Array('editorial', 'badel', 'baltzer', 'biederstaedt', 'bonnke', 'brandes', 'drews', 'gelau', 'guhr', 'gumpert', 'heinlein', 'heinzel', 'kiefersauer', 'kull', 'lehmann','luckhaus', 'marcus', 'menne', 'muetter', 'rauth', 'riske', 'roerig', 'runkel', 'schaalburg', 'surrey', 'szekessy', 'wolfermann', 'wowra');
// Fantasy
var fantasy = new Array('fantasy', 'beitmann', 'graf', 'hybsier', 'christoph', 'juch', 'mallinckrodt', 'wichtler');
// Freie Illustration
var freie_illustration = new Array('freie_illustration', 'badel', 'baltzer', 'beitmann', 'bonnke', 'brandes', 'christoph', 'funke','gelau', 'graf','guhr', 'gumpert', 'heinlein', 'heinzel', 'joaocare', 'juch', 'lehmann','lenz', 'luckhaus', 'mallinckrodt', 'menne', 'rauth', 'riske', 'roerig', 'runkel', 'schech', 'schroeter', 'strahl', 'wacker', 'wilke', 'wolfermann', 'wowra');
// Kinder & Jugendbuch
var kinder_jugendbuch = new Array('kinder_jugendbuch', 'badel', 'baltzer', 'beitmann', 'bonnke', 'brandes', 'christoph', 'drews', 'graf','guhr', 'gumpert', 'heinzel', 'hybsier', 'joaocare', 'juch','lehmann', 'kiefersauer', 'lenz', 'leope', 'luckhaus', 'mallinckrodt', 'marcus', 'meister', 'menne', 'merle', 'muetter', 'pfeiffer', 'rieger', 'riske', 'roerig', 'runkel', 'schaalburg', 'schech', 'schroeter', 'sohr', 'strahl', 'szekessy', 'wichtler', 'wieker', 'wilke', 'wolfermann', 'wowra', 'zimmermann');
// Layout & Storyboard
var layout_storyboard = new Array('layout_storyboard', 'badel', 'beitmann', 'biederstaedt', 'gelau', 'heinlein', 'heinzel', 'juch', 'kull', 'mallinckrodt', 'marcus', 'runkel', 'szekessy', 'wichtler', 'wolfermann');
// Multimedia
var multimedia = new Array('multimedia', 'beitmann', 'juch', 'kull', 'riske', 'schroeter', 'surrey', 'wolfermann');
// Realistisch
var realistisch = new Array('realistisch', 'baltzer', 'beitmann', 'biederstaedt', 'brandes', 'christoph', 'gelau', 'graf','juch', 'kull', 'lehmann','luckhaus', 'mallinckrodt', 'matthes', 'menne', 'runkel', 'schech', 'schroeter', 'sohr', 'wilke', 'wolfermann');
// Sach & Schulbuch
var sach_schulbuch = new Array('sach_schulbuch', 'badel', 'baltzer', 'biederstaedt', 'bonnke', 'christoph', 'graf','guhr', 'heinzel', 'juch', 'lenz', 'leope', 'luckhaus', 'marcus', 'menne', 'muetter', 'pfeiffer', 'riske', 'runkel', 'schaalburg', 'schech', 'schroeter', 'surrey', 'szekessy', 'wichtler', 'wieker', 'wolfermann', 'wowra');
// Style
// 'style' seems to be a reserved word in JavaScript, so we use 'styles' instead.
var styles = new Array('styles', 'biederstaedt', 'drews', 'funke', 'gumpert', 'heinlein', 'heinzel', 'kull', 'luckhaus', 'mallinckrodt', 'matthes', 'schaalburg', 'wacker', 'wowra');
// Werbung
var werbung = new Array('werbung', 'biederstaedt', 'funke', 'gelau', 'gumpert', 'heinlein', 'juch', 'kiefersauer', 'kull', 'luckhaus', 'mallinckrodt', 'matthes', 'menne', 'schaalburg', 'surrey', 'szekessy', 'wilke');


// Set the links for the given genre to 'active'
function show(genre) {
	deactivate_all();
	for (var i = 0; i < genre.length; i++) {
		var _element = document.getElementById(genre[i]);
		if (_element) { // check for misspelled names or genres
			_element.setAttribute('class', 'active');
			_element.setAttribute('className', 'active'); // Hack for Win IW 6 + 7
		}
	}
	return false;
}

// Set _all_ links to empty class, so don't use other CSS classes than .active for links; see function show(genre) above
// TODO Find another way to remove the class 'active' ...
function deactivate_all() {
	var _links = document.links
	for (var i = 0; i < _links.length; i++) {
		_links[i].setAttribute('class', '');
		_links[i].setAttribute('className', ''); // Hack for Win IW 6 + 7
	}
}

// Open an illustrator popup for the corresponding link
function popup_illustrator(name, height, width) {
	return popup(name, 'zeichner/', height, width);
}

// Open extraseiten (neues etc.) popup for the corresponding link
function popup_extras(name, height, width) {
	return popup(name, 'extraseiten/', height, width);
}

// Open a popup for the corresponding link
function popup(name, path, height, width) {
	var _width = (width == null) ? 245 : width;
	var _path = path + name;
	window.open(_path + '.htm',name,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + _width + ',height=' + height + ',left=10,top=10');
	return false;
}