var query
var ueber
var produkte
var technik
var qualitaet
var jobs
var anfrage
var kontakt

var animation_service = false
var image_root 
var images_max
var animation
var timer_id
var current_image
var timeout
var images
var i

function show_animation_screen(root, num) {
	animation_service = true
	images_max = num
	image_root = root
	animation = true
	timer_id = null
	current_image = 1
	timeout = 2000
	images = new Array

	for (i = 0; i < images_max; i++) {
		images[i] = new Image
		images[i].src = image_root + (i + 1) + ".jpg"
	}

	document.write('<img name="screen" class="image-right" src="' + image_root + '1.jpg" alt="" /><br /><br />');

	for (i = 0; i < images_max; i++) {
		document.write('<a href="#" onclick="set_image(' + i + '); return false">Picture&#160;' + (i + 1) + '</a>&#160; &#160;')
	}

	document.write('<br /><br /><form name="controller"><input type="button" name="startstop" value="Stop animation" onclick="toggle_animation()" /></form>')
}

function stop_timer() {
	if (timer_id != null) {
		clearTimeout(timer_id)
	}
}

function start_timer() {
	stop_timer()
	timer_id = setTimeout("animate()", timeout) 
}

function animate() {
	if (animation == false) {
		return
	}
	if (images[current_image].complete) {
		show_image(current_image)
		current_image++
		current_image %= images_max
	}
	start_timer()
}

function stop_animation() {
	stop_timer()
	animation = false
	document.controller.startstop.value = "Start animation"
}

function start_animation() {
	stop_timer()
	document.controller.startstop.value = "Stop animation"
	animation = true
	start_timer()
}

function start_services() {
	if (animation_service) {
		start_animation()
	}
}

function toggle_animation() {
	if (animation == true) {
		stop_animation()
	}
	else {
		start_animation()
	}
}

function show_image(num) {
	current_image = num % images_max
	document.screen.src = images[num].src
}

function set_image(num) {
	stop_animation()
	show_image(num)
}

function get_query() {
	var query

	query = "?" + ueber + produkte + technik + qualitaet + jobs + anfrage + kontakt

	return query
}

function close_standort(url) {
	window.opener.location.href = url + get_query()
	window.close()

	return false
}

function popup(url, name, width, height) {
	window.open(url + get_query(), name, "width=" + width + ",height=" + height + ",scrolling=no")

	return false
}

function hush() {
	return false;
}

function is_visible(id) {
	var obj

	if (document.getElementById) {
		obj = document.getElementById(id)
		return (obj.style.visibility != "hidden")
	}

	return false
}

function toggle(id, height) {
	eval(id + " = (" + id + " == 0 ? 1 : 0)")
	if (is_visible(id)) {
		if (navigator.appName == "Microsoft Internet Explorer") {
			set_position(id, "absolute")
		}
		set_layer_height(id, "0")
		hide_layer(id)
	}
	else {
		if (navigator.appName == "Microsoft Internet Explorer") {
			set_position(id, "relative")
		}
		set_layer_height(id, height)
		show_layer(id)
	}

	return false
}

function set_layer_height(id, height) {
	var obj

	if (document.getElementById) {
		obj = document.getElementById(id)
		obj.style.height = height
	}
}

function set_position(id, position) {
	var obj

	if (document.getElementById) {
		obj = document.getElementById(id)
		obj.style.position = position
	}
}


function hide_layer(id) {
	var obj

	if (document.getElementById) {
		obj = document.getElementById(id)
		obj.style.visibility = "hidden"
	}
}

function show_layer(id) {
	var obj

	if (document.getElementById) {
		obj = document.getElementById(id)
		obj.style.visibility = "visible"
	}
}

function jump_to(url) {
	location.href = url + get_query()
	return false
}

