 /**************************************************************************
 *                               objarttyp.js
 *                            -------------------
 *	angefangen			: Sonntag, 05. Okt. 2003
 *	email				: tech-support@immo-to.net
 *
 ***************************************************************************/

// JavaScript Document
function checkform() {
	if (document.objekt.exposetitel.value == '') {
		alert('Sie müssen den Titel des Objekts eingeben!');
		document.objekt.exposetitel.focus();
	}
	else if (document.objekt.objektnummer_makler.value == '') {
		alert('Sie müssen die Objektnummer angeben, unter der das Objekt bei Ihnen registriert ist!')
		document.objekt.objektnummer_makler.focus();
	}
	else document.objekt.submit();
}
function changetyp() {
	for (i = 0; i <= 26; i++) {
		document.objekt.objekttyp.options[i] = null;
	}
	for (i = 0; i <= 26; i++) {
		document.objekt.objekttyp.options[i] = null;
	}
	
	if (document.objekt.objektart.options[0].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Zimmer', 'ZIMMER');
	}
	else if (document.objekt.objektart.options[1].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Dachgeschoßwohnung', 'DACHGESCHOSS');
		document.objekt.objekttyp.options[2] = new Option('Maisonettewohnung', 'MAISONETTE');
		document.objekt.objekttyp.options[3] = new Option('Loft, Studio, Atelier', 'LOFT-STUDIO-ATELIER');
		document.objekt.objekttyp.options[4] = new Option('Penthouse', 'PENTHOUSE');
		document.objekt.objekttyp.options[5] = new Option('Terrassenwohnung', 'TERRASSEN');
		document.objekt.objekttyp.options[6] = new Option('Etagenwohnung', 'ETAGE');
		document.objekt.objekttyp.options[7] = new Option('Wohnung im Erdgeschoß', 'ERDGESCHOSS');
		document.objekt.objekttyp.options[8] = new Option('Souterrainwohnung', 'SOUTERRAIN');
	}
	else if (document.objekt.objektart.options[2].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Reihenhaus', 'REIHENHAUS');
		document.objekt.objekttyp.options[2] = new Option('Reihenendhaus', 'REIHENENDHAUS');
		document.objekt.objekttyp.options[3] = new Option('Reihenmittelhaus', 'REIHENMITTELHAUS');
		document.objekt.objekttyp.options[4] = new Option('Reiheneckhaus', 'REIHENECKHAUS');
		document.objekt.objekttyp.options[5] = new Option('Doppelhaushälfte', 'DOPPELHAUSHAELFTE');
		document.objekt.objekttyp.options[6] = new Option('Einfamilienhaus', 'EINFAMILIENHAUS');
		document.objekt.objekttyp.options[7] = new Option('Stadthaus', 'STADTHAUS');
		document.objekt.objekttyp.options[8] = new Option('Villa', 'VILLA');
		document.objekt.objekttyp.options[9] = new Option('Resthof', 'RESTHOF');
		document.objekt.objekttyp.options[10] = new Option('Bauernhaus', 'BAUERNHAUS');
		document.objekt.objekttyp.options[11] = new Option('Landhaus', 'LANDHAUS');
		document.objekt.objekttyp.options[12] = new Option('Schloss', 'SCHLOSS');
		document.objekt.objekttyp.options[13] = new Option('Zweifamilienhaus', 'ZWEIFAMILIENHAUS');
		document.objekt.objekttyp.options[14] = new Option('Mehrfamilienhaus', 'MEHRFAMILIENHAUS');
		document.objekt.objekttyp.options[15] = new Option('Ferienhaus', 'FERIENHAUS');
		document.objekt.objekttyp.options[16] = new Option('Berghütte', 'BERGHUETTE');
		document.objekt.objekttyp.options[17] = new Option('Chalet', 'CHALET');
		document.objekt.objekttyp.options[18] = new Option('Strandhaus', 'STRANDHAUS');
		document.objekt.objekttyp.options[19] = new Option('Laube, Datsche oder Gartenhaus', 'LAUBE-DATSCHE-GARTENHAUS');
	}
	else if (document.objekt.objektart.options[3].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Wohngrundstück', 'WOHNGRUNDSTUECK');
		document.objekt.objekttyp.options[2] = new Option('Gewerblich nutzbares Grundstück', 'GEWERBE');
		document.objekt.objekttyp.options[3] = new Option('Grundstück für industrielle Nutzung', 'INDUSTRIE');
		document.objekt.objekttyp.options[4] = new Option('Grundstück für land- und forstwirtschaftliche Nutzung', 'LAND_FORSTWIRTSCHAFT');
		document.objekt.objekttyp.options[5] = new Option('Grundstück für Freizeitnutzung', 'FREIZEIT');
		document.objekt.objekttyp.options[6] = new Option('Grundstück für gemischte Nutzung', 'GEMISCHT');
		document.objekt.objekttyp.options[7] = new Option('Grundstück für Sondernutzung', 'SONDERNUTZUNG');
	}
	else if (document.objekt.objektart.options[4].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Bürofläche', 'BUEROFLAECHE');
		document.objekt.objekttyp.options[2] = new Option('Bürohaus', 'BUEROHAUS');
		document.objekt.objekttyp.options[3] = new Option('Praxenräume', 'PRAXIS');
		document.objekt.objekttyp.options[4] = new Option('Ausstellungsfläche', 'AUSSTELLUNGSFLAECHE');
	}
	else if (document.objekt.objektart.options[5].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Ladenlokal', 'LADENLOKAL');
		document.objekt.objekttyp.options[2] = new Option('Einzelhandelsladen', 'EINZELHANDELSLADEN');
		document.objekt.objekttyp.options[3] = new Option('Verbrauchermarkt', 'VERBRAUCHERMARKT');
		document.objekt.objekttyp.options[4] = new Option('Einkaufszentrum', 'EINKAUFSZENTRUM');
	}
	else if (document.objekt.objektart.options[6].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Gastronomie', 'GASTRONOMIE');
		document.objekt.objekttyp.options[2] = new Option('Gastronomie und Wohnung', 'GASTRONOMIE_UND_WOHNUNG');
		document.objekt.objekttyp.options[3] = new Option('Pension', 'PENSIONEN');
		document.objekt.objekttyp.options[4] = new Option('Hotel', 'HOTELS');
		document.objekt.objekttyp.options[5] = new Option('Weiterer Beherbergungsbetrieb', 'WEITERE_BEHERBERGUNGSBETRIEBE');
	}
	else if (document.objekt.objektart.options[7].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Halle', 'HALLE');
		document.objekt.objekttyp.options[2] = new Option('Lager', 'LAGER');
		document.objekt.objekttyp.options[3] = new Option('Produktion', 'PRODUKTION');
		document.objekt.objekttyp.options[4] = new Option('Werkstatt', 'WERKSTATT');
		document.objekt.objekttyp.options[5] = new Option('Hochregallager', 'HOCHREGALLAGER');
		document.objekt.objekttyp.options[6] = new Option('Service', 'SERVICE');
		document.objekt.objekttyp.options[7] = new Option('Freiflächen', 'FREIFLAECHEN');
	}
	else if (document.objekt.objektart.options[8].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Landwirtschaftlicher Betrieb', 'LANDWIRTSCHAFTLICHE_BETRIEBE');
		document.objekt.objekttyp.options[2] = new Option('Bauernhof', 'BAUERNHOF');
		document.objekt.objekttyp.options[3] = new Option('Aussiedlerhof', 'AUSSIEDLERHOF');
		document.objekt.objekttyp.options[4] = new Option('Gartenbau', 'GARTENBAU');
		document.objekt.objekttyp.options[5] = new Option('Ackerbau', 'ACKERBAU');
		document.objekt.objekttyp.options[6] = new Option('Weinbau', 'WEINBAU');
		document.objekt.objekttyp.options[7] = new Option('Viehwirtschaft', 'VIEHWIRTSCHAFT');
		document.objekt.objekttyp.options[8] = new Option('Jagd und Forstwirtschaft', 'JAGD_UND_FORSTWIRTSCHAFT');
		document.objekt.objekttyp.options[9] = new Option('Teich- und Fischwirtschaft', 'TEICH_UND_FISCHWIRTSCHAFT');
		document.objekt.objekttyp.options[10] = new Option('Scheune', 'SCHEUNEN');
		document.objekt.objekttyp.options[11] = new Option('Reiterhof', 'REITERHOEFE');
		document.objekt.objekttyp.options[12] = new Option('Sonstige Landwirtschaftsimmobilie', 'SONSTIGE_LANDWIRTSCHAFTSIMMOBILIE');
	}
	else if (document.objekt.objektart.options[9].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Sportanlage', 'SPORTANLAGEN');
		document.objekt.objekttyp.options[2] = new Option('Vergnügungspark oder -center', 'VERGNUEGUNGSPARKS_UND_CENTER');
	}
	else if (document.objekt.objektart.options[10].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Mehrfamilienhaus', 'MEHRFAMILIENHAUS');
		document.objekt.objekttyp.options[2] = new Option('Wohn- und Geschäftshaus', 'WOHN_UND_GESCHAEFTSHAUS');
		document.objekt.objekttyp.options[3] = new Option('Geschäftshaus', 'GESCHAEFTSHAUS');
		document.objekt.objekttyp.options[4] = new Option('Bürogebäude', 'BUEROGEBAEUDE');
		document.objekt.objekttyp.options[5] = new Option('SB-Markt', 'SB_MAERKTE');
		document.objekt.objekttyp.options[6] = new Option('Einkaufszentrum', 'EINKAUFSZENTREN');
		document.objekt.objekttyp.options[7] = new Option('Wohnanlage', 'WOHNANLAGEN');
		document.objekt.objekttyp.options[8] = new Option('Verbrauchermarkt', 'VERBRAUCHERMAERKTE');
		document.objekt.objekttyp.options[9] = new Option('Industrieanlage', 'INDUSTRIEANLAGEN');
	}
	else if (document.objekt.objektart.options[11].selected == true) {
		document.objekt.objekttyp.options[0] = new Option('');
		document.objekt.objekttyp.options[1] = new Option('Parkhaus', 'PARKHAUS');
		document.objekt.objekttyp.options[2] = new Option('Tankstelle', 'TANKSTELLEN');
		document.objekt.objekttyp.options[3] = new Option('Garage', 'GARAGEN');
		document.objekt.objekttyp.options[4] = new Option('Parkfläche', 'PARKFLACHE');
		document.objekt.objekttyp.options[5] = new Option('Sonstige Immobilie', 'SONSTIGE');
	}
}

