// JavaScript Document

function ChangeLanguage(strLanguage)
{
	if (strLanguage=="manual") {
		
	}
	else
	{
		strPath = self.location.href;
		if (strPath.match("deu/")!=null) strPathNew=strPath.replace("deu/",strLanguage);
		else if (strPath.match("eng/")!=null) strPathNew=strPath.replace("eng/",strLanguage);
		else if (strPath.match("fra/")!=null) strPathNew=strPath.replace("fra/",strLanguage);
		else if (strPath.match("slo/")!=null) strPathNew=strPath.replace("slo/",strLanguage);
	}
	self.location.href=strPathNew
}

function getCookie(name){
   var i=0  //Suchposition im Cookie
   var suche = name+"="
   while (i<document.cookie.length){
      if (document.cookie.substring(i, i+suche.length)==suche){
         var ende = document.cookie.indexOf(";", i+suche.length)
         ende = (ende>-1) ? ende : document.cookie.length
         var cook = document.cookie.substring(i+suche.length, ende)
         return unescape(cook)
      }
      i++
   }
   return null
}

function newContact(lng,prodGr,land)
{
var strTitel;
var strAspParameter;
var beginn;
var ende;

	strTitel="BARTEC";

	if ((land==null) || (land=="") || (land==0))
		{
		if (getCookie("Land")==null)
			{
			strLand="1";
			}
		else
			{
			strLand=getCookie("Land");
			}
		}
	else
		{
		strLand=land;
		}

		
	//Locale Version
	///strAspParameter="http://localhost/contact/adresse.asp?lng=" + lng + "&Land=" + strLand + "&prodGr=" + prodGr + "&AussenD=True&InnenD=True&ProdM=True";
	//Web Version
	strAspParameter="http://www.bartec.de/contact/adresse.asp?lng=" + lng + "&Land=" + strLand + "&prodGr=" + prodGr + "&AussenD=True&InnenD=True&ProdM=True";
	var popUpContact=window.open(strAspParameter,strTitel,'width=600,height=560,menubar=no,location=no,toolbar=no,status=yes,resizable=no,scrollbars=yes');
	popUpContact.focus();
}

function setCountry(landID)
	{
	jetzt = new Date();
	Auszeit = new Date(jetzt.getTime() + 1*86400000);
	document.cookie = "Land="+landID+"; expires="+Auszeit.toGMTString()+"; path=/; domain=.bartec.de;"; 
	}
	
  var _gaq = _gaq || [];  _gaq.push(['_setAccount', 'UA-21393572-1']); _gaq.push(['_gat._anonymizeIp']); _gaq.push(['_trackPageview']);  (function() {    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);  })();
