﻿function setPadding() {

    var ulList = document.getElementsByTagName('UL');
    var mainLi;
    var subUl;
    for (i=0;i<ulList.length;i++) {
        if (ulList[i].className=='mainMenu') {                                         
            var mainLis = ulList[i].getElementsByTagName("a");
            for (e=0;e<mainLis.length;e++) {
                if (mainLis[e].className=='mainMenuover') mainLi=mainLis[e];
            }
        }
        if (ulList[i].className=='submenu') subUl = ulList[i];
    }
    
    if (mainLi) {
        var xCont = findPosX(document.getElementById('container'));
        var x = findPosX(mainLi);
        if (x > 0) {
            if(navigator.appName.indexOf("Explorer") != -1) {
                //x -= 325;
                x -= xCont + 194;
            } else {
                x -= xCont + 18;
            }
            if (subUl) subUl.style.marginLeft=x+'px';
        }
    }
}

function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

function send_route()
{
    window.open('http://link2.map24.com/?newroute=1&sstreet=' + document.getElementById('sstreet').value + '&szip=' + document.getElementById('szip').value + '&scity=' + document.getElementById('scity').value + '&scountry=' + document.getElementById('scountry').value + '&dstreet=Birkfelder%20Straße%2037&dzip=8160&dcity=Weiz&dcountry=AU&mid=LINK2&lid=a36ca77b');
}

	function send_newsletter(mid)
{
	if (mid == null) mid = '401';
location.href='?menueid='+mid+'&mail=' + document.getElementById('email').value;

}
