﻿function startA()
{
var fromD = document.addhunter.startday.options[document.addhunter.startday.selectedIndex].value;
var HourT = document.addhunter.start.options[document.addhunter.start.selectedIndex].value;
var toD = document.addhunter.endday.options[document.addhunter.endday.selectedIndex].value;

	if (toD == fromD){
		$.post('his.php', {fromTend: HourT, sameday: 'true'}, function(data) { 
			$('#end').html(data);
			if ($('#end option:first-child').text() == '1:00'){
				var fromDfc = parseInt(fromD)+parseInt(24*60*60);
				$.post('ymd.php', {fromD: fromDfc}, function(data) { 
					$('#endday').html(data);
				});
			}
		});
	}
}



function startdayA()
{
var HourT = document.addhunter.start.options[document.addhunter.start.selectedIndex].value;
var fromD = document.addhunter.startday.options[document.addhunter.startday.selectedIndex].value;
var toD = document.addhunter.endday.options[document.addhunter.endday.selectedIndex].value;

	if (fromD == 'more'){
		$.post('ymd.php', {fromD: today, more: 'more'}, function(data) { 
			$('#startday').html(data);
		}); 
	}
	else{
		if (today == fromD){
			$.post('his.php', {fromT: tHour}, function(data) { 
				$('#start').html(data);

			}); 
			$.post('his.php', {fromTend: tHour, sameday: 'true'}, function(data) { 
				$('#end').html(data);

			});
		}
		else{
			$.post('his.php', {fromT: fromD}, function(data) { 
				$('#start').html(data);

			}); 
			$.post('his.php', {fromTend: toD, sameday: 'true'}, function(data) { 
				$('#end').html(data);

			});
		}

		$.post('ymd.php', {fromD: fromD}, function(data) { 
			$('#endday').html(data);
		}); 
	}

}



function enddayA()
{
var HourT = document.addhunter.start.options[document.addhunter.start.selectedIndex].value;
var fromD = document.addhunter.startday.options[document.addhunter.startday.selectedIndex].value;
var toD = document.addhunter.endday.options[document.addhunter.endday.selectedIndex].value;

	if (toD == 'more'){
		$.post('ymd.php', {fromD: fromD, more: 'more'}, function(data) { 
			$('#endday').html(data);

		}); 
	}
	else if (fromD == toD){
		$.post('his.php', {fromTend: HourT, sameday: 'true'}, function(data) { 
			$('#end').html(data);

		}); 

	}else{
		$.post('his.php', {fromTend: toD}, function(data) { 
			$('#end').html(data);

		}); 
	}

}


function changesubject(){

var vv = document.addhunter.cat.options[document.addhunter.cat.selectedIndex].value;

if (vv == 'ספורט'){
document.addhunter.subject.value = 'טניס, סקווש, גולף, כדורסל, כדורגל, צלילה, גלישת רוח, גלישת גלים, ריצה, אימונים לטריאתלון, הליכות ..';
}
else if (vv == 'הכרויות'){
document.addhunter.subject.value = 'היכרויות, מפגשים רומנטיים ..';
}
else if (vv == 'מוטוריקה'){
document.addhunter.subject.value = 'סדנאות שיפורי רכב, תערוכות, תצוגות מכוניות ..';
}
else if (vv == 'טיולים ומסעות'){
document.addhunter.subject.value = 'בארץ, בחול, גיפים, טרקטורונים, אופנועי שטח, אופנועי כביש, טיולי משפחות, טיולים רגליים ..';
}
else if (vv == 'סטודנטים'){
document.addhunter.subject.value = 'קבוצות לימוד, שותפים לדירה, מסיבות ואירועים בקמפוס ..';
}
else if (vv == 'תלמידים'){
document.addhunter.subject.value = 'קבוצות לימוד, מסיבות, בילוי משותף ..';
}
else if (vv == 'בילויים ומסיבות'){
document.addhunter.subject.value = 'פאבים, מועדונים, מסעדות, קולנוע ..';
}
else if (vv == 'צילום'){
document.addhunter.subject.value = 'צילום נופים, צילום אופנה  ..';
}
else if (vv == 'קניות'){
document.addhunter.subject.value = 'קניות בגדים, קניות מוצרי חשמל, קניות רהיטים ..';
}
else if (vv == 'שותפות עסקית'){
document.addhunter.subject.value = 'הצעות עבודה, שותפים לעסקים ..';
}
else if (vv == 'מוסיקה'){
document.addhunter.subject.value = 'לנגן יחד, הקמת להקה ..';
}
else if (vv == 'משחקי קלפים'){
document.addhunter.subject.value = 'פוקר, טקסס, קלפים, 21 ..';
}
else if (vv == 'משחקי רשת וקונסולות'){
document.addhunter.subject.value = 'קאונטר סטרייק ברשת, פרו בסוני, טורנירים ..';
}
else if (vv == 'הריון ואמהות'){
document.addhunter.subject.value = 'שותפים לקורסים בהריון, טיולי עגלות, בילוי משותף עם הילדים ..';
}
else if (vv == 'שותפים לבריאות'){
document.addhunter.subject.value = 'שמירה על דיאטה, שותפים לאורגני, עוברים יחד את המחלה ..';
}
else if (vv == 'הפגנות ופעילויות חברתיות'){
document.addhunter.subject.value = 'הפגנות, פעילות חברתית ..';
}
else if (vv == 'שותפים לדירה'){
document.addhunter.subject.value = 'מחפש שותף, מחפש דירה ..';
}
else if (vv == 'אחר'){
document.addhunter.subject.value = 'כל נושא אחר שלא מופיע ברשימה ..';
}
document.addhunter.subject.style.color = '#777777';

}
