<!--

var calendarActive = false;
var tmpMonth = 0;
var tmpYear = 0;

var selDay = 0;
var selMonth = 0;
var selYear = 0;

function noemailspam(adrs,dmain,nme,clss) {      	
    // Function made by TheHPage DOT com
    
    // ### MAKE VARS ###
    var first = 'ma';
    var second = 'il';
    var third = 'to:';
    
    // ### MAILTO-PART ###
    ausgabe = '<a href="';
    ausgabe = ausgabe+first+second+third;
    ausgabe = ausgabe+adrs+'&#64'+dmain;
    ausgabe = ausgabe+'">';
    
    // Check: Insert Style-Class? PART 1
    if(clss != ''){
        ausgabe = ausgabe+'<span class="'+clss+'">';    
    }
    
    // ### Check: Show E-Mail or Name? ###
    if(nme != ''){
        ausgabe = ausgabe+nme;
    } else {
        ausgabe = ausgabe+adrs+'&#64'+dmain;
    }    
    
    // Check: Insert Style-Class? PART 2
    if(clss != ''){
        ausgabe = ausgabe+'</span>';
    }
    
    // ### FINISH IT ###    
    ausgabe = ausgabe+'<\/a>';
    document.write(ausgabe);
}  

function bildanzeigen(fenster,name,weite,hoehe) {
	
// Version 1.2 vom 07.02.2006

		var g_fIsSP2 = false; //Für IE mit SP2.
		var xpos = screen.availWidth/2 - (weite/2);
		var ypos = screen.availHeight/2 - (hoehe/2);
		weite += 6;	
		
		if (navigator.appName.indexOf("Explorer") != -1) { 
			
	 		hoehe += 29; 	
	 		status = "no";
	 
	 		g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1); //SP2?
   				if (g_fIsSP2)
   					{
   						hoehe += 27; //Für IE mit SP2. Kann Statusbar nicht ausblenden
   						status = "yes";
   					}
		}
		else { hoehe += 45; status = "yes"; } // alle anderen
			
	
  		
		
        img = window.open('/zoom.php?image='+name,fenster,'width='+weite+',height='+hoehe+',menubar=no,locationbar=no,statusbar='+status+',screenX='+xpos+',screenY='+ypos+',scrollbars=no');
		
		img.resizeTo(weite,hoehe);
		img.focus()
		
	  	if (img) return false;
  		else return true;
} 


function info_popup(datei) {
    window.open(datei,'Info-Fenster','width=550,height=450,menubar=no,locationbar=no,screenX=0,screenY=0,scrollbars=yes');
}

function toggleList(sId) {
  if(document.getElementById('list_content_'+sId)) {
    oDiv = document.getElementById('list_content_'+sId);
    oRow = document.getElementById('list_row_'+sId)
    if(oDiv.style.display == "none") {
      oDiv.style.display = "block"; 
      oRow.className = "list_title_row_active";
    } else {
      oDiv.style.display = "none"; 
      oRow.className = "list_title_row";
    }
  } 
}

function toggleQuestion(sId) {
  if(document.getElementById('faq_answer_'+sId)) {
    oDiv = document.getElementById('faq_answer_'+sId);
    oRow = document.getElementById('faq_row_'+sId)
    if(oDiv.style.display == "none") {
      oDiv.style.display = "block"; 
      oRow.className = "faq_question_active";
    } else {
      oDiv.style.display = "none"; 
      oRow.className = "faq_question";
    }
  } 
}

function showZoom(sDiv) {
  if(document.getElementById(sDiv)) {
    oDiv = document.getElementById(sDiv);
    oDiv.style.display = "block";
  } 
}

function hideZoom(sDiv) {
  if(document.getElementById(sDiv)) {
    oDiv = document.getElementById(sDiv);
    oDiv.style.display = "none";
  } 
}

function toggleForm() {
	oBox = document.getElementById("contact_block");
	oCheck_1 = document.getElementById("angebot");
	oCheck_2 = document.getElementById("info");
	if(oCheck_1.checked || oCheck_2.checked) {
  	oBox.style.display = "block";
  } else {
  	oBox.style.display = "none";
  }
}

