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;
    }
  }
}


// function OpenBrWindow(theURL,winName,features) { //v2.0
//  open(theURL,winName,features);
// }

ieHover = function() { 
	if(document.getElementById('select_country') != null){
  var els=document.getElementById("reitermenu").getElementsByTagName("li"); 
  var maincount=0;
  for (var i=0;i<els.length;i++) {   

    if(els[i].className.substr(0,11)=='menu level1') maincount++;

    var activeat=3;
    if(COUNTRY_ID=='at') activeat=2;
    
    if(maincount>activeat)
    {
      els[i].onmouseover=function() { 
        this.className+=" iehover"; 
        document.getElementById('select_country').style.display='none';
      }
    } 
    else
    {
      els[i].onmouseover=function() { 
        this.className+=" iehover"; 
      }
    } 
    if(maincount>activeat)
    {
      els[i].onmouseout=function() { 
        this.className=this.className.replace(new RegExp(" iehover\\b"),""); 
        document.getElementById('select_country').style.display='block';
      } 
    }
    else
    {
      els[i].onmouseout=function() { 
        this.className=this.className.replace(new RegExp(" iehover\\b"),""); 
      } 
    }
  } 
  var els=document.getElementById("reitermenu").getElementsByTagName("a"); 
  for (var i=0;i<els.length;i++) { 
    els[i].onmouseover=function() { 
      this.className+=" iehover"; 
    } 
    els[i].onmouseout=function() { 
      this.className=this.className.replace(new RegExp(" iehover\\b"),""); 
    } 
  }
  }
} 

if(window.attachEvent) window.attachEvent("onload",ieHover);


/* 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;

	$("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;
		});
	}
	
	$('.pdf_download').hover(function(){
		$('.pdf_download_hint').css("left", ($(this).offset().left - 95)+"px").css("top", ($(this).offset().top+47)+"px").css("width", "225px").css("border", "1px solid #efefef").css("color", "#ffffff").css("padding", "5px").css("text-align", "left").css("z-index","10").fadeIn("fast");
	}, function(){
		$('.pdf_download_hint').fadeOut("fast");
	});
	
	$('#firmennamesearch input:text').focus(function(){
		$('#locationsearch input:text').val("");
	});

	$('#locationsearch input:text').focus(function(){
		$('#firmennamesearch input:text').val("");
	});
	
	if($('.altop_info').length > 0 && $('.more_info').length > 0)
	{
		$('.more_info').hover(function(){
			$('#info_' + $(this).parents("td").attr("id")).css("left", $(this).parents("td").offset().left).css("top", ($(this).offset().top + $(this).outerHeight() + 10)).fadeIn("fast");
		}, function(){
			$('#info_' + $(this).parents("td").attr("id")).fadeOut("fast");
		});
	}
	
});

