function Go(x, neuesfenster) {
  if(x == "0") {
    document.forms["quicknav"].reset();
    document.forms["quicknav"].elements["Auswahl"].blur();
    return;
  } else {
    if (neuesfenster) {
      mywin = open(x, 'newwindow', 'width=760,height=550,screenX=30,screenY=30,resizable=yes,location=yes,scrollbars=yes,menubar=yes,toolbar=yes,status=yes');
      mywin.focus();
    } else {
      location.href = x;
    }
  }
}

/* All you need to have a notice hover underneath links to airliquide.com */

function notify_user(trg){
	$("#"+trg.id).parent().append("<div id=\"dot_com_notice\" style=\"display:none;\"></div>");
	var curleft = curtop = 0;
	if (trg.offsetParent) {
		curleft = trg.offsetLeft
		curtop = trg.offsetTop
		while (trg = trg.offsetParent) {
			curleft += trg.offsetLeft
			curtop += trg.offsetTop
		}
	}
	$("#dot_com_notice").append("<b>Achtung:</b><br />&Uuml;ber diesen Link erreichen Sie Informationen auf unserer <b>englischsprachigen</b> Konzernseite www.airliquide.com").css("position", "absolute").css("left", curleft+"px").css("top", (curtop+15)+"px").css("width", "200px").css("background-color", "#0092DD").css("color", "#ffffff").css("padding", "5px").css("text-align", "left").css("z-index","10").css("display", "block");
}

function hide_notification(){
	$("#dot_com_notice").remove();
}

$(document).ready(function(){
	var linkCount = 0;

	if(document.URL.search(/\/en\//) == -1)
	{
		$("a[href*='airliquide.com']").each(function(){
			$(this).attr("id", "dot_com_link_"+linkCount).attr("target", "_new").css("target-new", "tab").mouseover(function(){notify_user(this)}).mouseout(function(){hide_notification();});
			linkCount++;
		});
		$("a[href*='@airliquide.com']").each(function(){
			$(this).unbind("mouseover").unbind("mouseout");
			linkCount++;
		});
	}
	
	if($('.kategorie_selector').length > 0)
	{
		$('.kategorie_selector select').change(function(){
			new_url = "http://"+window.location.host+window.location.pathname+"?kategorie="+$(this).val();
			window.location.href = new_url;
		});
	}
	
	$('#firmennamesearch input:text').focus(function(){
		$('#locationsearch input:text').val("");
	});

	$('#locationsearch input:text').focus(function(){
		$('#firmennamesearch input:text').val("");
	});

	$('#reitermenu li.level1').hover(function(){
		$(this).children('ul').addClass("iehover");
		$(this).find('.level2').addClass("iehover");
	}, function(){
		$(this).children('ul').removeClass("iehover");
		$(this).find('.level2').removeClass("iehover");
	});

	$('#reitermenu li.level1 li.level2 a').hover(function(){
		$(this).addClass("iehover");
	}, function(){
		$(this).removeClass("iehover");
	});
	
});

