// JavaScript Document

function ChangeLanguage(strLanguage)
{
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);

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=796,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() + 365*86400000);
	document.cookie = "Land="+landID+"; domain=.bartec.de; path=/; expires="+Auszeit.toGMTString()+";"; 
	//alert("Land"+"="+landID+"; expires="+Auszeit.toGMTString()+";");
	//document.cookie  ="Land=" + landID + ";";	
	}