// JavaScript Document

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)
{
var strTitel;
var strAspParameter;
var beginn;
var ende;

	strTitel="BARTEC";

	//Locale Version
	//strAspParameter="http://localhost/contact/adresse.asp?lng=" + lng + "&Land=" + getCookie("Land") + "&prodGr=" + prodGr + "&AussenD=True";

	//Web Version
	if (getCookie("Land")==null)
		{
		strLand="1";
		}
	else
		{
		strLand=getCookie("Land")
		}
	strAspParameter="http://www.bartec.de/contact/adresse.asp?lng=" + lng + "&Land=" + strLand + "&prodGr=" + prodGr + "&AussenD=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 + ";";	
	}