function init(sPage) {
  if(sPage == 'prices' || sPage == 'contact') {
		if(document.getElementById("webdesign").value == "1") {
			document.getElementById("div_webdesign").style.display = "block";
			document.getElementById("annotation_1").style.display = "none";
			document.getElementById("annotation_2").style.display = "block";
		} else {
			document.getElementById("div_webdesign").style.display = "none";
			document.getElementById("annotation_1").style.display = "block";
			document.getElementById("annotation_2").style.display = "none";
		}
		
		toggleForm();
		calculate();
  } 
}

function openWindow(sUrl,iWidth,iHeight,sWindow) {

	var g_fIsSP2 = false;
	iWidth += 6;	

	if (navigator.appName.indexOf("Explorer") != -1) { 
 		iHeight += 29; 	
 		sStatus = "no";
    g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1); //SP2?

 		if (g_fIsSP2) {
      iHeight += 27;
 			sStatus = "yes";
    }
	}	else {
	  iHeight += 45;
	  sStatus = "yes";
	}

	var xPos = screen.availWidth/2 - (iWidth/2);
	var yPos = screen.availHeight/2 - (iHeight/2);

	oWindow = window.open(sUrl,sWindow,'width='+iWidth+',height='+iHeight+',menubar=no,locationbar=no,statusbar='+sStatus+',screenX='+xPos+',screenY='+yPos+',scrollbars=yes,resizable=yes');
	oWindow.focus();

  return oWindow;
} 

function openApp(sType,sLang) {
  if(sType == 'webmaster') {
    if(sLang == "en") {
      winWebmaster = openWindow('http://webmaster.addressdialog.com/webmaster/demo?language=en',668,740,'winWebmaster');  
    } else {
      winWebmaster = openWindow('http://webmaster.addressdialog.com/webmaster/demo?language=de',668,740,'winWebmaster');  
    }
  } else if(sType == 'flashdemo') {
    winFlashdemo = openWindow('/flashdemo/',600,550,'winFlashdemo');
  } else if(sType == 'manual') {
    winManual = openWindow('/go/handbuch.html',820,800,'winManual');
  } else if(sType == 'stoerer') {
    winStoerer = openWindow('http://go.addressdialog.com/3758543C96/invite',540,770,'winStoerer');
  }
}

function openExample(sType) {
    
  iWidth = screen.availWidth;
  iHeight = screen.availHeight;	

  iWidth = Math.round(iWidth * 0.8);
  iHeight = Math.round(iHeight * 0.8);	
	
  if(sType == 'analysis') {
    winAnalysis = openWindow('http://my.addressdialog.com/reporting/IPMTL', iWidth, iHeight,'winAnalysis');
  } else {
    winLandingpage = openWindow('http://go.addressdialog.com/IPMTL/DEMO', 716, 800,'winLandingpage');
  }
}

function openHomepage(sId,sCode) {
  if(sId == '1') {
    sUrl = 'http://go.addressdialog.com/805BAC73FD/' + sCode;
  } else if(sId == '2') {
    sUrl = 'http://go.addressdialog.com/5D4003A1DC/' + sCode;
  }
  
  winHomepage = openWindow(sUrl,668,740,'winHomepage');
}

function showCalendar(sId) {
  if(document.getElementById('calendar_'+sId)) {
    cal = document.getElementById('calendar_'+sId);
    
    cal.onmouseover = function() {
      calendarActive = true; 
    }
    
    cal.onmouseout = function() {
      calendarActive = false;  
    }
    
    cal.style.display = "block";
    
    oMonth = document.getElementById('span_'+sId+'Month');
    oMonth.innerHTML = document.getElementById(sId+'Month').value;
    
    document.getElementById('pos_body').onmousedown = function() {
      hideCalendar(sId);
    } 
    
    iDay = eval(document.getElementById(sId+"Day").value);
	  iMonth = eval(document.getElementById(sId+"Month").value);
	  iYear = eval(document.getElementById(sId+"Year").value);
	  
	  selDay = iDay;
	  selMonth = iMonth;
	  selYear = iYear;
	  
  	tmpMonth = iMonth;
  	tmpYear = iYear;
    
    drawCalendar(sId,iMonth,iYear);
  }
}

function hideCalendar(sId) {
  if(calendarActive == false) {
    if(document.getElementById('calendar_'+sId)) {
      cal = document.getElementById('calendar_'+sId);
      cal.style.display = "none";    
    }
  }
}

function getDate(sId) {
  matches = document.getElementById(sId).value.split(".");
  return {day : matches[0], month : matches[1], year : matches[2]};
}

