// Klasse zur Aufnahme von einzelnen Bereichen - SubSub-Einträge
function class_Menu( c_m_id , sName ){
// Container für alle Menü's und deren Untermenüs
	var Values			= new Array();
	Values["index"]		= c_m_id ;
	Values["id"]		= getID( c_m_id , 1 , 1 ) ;
	Values["name"]		= sName ;
	Values["sub"] 		= new Array() ;
	Values["subid"]		= new Array() ;
	Values["subnav"]	= new Array() ;
	Values["subsub"]	= new Array() ;
	Values["subsubid"]	= new Array() ;
	Values["subsubnav"]	= new Array() ;
	this.Value			= Values ;
	this.MenuCode		= "" ;
	this.SubCode		= "" ;
	this.SubsubCode		= new Array() ;
}

function class_Content( sID , sPath , i , j , k , Logo , Header , Content ){
	var Value = new Array() ;
	Value["header"] = Header ;
	Value["content"] = Content ;
	Value["logo"] = Logo ;
	Value["Logo"] = "" ;
	this.Value = Value ;
	var parts = sPath.split( "_" ) ;
	this.Menu = parts[0];
	this.Sub = parts[1];
	this.Subsub = parts[2];
	this.Path = sPath ;
	this.Id = sID ;
	this.Id1 = i ;
	this.Id2 = j ;
	this.Id3 = k ;
	this.Logo = "<img class='logo_2' src='" + Logo + "'>" ;
	this.Header = Header ;
	this.Content = Content ;
	this.SubsubLink = "<a href='javascript:showContent("+sID+")'>"+parts[0]+"</a>" ;
	this.SubLink = "<a href='javascript:showContent("+getID( i , j , 1)+")'>"+parts[0]+"</a>" ;
	this.MenuLink = "<a href='javascript:showContent("+getID( i , 1 , 1)+")'>"+parts[0]+"</a>" ;	
}


function class_Navigator( sID , sPath , i , j , k , sTab_M , sTab_SM , sTab_SSM ){
// Container für Navigation - 2 Navigatoren je Seite ( ID und Nav )
// Ein Navigator per Seitennummer, einer per Menüpfad
	var Element = sPath.split( sSep );
	this.ID 		= sID ;
	this.Path 		= sPath ;
	this.Menu		= Element[0] ;
	this.Sub		= Element[1] ;
	this.Subsub		= Element[2] ;
	this.Mid		= i ;
	this.Smid		= j ;
	this.Cid		= k ;
	this.MenuCode	= sTab_M ;
	this.SubCode	= sTab_SM ;
	this.SubsubCode	= sTab_SSM ;
	this.Header 	= gsHeader ;
	this.Content	= gsContent ;
	this.Logo 		= "" ;
	this.CurUser	= USER.Benutzername ;
	var Val			= new Array();
	Val["header"]	= gsHeader ;
	Val["content"]	= gsContent ;
	Val["bgimg"]	= gsBgimg  ;
	Val["logo"]		= "" ;
    Val["access"]	= "" ;
    Val["id"]		= sID ;
    Val["menu"]		= Element[0] ;
    Val["sub"]		= Element[1] ;
    Val["subsub"]	= Element[2] ;
	Val["m"]		= sTab_M ;
	Val["sm"]		= sTab_SM ;
	Val["ssm"]		= sTab_SSM ;
    Val["imp"]		= impLink ;
    Val["m_id"]		= "" ;
    Val["sm_id"]	= "" ;
    Val["ssm_id"]	= "" ;
    Val["curuser"]	= USER.Benutzername ;
	Val["curaccess"]= USER.Rolle ;
    this.Value 		= Val ;
 
	//alert(sID + " = " + sPath + "\nMenu: " + Element[0] + "\nSub: " + Element[1] + "\nSubsub: " + Element[2] + "\n\n" + Element );
}

