
var act_elements = new Array();
var act_active = new Array();

var lang_show = false;
var time_int = false;
var timed_int = false;
var cur_x = false;
var init_height = false;

function moveBoxUp() {
	cur_x = cur_x - 1;
	$('lang_alt_ct').style.top = cur_x + "px";
	if (time_int && cur_x <= (200-init_height)) clearInterval(time_int);
}

function moveBoxDown() {
	cur_x = cur_x + 1;
	$('lang_alt_ct').style.top = cur_x + "px";
	if (time_int && cur_x >= 200) clearInterval(time_int);
}

function safeMovement(toggle) {
	if (timed_int) {
		clearInterval(timed_int);
		timed_int = false;
		if (toggle == 2) {
			$('arrow').src = 'bilder/arrow2.gif';
		} else {
			$('arrow').src = 'bilder/arrow.gif';
		}
	}
}

function showLangSel(divHeight) {
	if (!init_height) init_height = divHeight;
	cur_x = parseInt($('lang_alt_ct').style.top);
	if (!timed_int) {
		if (!lang_show) {
			lang_show = true;
			if (time_int) clearInterval(time_int);
			time_int = window.setInterval("moveBoxUp()", 25);
			timed_int = window.setInterval("safeMovement(2)", divHeight*25);
		} else {
			lang_show = false;
			if (time_int) clearInterval(time_int);
			time_int = window.setInterval("moveBoxDown()", 25);
			timed_int = window.setInterval("safeMovement(1)", divHeight*25);
		}
	}
}

function tg(opener, element_nr){
	element = $('s'+element_nr);

	if (element) {
		hideAll();
		element.show();
		act_elements[0] = opener;
		act_elements[1] = element;
		act_active[0] = 1;
		act_active[1] = 0;
		opener.onmouseout = function(opener) { ele_0_out(); }
		//$('output').value = $('output').value + "rein "+act_active[0]+""+act_active[1]+"\n";
	}

	return false;
}

function act(actor) {
	if (actor == act_elements[0]) {
		actor.onmouseout = function() { ele_0_out() };
		act_active[0] = 1;
	} else if (actor == act_elements[1]) {
		actor.onmouseout = function() { ele_1_out() };
		act_active[1] = 1;
	}
	//$('output').value = $('output').value + "rein "+act_active[0]+""+act_active[1]+"\n";
}

function ele_0_out() {
	act_out(0);
}

function ele_1_out() {
	act_out(1);
}

function act_out(actor) {
	if (actor == 0) {
		$(act_elements[0]).onmouseout = "";
		act_active[0] = 0;
		//$('output').value = $('output').value + "ele 0 auf 0\n";
	} else if (actor == 1) {
		$(act_elements[1]).onmouseout = "";
		act_active[1] = 0;
		//$('output').value = $('output').value + "ele 1 auf 0\n";
	}
	if (act_active[0] == 0 && act_active[1] == 0) {
		window.setTimeout("act_hide()",250);
	}
	//$('output').value = $('output').value + "raus "+act_active[0]+""+act_active[1]+"\n";
}

function act_hide() {
	//$('output').value = $('output').value + "hide "+act_active[0]+""+act_active[1]+"\n";
	if (act_active[0] == 0 && act_active[1] == 0) {
		hideAll2();
		act_elements[0] = null;
		act_elements[1] = null;
	}
}

function hideAll() {
	$('menu').descendants().each(function(top) {
	 if(("subsubmenue" == top.className) & ("UL" == top.tagName)){
	    if(Element.visible(top)) {
	    	top.hide();
	    }
	 }
	});
}

function hideAll2() {
	$('menu').descendants().each(function(top) {
	 if(("subsubmenue" == top.className) & ("UL" == top.tagName)){
	    if(Element.visible(top)) {
	    	top.hide();
	    }
	 }
	});
}
// Sonderfaelle
function showPictures(pfad,pfadorig,height,width,title,index,maxindex){
//	var pic = new Image();
//	pic.src = pfad;
//	pic.onload = function(){
		//alert(this.src);
	//	$('inhalt_navi_pic').src = this.src;

		//$('galerie_weiter').onclick = 'javascript:showPictures("'+this.src+'",320,270);';
	//	$('galerielink').href = pfadorig;
	//	$('galerielink').title = title;

//	}

	for(var i=0;i<maxindex;i++){
        	$('referenz'+i).hide();
    	}
    	$('referenz'+index).show();
}

//<![CDATA[
   var geocoder;
   var map;
   var address = "Stahlstraße 39, Verl , DE";

function load_GMaps() {
  if (GBrowserIsCompatible()) {
      if(document.getElementById("map_g")){
        var map = new GMap2(document.getElementById("map_g"));
		map.enableScrollWheelZoom();
		map.addControl(new GSmallMapControl());
        map.setCenter(new GLatLng(51.873047,8.457842), 14);

        point = new GLatLng(51.873047,8.457842);
        marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml("<strong>Arnold Deppe GmbH & Co. KG</strong><br />Stahlstraße 39<br />33415 Verl ");
      }
  }
}

function addToMap(response) {

   }
//]]>