function setDate(sId, day, month, year) {
  day = (day != undefined && day != '')?eval(day):eval(document.getElementById(sId+"Day").value);
	month = (month != undefined && month != '')?eval(month):eval(document.getElementById(sId+"Month").value);
	year = (year != undefined && year != '')?eval(year):eval(document.getElementById(sId+"Year").value);

	if(month > 12) {	month = 12; }
  if(month < 10) { month = '0' + month;	}

  daysInMonth = 32 - new Date(year, (month-1), 32).getDate();

	if(day > daysInMonth) { day = daysInMonth;	}
  if(day < 10) { day = '0' + day;	}

  sel = document.getElementById(sId+"Month");
  for(i=0;i<sel.length;i++) {
    if(sel[i].value == month) {
      sel.selectedIndex = i;
    }
  }

  document.getElementById(sId+"Day").value = day
  document.getElementById(sId+"Year").value = year;
  document.getElementById(sId).value = day + "." + month + "." + year;

  calculate();
  

  calendarActive = false; 

  hideCalendar(sId);
}

function drawCalendar(sId,iMonth,iYear) {
  
  sMonth = aMonths[iMonth-1];
  if(iMonth < 10) { iMonth = '0' + iMonth;	}
  
  oMonth = document.getElementById('span_'+sId+'Month');
  oMonth.innerHTML = sMonth + ' ' + iYear;

  iTotalDays = getDaysInMonth(iMonth);
  iLastDays = getDaysInMonth(iMonth-1);
  iWeekDay = getWeekDay(1,iMonth,iYear);
  iCount = 0;
  
  listDays = '<ul>';
  for(i=1;i<=iWeekDay;i++) {
    iNow = iLastDays - (iWeekDay - (i+1));
    listDays += '<li class="inactive"><span>'+iNow+'</span></li>';
    iCount++;
  }
  for(i=1;i<=iTotalDays;i++) {
    if(i == selDay && iMonth == selMonth && iYear == selYear) {
      sStyle = ' style="background: #fc0;"'; 
    } else {
      sStyle = ''; 
    }
    listDays += '<li><a href="javascript:setDate(\''+sId+'\','+i+','+iMonth+','+iYear+')"'+sStyle+'>'+i+'</a></li>';
    iCount++;
  }
  
  iLast = (Math.ceil(iCount/7)*7)-iCount;
  for(i=1;i<=iLast;i++) {
    listDays += '<li class="inactive"><span>'+i+'</span></li>';
  }
  listDays += '</ul>';
  listDays += '<div class="clearboth"><img src="/webmaster/images/blank.gif" width="0" height="0" alt="" /></div>';

  oDays = document.getElementById('div_'+sId+'Days');
  oDays.innerHTML = listDays;
  
}

function getDaysInMonth(iMonth) {
  if(iMonth == '01' || iMonth == '03' || iMonth == '05' || iMonth == '07' || iMonth == '08' || iMonth == '10' || iMonth == '12') {
    iDaysInMonth = 31; 
  } else if(iMonth == '02') {
    if(((iYear % 4 == 0 && iYear % 100 != 0)  || iYear % 400 == 0)) {
      iDaysInMonth = 29;
    } else {
      iDaysInMonth = 28;
    }  
  } else {
    iDaysInMonth = 30; 
  }
  
  return iDaysInMonth;
}

function getWeekDay(iDay, iMonth, iYear) {

  startDays = Array(0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4);
  iYear -= iMonth < 3;
  aDays = Array('mo','di','mi','do','fr','sa','so');
  iRet = Math.floor((iYear + iYear/4 - iYear/100 + iYear/400 + startDays[iMonth-1] + iDay) % 7);
  
  iRet -= 1;
  if(iRet < 0) {
    iRet = 6; 
  }
  
  return iRet;  
}

function setMonth(sDir,sId) {

	if(sDir == 'left') {
	  if(tmpMonth > 1) {
	    tmpMonth--;
	    tmpYear = tmpYear;
	  } else {
	    tmpMonth = 12;
	    tmpYear--; 
	  }
	} else {
	  if(tmpMonth < 12) {
	    tmpMonth++;
	    tmpYear = tmpYear;
	  } else {
	    tmpMonth = 1;
	    tmpYear++; 
	  }
	}
  
  drawCalendar(sId,tmpMonth,tmpYear);

}