function class_Termin( sDate ){
// Container für Termineintragungen
// Ergebnis ist ein assoziatives Array nach Datum
	this.DateOnly	= sDate ;
	this.Date 		= new class_Date( sDate ) ;
	//
	this.Partner	= new Array() ;
	this.Type		= new Array() ;
	this.Title		= new Array() ; // Titel des Termines
	this.Programm	= new Array() ; // "Blues, Folk & Fun" 
	this.Projekt	= new Array() ; // AlbTräumer, Knitz und liederlich, Almanach, Grupo Sal...
 	this.Image	= new Array() ; // Grafik
	this.DateType	= new Array() ; // extern , intern
	this.Time 		= new Array() ;	
	this.Place		= new Array() ;
	this.Street		= new Array() ;
	this.ZIP		= new Array() ;
	this.City		= new Array() ;
	this.Map24		= new Array() ;
	this.Desc		= new Array() ; 
	this.Access		= new Array() ; // Admin , Schueler, Veranstalter, Besucher
	this.Country	= new Array() ; // Deutschland
	this.Domain		= new Array() ; // de
	this.Durance	= new Array() ;
	this.Disp		= new Array() ; // Ein kompletter Termin
	this.Disp1		= new Array() ; // Termin einzeilig
	this.Disp2		= new Array() ; // Termin zweizeilig
	this.Disp3		= new Array() ; // Termin dreizeilig
	this.Disp4		= new Array() ; // Termin vierzeilig
	this.Disp5		= new Array() ; // Termin vierzeilig
	this.DispDay1	= "" ;			// Alle Termine eines Tages einzeilig
	this.DispDay2	= "" ;			// Alle Termine eines Tages zweizeilig
	this.DispDay3	= "" ;			// Alle Termine eines Tages dreizeilig
	this.DispDay4	= "" ;			// Alle Termine eines Tages mit Beschreibung
	this.DispDay5	= "" ;			// Alle Termine eines Tages als Abschnitt
}

function class_Date( sDate ){
	var Part		= sDate.split( "." );
	var Datum		= new Date( Part[2] , Part[1] -1 , Part[0] );
	var Heute 		= new Date() ;
	Monat 			= new class_Month() ;
	Woche			= new class_Week() ;
	//
	this.Heute 		= Heute ;
	this.Text		= sDate ;
	this.CurYear	= Heute.getFullYear() ;
	this.CurMonName	= Monat.Name[Heute.getMonth()];	
	this.CurMonth	= Monat.Shorty[Heute.getMonth()];	
	
	if( Heute.getDate < 10 ){ this.CurDay = "0" + Heute.getDate  }else{ this.CurDay 	= Heute.getDate() ; }	
	this.CurDateOnly= this.CurDay + "." + this.CurMonth + "." + this.CurYear ;
	this.CurWeekday	= Woche.Dayname[Heute.getDay()];
	this.CurFullDate= this.CurWeekday + ", " + this.CurDateOnly ; 
	
	this.Part 		= Part ; 
	this.Datum		= Datum ;
	this.Day 		= Part[0] ;
	this.Month		= Part[1] ;
	this.Year		= Part[2] ;
	this.DateOnly	= this.Day + "." + this.Month + "." + this.Year ;
//	alert( this.CurDateOnly + " = " + this.DateOnly ) ;
	if( this.CurDateOnly == this.DateOnly ){ this.IsToday = true ; }else{ this.IsToday = false ; }
	this.Weekday	= Woche.Dayname[Datum.getDay()]; 
	this.FirstDate	= new Date( Part[2] , Part[1] , 1 ) ;	
	this.LastDate	= getEndOfMonth( Part[2] , Part[1] ) ;
}

