/*
	*** 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', 'reitz','riske', 'runkel', 'schlierkamp', 'schroeter', 'surrey', 'thomas');
// Belletristik
var belletristik = new Array('belletristik', 'badel', 'baltzer', 'beitmann', 'bonnke', 'brandes', 'christoph', 'funke', 'graf','guhr', 'gumpert', 'hartwig', 'heinlein', 'heinzel', 'juch', 'kull', 'lehmann','luckhaus', 'mallinckrodt', 'menne', 'muetter', 'rauth', 'riske', 'roerig', 'runkel', 'schaalburg', 'schlierkamp', 'schech', 'schmidt', 'schroeter', 'spitzer', 'surrey',  'thomas','wolfermann', 'wowra');
// Cartoon & Comic
var comic_cartoon = new Array('comic_cartoon', 'badel', 'baltzer', 'beitmann', 'biederstaedt', 'gandras', 'gumpert', 'hybsier', 'juch', 'kiefersauer','krapp','kull', 'lehmann','luckhaus', 'mallinckrodt', 'menne', 'muetter', 'reitz', 'runkel', 'schlierkamp', 'seelmann', 'strahl', 'surrey', 'thomas', 'tigrowna', 'wieker', 'wilke', 'wowra');
// Editorial
var editorial = new Array('editorial', 'badel', 'baltzer', 'biederstaedt', 'bonnke', 'brandes', 'drews', 'gandras', 'gelau', 'guhr', 'gumpert', 'hartwig', 'heinlein', 'heinzel', 'kiefersauer', 'kull', 'lehmann','luckhaus', 'marcus', 'menne', 'muetter', 'rauth', 'riske', 'roerig', 'runkel', 'schaalburg', 'spitzer', 'surrey', 'szekessy', 'thomas', 'wolfermann', 'wowra');
// Fantasy
var fantasy = new Array('fantasy', 'beitmann', 'graf', 'hybsier', 'christoph', 'juch', 'mallinckrodt', 'schlierkamp', 'wichtler');
// Freie Illustration
var freie_illustration = new Array('freie_illustration', 'badel', 'baltzer', 'beitmann', 'bonnke', 'brandes', 'christoph', 'funke','gelau', 'graf','guhr', 'gumpert', 'hartwig', 'heinlein', 'heinzel', 'joaocare', 'juch', 'lehmann','lenz', 'luckhaus', 'mallinckrodt', 'menne', 'rauth', 'reitz', 'riske', 'roerig', 'runkel', 'schech', 'schlierkamp', 'schroeter', 'spitzer', 'strahl', 'thomas', 'tigrowna', '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','krapp', 'langhorst','lehmann', 'kiefersauer', 'lenz', 'leope', 'luckhaus', 'mallinckrodt', 'marcus', 'meister', 'menne', 'merle', 'muetter', 'pfeiffer', 'reitz', 'rieger', 'riske', 'roerig', 'runkel', 'schaalburg', 'schech', 'schlierkamp', 'schroeter', 'seelmann', 'sohr', 'spitzer', 'strahl', 'szekessy', 'thomas', 'tigrowna', 'wichtler', 'wieker', 'wilke', 'wolfermann', 'wowra', 'zimmermann');
// Layout & Storyboard
var layout_storyboard = new Array('layout_storyboard', 'badel', 'beitmann', 'biederstaedt', 'gelau', 'hartwig', 'heinlein', 'heinzel', 'juch', 'kull', 'mallinckrodt', 'marcus', 'runkel', 'schlierkamp', 'szekessy',  'thomas', 'wichtler', 'wolfermann');
// Multimedia
var multimedia = new Array('multimedia', 'beitmann', 'juch', 'kull', 'reitz', 'riske', 'schroeter', 'surrey', 'wolfermann');
// Realistisch
var realistisch = new Array('realistisch', 'baltzer', 'beitmann', 'biederstaedt', 'brandes', 'christoph', 'hartwig', 'gelau', 'graf','juch', 'kull', 'langhorst','lehmann','luckhaus', 'mallinckrodt', 'matthes', 'menne', 'runkel', 'schech', 'schlierkamp', 'schroeter', 'sohr', 'thomas', 'wilke', 'wolfermann');
// Sach & Schulbuch
var sach_schulbuch = new Array('sach_schulbuch', 'badel', 'baltzer', 'biederstaedt', 'bonnke', 'christoph', 'gandras', 'graf','guhr', 'heinzel', 'juch', 'krapp', 'langhorst', 'lenz', 'leope', 'luckhaus', 'marcus', 'menne', 'muetter', 'pfeiffer', 'reitz', 'riske', 'runkel', 'schaalburg', 'schech', 'schroeter', 'seelmann', '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', 'seelmann','wacker', 'wowra');
// Werbung
var werbung = new Array('werbung', 'biederstaedt', 'funke', 'gelau', 'gumpert', 'hartwig', 'heinlein', 'juch', 'kiefersauer', 'krapp', 'kull', 'luckhaus', 'mallinckrodt', 'matthes', 'menne', 'reitz', 'schaalburg', 'seelmann', 'spitzer', '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;
}