function changedays() {
	for (i = 0; i <= 30; i++) {
		document.objekt.auftrag_seit_tag.options[i] = null;
	}
	for (i = 0; i <= 30; i++) {
		document.objekt.auftrag_seit_tag.options[i] = null;
	}
	
	if (document.objekt.auftrag_seit_monat.options[0].selected == true || document.objekt.auftrag_seit_monat.options[2].selected == true || document.objekt.auftrag_seit_monat.options[4].selected == true ||
		document.objekt.auftrag_seit_monat.options[6].selected == true || document.objekt.auftrag_seit_monat.options[7].selected == true || document.objekt.auftrag_seit_monat.options[9].selected == true ||
		document.objekt.auftrag_seit_monat.options[11].selected == true) {
		for (i = 0; i < 31; i++) {
			if (i < 10) k = '0' + i
			else k = i;
			j = i + 1;
			document.objekt.auftrag_seit_tag.options[k] = new Option(j);
		}
	}
	else if (document.objekt.auftrag_seit_monat.options[3].selected == true || document.objekt.auftrag_seit_monat.options[5].selected == true || document.objekt.auftrag_seit_monat.options[8].selected == true ||
			 document.objekt.auftrag_seit_monat.options[10].selected == true) {
		for (i = 0; i < 30; i++) {
			if (i < 10) k = '0' + i
			else k = i;
			j = i + 1;
			document.objekt.auftrag_seit_tag.options[k] = new Option(j);
		}
	}
	else if (document.objekt.auftrag_seit_monat.options[1].selected == true) {
		schaltjahr = document.objekt.auftrag_seit_jahr.value % 4;
		jahrtausend = document.objekt.auftrag_seit_jahr.value % 1000;
		if (schaltjahr == 0 && jahrtausend != 0) tage = 29
		else tage = 28;
		for (i = 0; i < tage; i++) {
			if (i < 10) k = '0' + i
			else k = i;
			j = i + 1;
			document.objekt.auftrag_seit_tag.options[k] = new Option(j);
		}
	}
}