function class_DatePicker( iYear , iMonth ){
//alert( "class_DatePicker(" + iYear + " , " + iMonth + ")" ) ;
	TerminMonth	= new Array() ;	
	countTermin	= 0 ;
	Monat 		= new class_Month() ;
	Woche 		= new class_Week() ;
	Heute 		= new Date() ;
	//
	this.Dates	= "" ;
	//
	if( Heute.getDate() < 10 ){ sCurDate = "0" + Heute.getDate() }else{ sCurDate = "" + Heute.getDate()}
	if( Heute.getMonth() < 9 ){ sCurMonth = "0" + parseInt(Heute.getMonth() + 1) ; }else{ sCurMonth = "" + parseInt(Heute.getMonth() + 1) ;}
	sFullYear = Heute.getFullYear() ;
	var curDateOnly = sCurDate + "." + sCurMonth + "." + sFullYear ;
	//	
	sMonth = Heute.getMonth() +1;
	if( parseInt(sFullYear) == iYear && parseInt( sMonth ) == iMonth - 1 ){ this.IsCurrent = true;  }else{ this.IsCurrent = false; }
	this.Month	= iMonth ;				// 1 = Januar ---> 12 = Dezember
	if( this.Month < 10){ sMonth = "0" + iMonth }else{ sMonth = "" + iMonth }	
	this.FullYear	= iYear ;				// als 4stellige Zahl
	if( iMonth == 1 ){ this.PrevMonth = 12; this.PrevYear = parseInt( iYear - 1)  }else{ this.PrevMonth = iMonth - 1 ; this.PrevYear = iYear }
	if( iMonth == 12 ){ this.NextMonth = 1; this.NextYear = parseInt( iYear + 1 ); }else{  this.NextMonth = parseInt( iMonth + 1) ; this.NextYear = iYear }
	if( iYear >= 2000 && iYear < 2010 ){ 
		this.Year = "0" + ( iYear - 2000 ) ;
	}else if( iYear < 2000 ){
		this.Year = "" + ( iYear - 1900 ) ;
	}else{
		this.Year = "" + ( iYear - 2000 ) ;
	}
//alert( "Aktuelles Jahr: " +  this.Year + "\n" + "Vorheriger Monat: " + this.PrevMonth + " - " + this.PrevYear + "\n" + this.NextMonth + " - " + this.NextYear   ) ;
	this.FirstDate	= new Date( iYear , iMonth -1 , 1 ) ;
	this.FirstDay	= this.FirstDate.getDay() ;		// 0= Sonntag ---> 6 = Samstag
//alert( "Wochentag des ersten Tages("+this.FirstDate+"): " + this.FirstDay );
	this.LastDate	= getEndOfMonth( iYear , iMonth ) ;
//alert( "Letzter Tag des Monates: " +  this.LastDate ) ;
	this.LastDay	= this.LastDate.getDay() ;		// 0= Sonntag ---> 6 = Samstag
	if( iMonth == 3 ){ this.CountDays = 31 ; }else{ this.CountDays = this.LastDate.getDate() ;}		// Anzahl der Tage des Monates
//alert( "Anzahl der Monatstage: " +  this.CountDays ) ;
	this.MonthName	= Monat.Name[parseInt( this.FirstDate.getMonth() ) ];	// Monatsname im Volltext
//alert( "Monatsname: " +  this.MonthName) ;
	this.MonthHeader	= this.MonthName + " " + this.Year ;
	if( this.CountDays == 28 && this.FirstDay == 1 ){ this.CountWeeks = 4; }else{ this.CountWeeks = 5; }
	if( this.CountDays == 30 && this.FirstDay == 0 ){ this.CountWeeks = 6; }
	if( this.CountDays == 31 && ( this.FirstDay == 0 ||  this.FirstDay == 6 ) ){ this.CountWeeks = 6; }
//alert( "Anzahl der Wochen: " +  this.CountWeeks ) ;
	// Zusammenbau des Codes für den Datepicker => komplette Tabelle
	var day_counter = 0 ;
	// Öffnen der Tabelle
	var cal_row = 1 ;
                var table = "<table>" ;
	var bFound = false ;
	// Navigationskopf der Tabelle
		table = table + "<tr><td class='cal_off'><a href='javascript:showDatesByMonth( "+this.PrevYear+" , " + this.PrevMonth + " , \"\" );'><=</a></td>" ;
		table = table + "<td class='cal_off' colspan=5 id='DP_month'><a href='javascript: showDatesByMonth( " + iYear + " , " + iMonth + " , \"\" );' >"+this.MonthHeader+"</a></td>" ;
		table = table + "<td class='cal_off'><a href='javascript:showDatesByMonth( "+this.NextYear+" , " + this.NextMonth + " , \"\" );'>=></a></td><tr>" ;
		table = table + "<tr>" ;
			table = table + "<td class='cal_off'>Mo</td>" ;
			table = table + "<td class='cal_off'>Di</td>" ;
			table = table + "<td class='cal_off'>Mi</td>" ;
			table = table + "<td class='cal_off'>Do</td>" ;
			table = table + "<td class='cal_off'>Fr</td>" ;
			table = table + "<td class='cal_off'>Sa</td>" ;
			table = table + "<td class='cal_off'>So</td>" ;
		table = table + "</tr>" ;
//	alert( " Die Wochen berechnen... " + this.CountWeeks );
		for( cal_row == 1 ; cal_row <=  this.CountWeeks ; cal_row++ ){
			table = table + "<tr>" ;
//alert( "Woche " + cal_row ) ;
			var iCell = 0 ;
				for( iCell = 0 ; iCell < 7 ; iCell++ ){					
					if( ( parseInt( cal_row) == 1)  ){						
						//alert( " Überprüfen, ab welcher Zelle in der ersten Reihe ein Datum zu erscheinen hat... "  );
						if( ( iCell == 0 && this.FirstDay == 1) || ( iCell == 1 && this.FirstDay == 2 ) || ( iCell == 2 && this.FirstDay == 3) || ( iCell == 3 && this.FirstDay == 4) || ( iCell == 4 && this.FirstDay == 5) || ( iCell == 5 && this.FirstDay == 6) || ( iCell == 6 && this.FirstDay == 0) ){ 
							day_counter++;
							bFound 		= true ;							
							if(day_counter < 10){ sDate = "0" + day_counter ; }else{ sDate = "" + day_counter + "" ; }							
							table = table + compareDateOnly( curDateOnly , sDate + "." + sMonth + "." + iYear ) ;	
							//alert( "checkDate:\n\n" + getLink( "checkDate" , this.FullYear + "" , this.Month + "" , day_counter )) ;											
							table = table + getLink( "checkDate" , iYear + "" , this.Month + "" , day_counter ) ;	
							if( day_counter <= 9 ){ table = table + "0" + day_counter ; }	
							table = table + "</a>" ;													 
						}else{ 
							if( day_counter == 0 ){ 
								table = table + "<td class='cal_off' >&nbsp;" ;
							}else{
								day_counter++ ; 								
								if(day_counter < 10){ sDate = "0" + day_counter ; }else{ sDate = "" + day_counter + "" ; }
								table = table + compareDateOnly( curDateOnly , sDate + "." + sMonth + "." + iYear ) ;						
								table = table + getLink( "checkDate" , iYear + "" , this.Month + "" , day_counter ) ;
								table = table + "0" + day_counter ;
								table = table + "</a>" ;
							}  
						}
					}else{
						day_counter++;
						
						if(day_counter < 10){ sDate = "0" + day_counter ; }else{ sDate = "" + day_counter ; }
						table = table + compareDateOnly( curDateOnly , sDate + "." + sMonth + "." + iYear ) ;	
						if( day_counter <= this.CountDays ){					
							table = table + getLink( "checkDate" , iYear + "" , this.Month + "" , day_counter + "" ) ;
							if( day_counter < 10 ){ table = table + "0" + day_counter ;  }	
							if( day_counter >= 10 && day_counter <= this.CountDays ){ table = table + "" + day_counter ;  }else{ if(day_counter >= 10){ table = table + "&nbsp;" ;} }		
							table = table + "</a>" ;
						}else{
							table = table + "&nbsp;"
						}
					}

					table = table + "</td>" ;
//alert( "Woche " + cal_row + " => Zelle " + iCell + "\n\n" + table);
				}

			table = table + "</tr>" ;
		}
			table = table + "<tr></tr>" + 
			"<tr><td class=sm_off colspan = 7><a href='javascript: showDatesByMonth( "+iYear+" , "+this.Month+" , \"Die AlbTräumer\");' onmouseover='if(omo == 1){showDatesByMonth( "+iYear+" , "+this.Month+" , \"Die AlbTräumer\")}'>Die AlbTräumer</a></td></tr>" +
			"<tr><td class=sm_off colspan = 7><a href='javascript: showDatesByMonth( "+iYear+" , "+this.Month+" , \"Grupo Sal\");' onmouseover='if(omo == 1){showDatesByMonth( "+iYear+" , "+this.Month+" , \"Grupo Sal\")}'>Grupo Sal</a></td></tr>" +
			"<tr><td class=sm_off colspan = 7><a href='javascript: showDatesByMonth( "+iYear+" , "+this.Month+" , \"Das Ohrchester\" );' onmouseover='if(omo == 1){showDatesByMonth( "+iYear+" , "+this.Month+" , \"Das Ohrchester\")}' >Das Ohrchester</a></td></tr>" +
			"<tr><td class=sm_off colspan = 7><a href='javascript: showDatesByMonth( "+iYear+" , "+this.Month+" , \"the s(w)inging flute\" );' onmouseover='if(omo == 1){showDatesByMonth( "+iYear+" , "+this.Month+" , \"the s(w)inging flute\")}'>the s(w)inging flute</a></td></tr>" +
			"<tr><td class=sm_off colspan = 7><a href='javascript: showDatesByMonth( "+iYear+" , "+this.Month+" , \"Bibel für Schwoba\" );' onmouseover='if(omo == 1){showDatesByMonth( "+iYear+" , "+this.Month+" , \"Bibel für Schwoba\")}'>Bibel für Schwoba</a></td></tr>" +
			"<tr><td class=sm_off colspan = 7><a href='javascript: showDatesByMonth( "+iYear+" , "+this.Month+" , \"Back to the roots\" );' onmouseover='if(omo == 1){showDatesByMonth( "+iYear+" , "+this.Month+" , \"Back to the roots\")}'>Back to the roots</a></td></tr>" +
			"";

	// Schließen der Tabelle
	table = table + "</table>"
	this.Table = table;
//alert( this.Table );
}


function class_Projekt( sName ){
	this.Name 		= sName ;
	this.Info		= "" ;
	this.URL		= "" ;
	this.EMail		= "" ;
	this.Members	= new Array() ;
	this.CD			= new Array() ;
	this.Critc		= new Array() ;
	this.Event		= new Array() ;
	this.Demo		= new Array() ;
	this.Img		= new Array() ;
	this.Programm	= new Array() ;
}
function class_Person( sLastname , sFirstname ){
	this.Lastname	= sLastname ;
	this.Firstname	= sFirstname ;
}
function class_CD( sBand , sTitle ){
	this.Band	= sBand ;
	this.Besetz	= "" ;
	this.Title	= sTitle ;
	this.Img	= "" ;
	this.ImgAlt	= "" ;
	this.Deliv	= "" ;
	this.Shorty	= "" ;
	this.Desc	= "" ;
	this.SInfo	= "" ;
	this.Info	= "" ;
	
}