function show_navigation() {
	var position
	var style

	if (!document.getElementById) {
		document.write(' \
<b>ABOUT US</b><br /> \
<a href="/en/die-gruppe">THE GROUP</a><br /> \
<a href="/en/firmenansichten">COMPANY VIEWS</a><br /> \
<br /> \
<b>PRODUCTS</b><br /> \
<a href="/en/druckfedern">DRUCKFEDERN</a><br /> \
<a href="/en/zugfedern">ZUGFEDERN</a><br /> \
<a href="/en/drehfedern">DREHFEDERN</a><br /> \
<a href="/en/drahtformteile">DRAHTFORMTEILE</a><br /> \
<a href="/en/stanzbiegeteile">STANZBIEGETEILE</a><br /> \
<a href="/en/baugruppen">BAUGRUPPEN</a><br /> \
<br /> \
<b>TECHNIK</b><br /> \
<a href="/en/maschinen">MASCHINEN</a><br /> \
<a href="/en/werkstoffe">WERKSTOFFE</a><br /> \
<a href="/en/oberflaechen">OBERFL&Auml;CHEN</a><br /> \
<br /> \
<b>QUALITY</b><br /> \
<a href="/en/qualitaetssicherung">QUALIT&Auml;TSSICHERUNG</a><br /> \
<a href="/en/zertifizierungen">CERTIFICATIONS</a><br /> \
<br /> \
<b>JOBS</b><br /> \
<a href="/en/ausschreibungen">OFFERS</a><br /> \
<br /> \
<b>INQUIRY</b><br /> \
<a href="/en/anfrageformular">INQUIRY FORM</a><br /> \
<a href="/en/produktanfragen">PRODUCT INQUIRIES</a><br /> \
<br /> \
<b>CONTACT</b><br /> \
<a href="/en/standorte">STANDORTE</a><br /> \
<a href="/en/ansprechpartner">ANSPRECHPARTNER</a><br /> \
<a href="/en/anfahrt">ANFAHRT</a><br /> \
<a href="/en/kontaktformular">KONTAKTFORMULAR</a><br /> \
<br /> \
<a href="./">HOME + NEWS</a><br /> \
<a href="/en/messetermine">EXHIBITIONS</a><br /> \
<br /> \
<a href="/en/impressum" class="gray">IMPRINT</a><br /> \
<a href="/en/sitemap" class="gray">SITEMAP</a><br /> \
')
		return
	}

	if (navigator.appName == "Microsoft Internet Explorer") {
		position = "absolute"
	}
	else {
		position = "relative"
	}

	style = 'style="position: ' + position + ';visibility: hidden; height: 0em;"'
	document.write(' \
<a href="#" class="node" onclick="return toggle(\'ueber\', \'4em\')">ABOUT US</a><br /> \
<div id="ueber"' + (ueber != "1" ? style : "") + '> \
<a href="#" onclick="return jump_to(\'/en/die-gruppe\')">THE GROUP</a><br /> \
<a href="#" onclick="return jump_to(\'/en/firmenansichten\')">COMPANY VIEWS</a><br /> \
<br /> \
</div> \
<a href="#" class="node" onclick="return toggle(\'produkte\', \'9em\')">PRODUCTS</a><br /> \
<div id="produkte"' + (produkte != "1" ? style : "") + '> \
<a href="#" onclick="return jump_to(\'/en/druckfedern\')">COMPRESSION SPRINGS</a><br /> \
<a href="#" onclick="return jump_to(\'/en/zugfedern\')">EXTENSION SPRINGS</a><br /> \
<a href="#" onclick="return jump_to(\'/en/drehfedern\')">TORSION SPRINGS</a><br /> \
<a href="#" onclick="return jump_to(\'/en/drahtformteile\')">BENT WIRE PARTS</a><br /> \
<a href="#" onclick="return jump_to(\'/en/stanzbiegeteile\')">STAMPING AND BENDING PARTS</a><br /> \
<a href="#" onclick="return jump_to(\'/en/baugruppen\')">COMPONENTS</a><br /> \
<br /> \
</div> \
<a href="#" class="node" onclick="return toggle(\'technik\', \'5em\')">TECHNOLOGY</a><br /> \
<div id="technik"' + (technik != "1" ? style : "") + '> \
<a href="#" onclick="return jump_to(\'/en/maschinen\')">MACHINERY</a><br /> \
<a href="#" onclick="return jump_to(\'/en/werkstoffe\')">MATERIALS</a><br /> \
<a href="#" onclick="return jump_to(\'/en/oberflaechen\')">SURFACES</a><br /> \
<br /> \
</div> \
<a href="#" class="node" onclick="return toggle(\'qualitaet\', \'4em\')">QUALITY</a><br />  \
<div id="qualitaet"' + (qualitaet != "1" ? style : "") + '> \
<a href="#" onclick="return jump_to(\'/en/qualitaetssicherung\')">QUALITY ASSURANCE</a><br /> \
<a href="#" onclick="return jump_to(\'/en/zertifizierungen\')">CERTIFICATIONS</a><br /> \
<br /> \
</div> \
<a href="#" class="node" onclick="return toggle(\'jobs\', \'2em\')">JOBS</a><br /> \
<div id="jobs"' + (jobs != "1" ? style : "") + '> \
<a href="#" onclick="return jump_to(\'/en/ausschreibungen\')">OFFERS</a><br /> \
<br /> \
</div> \
<a href="#" class="node" onclick="return toggle(\'anfrage\', \'4em\')">INQUIRY</a><br /> \
<div id="anfrage"' + (anfrage != "1" ? style : "") + '> \
<a href="#" onclick="return jump_to(\'/en/anfrageformular\')">INQUIRY FORM</a><br /> \
<a href="#" onclick="return jump_to(\'/en/produktanfragen\')">PRODUCT INQUIRIES</a><br /> \
<br /> \
</div> \
<a href="#" class="node" onclick="return toggle(\'kontakt\', \'5em\')">CONTACT</a><br /> \
<div id="kontakt"' + (kontakt != "1" ? style : "") + '> \
<a href="#" onclick="return popup(\'/en/standorte\', \'standorte\', 447, 343)">LOCATIONS</a><br /> \
<a href="#" onclick="return jump_to(\'/en/ansprechpartner\')">CONTACT PERSONS</a><br /> \
<a href="#" onclick="return jump_to(\'/en/anfahrt\')">DIRECTIONS</a><br /> \
<a href="#" onclick="return jump_to(\'/en/kontaktformular\')">CONTACT FORM</a><br /> \
</div> \
<br /> \
<a href="#" onclick="return jump_to(\'./\')">HOME + NEWS</a><br /> \
<a href="#" onclick="return jump_to(\'/en/messetermine\')">EXHIBITIONS</a><br /> \
<br /> \
<a href="#" onclick="return jump_to(\'/en/impressum\')" class="gray">IMPRINT</a><br /> \
<a href="#" onclick="return jump_to(\'/en/sitemap\')" class="gray">SITEMAP</a><br /> \
');

}

//window.onerror = hush

if (top.location != self.location) {
	top.location = self.location
}

query = location.search

ueber = (query.substr(1, 1) == "1" ? 1 : 0)
produkte = (query.substr(2, 1) == "1" ? 1 : 0)
technik = (query.substr(3, 1) == "1" ? 1 : 0)
qualitaet = (query.substr(4, 1) == "1" ? 1 : 0)
jobs = (query.substr(5, 1) == "1" ? 1 : 0)
anfrage = (query.substr(6, 1) == "1" ? 1 : 0)
kontakt = (query.substr(7, 1) == "1" ? 1 : 0)

