// spezielle Javascript Library für dieses Projekt 

function tB_PopupWindow(popWinURL,popWinName,popWinFeatures,popWinWidth,popWinHeight)
 {
   popWinx = (((window.screen.height - popWinHigher) / 2) - (popWinHeight / 2));
   popWiny = ((window.screen.width / 2) - (popWinWidth / 2));

   popWinAttributes = popWinFeatures + ',width='+popWinWidth+',height='+popWinHeight+',top='+popWinx+',left='+popWiny;
  
	tB_Window = window.open(popWinURL,popWinName,popWinAttributes);  
	if (tB_Window.opener == null) { // for Nav 2.0x 
		tB_Window.opener = self // this creates and sets a new property 
	}
 
	//tB_Window.window.focus();
 }


function CheckDatum(sWert)
{
	//alert(sWert)
	var txt_muster =/\d\d.\d\d.\d\d/;

	if (txt_muster.exec(sWert)) 
		{
		sTag = sWert.substring(0,2)
		sMonat = sWert.substring(3,5)
		sJahr = sWert.substring(6,8)
		//alert (sTag)
		//alert (sMonat)
		//alert (sJahr)
		if (sTag >= 1 && sTag <= 31)
			{
			if (sMonat >= 1 && sMonat <= 12)
				{
				if (sJahr >= 3 && sJahr <= 99)
					{
					if (sMonat == 1 || sMonat == 3 || sMonat == 5 || sMonat == 7 || sMonat == 8 || sMonat == 10 || sMonat == 12)
						//alert ("Werte ok")
						return true
					else
						{
						if (sMonat == 4 || sMonat == 6 || sMonat == 9 || sMonat == 11)
							{
								if (sTag <= 30)
									//alert ("werte ok")
									return true
								else
									//alert ("monat hat nur 30 tage")
									return false
							}
						else
							{
							if (sTag <= 28)
								//alert ("werte ok")
								return true
							else
								{
								if (sJahr % 4 == 0 )
									{ 
										if (sJahr % 100 == 0 )
											{
											if (sJahr % 400 == 0)
												{
												if (sTag <= 29)
													//alert ("werte ok")
													return true
												else
													//alert ("schaltjahr - monat hat 29 Tage")
													return false
												}
											else
												{
												if (sTag <= 28)
													//alert ("werte ok")
													return true
												else
													//alert ("kein schaltjahr - monat hat 28 Tage")
													return false
												}
											}
										else
											{
											if (sTag <= 29)
												//alert ("werte ok")
												return true
											else
												//alert ("schaltjahr - monat hat 29 Tage")
												return false
											}
										
									}
								else
									{
									if (sTag <= 28)
										//alert ("werte ok")
										return true
									else
										//alert ("kein schaltjahr - monat hat 28 Tage")
										return false
									}
								}
							}
						}
					}
				else
					//alert ("Falsches Jahr")
					return false
				}
			else
				//alert ("Falsches Monat")
				return false
			}
		else
			//alert ("Falscher tag")
			return false
		}
	else
		return false
}




