
function changeSearchTab(tab) {
	tab = tab || 'aupair';
	thisTab = (tab == 'aupair') ? 'aupair' : 'family';
	otherTab = (tab == 'aupair') ? 'family' : 'aupair';
	thisText = (tab == 'aupair') ? '' : '';
	document.quicksearchForm.search.value = thisTab;
	if(document.images){
		document.images[thisTab + 'TabLeft'].src = '/images/tab_left.gif';
		document.images[thisTab + 'TabRight'].src = '/images/tab_right.gif';
		document.images[otherTab + 'TabLeft'].src = '/images/transparent.gif';
		document.images[otherTab + 'TabRight'].src = '/images/transparent.gif';
	}
	styleChange(thisTab + 'TabCell').style.backgroundColor = '#8D8DA8';
	styleChange(otherTab + 'TabCell').style.backgroundColor = '#61618B';
	styleChange(thisTab + 'TabLink').style.color = '#FFFF9C';
	styleChange(otherTab + 'TabLink').style.color = '#E8E8E8';
	changeSearchText();
	styleChange('quicksearchLink3').href = (tab == 'aupair') ? '/search_aupairs.cfm/type/country' : '/search_families.cfm/type/country';
}

function changeLink(thisLink, linkType) {
	thisLink = thisLink || 1;
	for(index = 1; index <= 5; index++) {
		document.quicksearchForm.linkType.value = linkType;
		styleChange('quicksearchLink' + index).style.color = (thisLink == index) ? '#FFFF9C' : '#E8E8E8';
		styleChange('quicksearchLink' + index).style.textDecoration = (thisLink == index) ? 'underline' : 'none';
	}
	changeSearchText();
}

function changeSearchText() {
	var thisAupair = '';
	var thisSearch = '';
	var thisText = '';
	var thisAction = '';
	var thisAupair = 'female';
	var thisGender = '1';
	var thisCountryList = document.quicksearchForm.countryList.value;
	
	
	if(document.quicksearchForm.aupairFemale.checked) {
		thisAupair = 'female';
		thisGender = '1';
		thisCountryList = document.quicksearchForm.countryList.value;
		document.quicksearchForm.aupairGender.value = '1';
		if(document.quicksearchForm.aupairMale.checked) {
			document.quicksearchForm.aupairGender.value = '0,1';
			thisGender = '0,1';
			if(document.quicksearchForm.search.value == 'aupair')
				thisAupair = thisAupair + '<A/> and <A HREF="/fastfind.cfm/countryList/0/aupairGender/0" CLASS="yellowText">male';
			else
				thisAupair = thisAupair + '</A> or <A HREF="/fastfind.cfm/countryList/0/aupairGender/0" CLASS="yellowText">male';
		}
	} else if(document.quicksearchForm.aupairMale.checked) {
		thisAupair = 'male';
		thisGender = '0';
		document.quicksearchForm.aupairGender.value = '0';
	} else {
		document.quicksearchForm.aupairFemale.checked = 1;
	}
	
	switch(document.quicksearchForm.search.value) {
		case 'aupair':
			thisSearch = 'Au Pairs';
			switch(document.quicksearchForm.linkType.value) {
				case 'browse':
					thisText = ' <A HREF="/fastfind.cfm/countryList/0/aupairGender/' + thisGender + '" CLASS="yellowText" STYLE="">Browse</A> to show all <A HREF="/fastfind.cfm/countryList/0/aupairGender/' + thisGender + '" CLASS="yellowText">' + thisAupair + ' Au Pairs</A> and <A HREF="/fastfind.cfm/countryList/0/aupairGender/' + thisGender + '" CLASS="yellowText">nannies</A> in any country.';
					thisAction = '/fastfind.cfm';
					break;
				case 'photo':
					thisText = ' <A HREF="/fastfind.cfm/aupairPhotos/1/countryList/0/aupairGender/' + thisGender + '" CLASS="yellowText">With Photo</A> to show all <A HREF="/fastfind.cfm/aupairPhotos/1/countryList/0/aupairGender/' + thisGender + '" CLASS="yellowText">' + thisAupair + ' Au Pairs</A> and <A HREF="/fastfind.cfm/aupairPhotos/1/countryList/0/aupairGender/' + thisGender + '" CLASS="yellowText">nannies</A>  with photos in any country.';
					thisAction = '/fastfind.cfm/search/aupair/aupairphotos/1';
					break;
				case 'country':
					thisText = ' <A HREF="/search_aupairs.cfm/type/country" CLASS="yellowText">By Country</A> to find all <A HREF="/search_aupairs.cfm/type/country" CLASS="yellowText">' + thisAupair + ' Au Pairs</A> and <A HREF="/search_aupairs.cfm/type/country" CLASS="yellowText">nannies</A> living in a specific country and state.';
					thisAction = '/search_aupairs.cfm/type/country';
					break;
				case 'zipcode':
					thisText = ' <A HREF="/proximity.cfm/fastfind.cfm/1/aupairGender/' + thisGender + '/refer/home/countryList/0/displayRows/5/search/aupair" ONCLICK="openWin(\'/proximity.cfm/fastfind.cfm/1/aupairGender/' + thisGender + '/refer/home/countryList/0/displayRows/5/search/aupair\', 400, 400); return false;" CLASS="yellowText">City or Zip Code</A> to search for <A  HREF="#" ONCLICK="document.registerForm.submit();" CLASS="yellowText">' + thisAupair + ' Au Pairs</A> and <A  HREF="/proximity.cfm/fastfind.cfm/1/aupairGender/' + thisGender + '/refer/home/countryList/0/displayRows/5/search/aupair" ONCLICK="openWin(\'/proximity.cfm/fastfind.cfm/1/aupairGender/' + thisGender + '/refer/home/countryList/0/displayRows/5/search/aupair\', 400, 400); return false;" CLASS="yellowText">nannies</A> by city. Or enter US zip code or worldwide city below.';
					thisAction = '/fastfind.cfm/search/aupair';
					break;
				case 'advanced':
					thisText = ' <A HREF="/fastfind.cfm/search/aupair/searchType/advanced/aupairGender/' + thisGender + '" CLASS="yellowText">Advanced</A> to define your custom search critera for <A HREF="/fastfind.cfm/search/aupair/searchType/advanced/aupairGender/' + thisGender + '" CLASS="yellowText">Au Pairs</A> and <A HREF="/fastfind.cfm/search/aupair/searchType/advanced/aupairGender/' + thisGender + '" CLASS="yellowText">nannies.</A>';
					thisAction = '/fastfind.cfm/search/aupair/searchType/advanced';
					thisCountryList = '';
					break;
			}
			break;
		case 'family':
			thisSearch = 'Families';
			switch(document.quicksearchForm.linkType.value) {
				case 'browse':
					thisText = '<A HREF="/fastfind.cfm/search/family/countryList/0/aupairGender/' + thisGender + '" CLASS="yellowText">Browse</A> to show all <A HREF="/fastfind.cfm/search/family/countryList/0/aupairGender/' + thisGender + '" CLASS="yellowText">families</A> in any country that want a <SPAN CLASS="yellowText">' + thisAupair + '</SPAN> Au Pair or Nanny.';
					thisAction = '/fastfind.cfm/search/family';
					break;
				case 'photo':
					thisText = ' <A HREF="/fastfind.cfm/search/family/familyphotos/1/countryList/0/aupairGender/' + thisGender + '" CLASS="yellowText">With Photo</A>  to show all <A HREF="/fastfind.cfm/search/family/familyphotos/1/countryList/0/aupairGender/' + thisGender + '" CLASS="yellowText">families</A> with photos in any country seeking a <SPAN CLASS="yellowText">' + thisAupair + '</SPAN> Au Pair or nanny.';
					thisAction = '/fastfind.cfm/search/family/familyphotos/1';
					break;
				case 'country':
					thisText = ' <A HREF="/search_families.cfm/type/country" CLASS="yellowText">By Country</A> to find all <A HREF="/search_families.cfm/type/country" CLASS="yellowText">families</A> offering Au Pair or nanny jobs in a specific country and state.';
					thisAction = '/search_families.cfm/type/country';
					break;
				case 'zipcode':
					thisText = ' <A HREF="/proximity.cfm/fastfind.cfm/1/aupairGender/' + thisGender + '/refer/home/countryList/0/displayRows/5/search/family" ONCLICK="openWin(\'/proximity.cfm/fastfind.cfm/1/aupairGender/' + thisGender + '/refer/home/countryList/0/displayRows/5/search/family\', 400, 400); return false;" CLASS="yellowText">City or Zip Code</A> to search for <A  HREF="/proximity.cfm/fastfind.cfm/1/aupairGender/' + thisGender + '/refer/home/countryList/0/displayRows/5/search/family" ONCLICK="openWin(\'/proximity.cfm/fastfind.cfm/1/aupairGender/' + thisGender + '/refer/home/countryList/0/displayRows/5/search/family\', 400, 400); return false;" CLASS="yellowText">families</A> by city. Or enter US zip code or worldwide city below.';
					thisAction = '/fastfind.cfm/search/family';
					break;
				case 'advanced':
					thisText = ' <A HREF="/fastfind.cfm/search/family/searchType/advanced/aupairGender/' + thisGender + '" CLASS="yellowText">Advanced</A> to define your custom search critera for <A HREF="/fastfind.cfm/search/family/searchType/advanced/aupairGender/' + thisGender + '" CLASS="yellowText">Au Pair</A> and <A HREF="/fastfind.cfm/search/family/searchType/advanced/aupairGender/' + thisGender + '" CLASS="yellowText">nanny jobs.</A>';
					thisAction = '/fastfind.cfm/search/family/searchType/advanced';
					thisCountryList = '';
					break;
			}
			break;
	}
	
	thisText = 'Click ' + thisText;
	styleChange('quicksearchCell').innerHTML = thisText;
	document.quicksearchForm.action = thisAction;
	document.quicksearchForm.countryList.value = thisCountryList;
}


function quickSearch() {
	var thisAction = '';
	var thisGender = '0';
	var thisCountryList = '0';
	
	if(document.quicksearchForm.aupairMale.checked && document.quicksearchForm.aupairFemale.checked) {
		thisGender = '0,1';
	} else if(document.quicksearchForm.aupairMale.checked) {
		thisGender = '0';
	} else if(document.quicksearchForm.aupairFemale.checked) {
		thisGender = '1';
	}
	
	switch(document.quicksearchForm.search.value) {
		case 'aupair':
			thisSearch = 'Au Pairs';
			switch(document.quicksearchForm.linkType.value) {
				case 'browse':
					thisAction = '/fastfind.cfm' + '/countryList/' + thisCountryList;
					break;
				case 'photo':
					thisAction = '/fastfind.cfm/search/aupair/aupairphotos/1' + '/countryList/' + thisCountryList;
					break;
				case 'country':
					thisAction = '/search_aupairs.cfm/type/country';
					break;
				case 'zipcode':
					thisAction = '/fastfind.cfm/search/aupair/searchType/advanced';
					break;
				case 'advanced':
					thisAction = '/fastfind.cfm/search/aupair/searchType/advanced';
					thisCountryList = '';
					break;
			}
			break;
		case 'family':
			thisSearch = 'Families';
			switch(document.quicksearchForm.linkType.value) {
				case 'browse':
					thisAction = '/fastfind.cfm/search/family' + '/countryList/' + thisCountryList;
					break;
				case 'photo':
					thisAction = '/fastfind.cfm/search/family/familyphotos/1' + '/countryList/' + thisCountryList;
					break;
				case 'country':
					thisAction = '/search_families.cfm/type/country';
					break;
				case 'zipcode':
					thisAction = '/fastfind.cfm/search/family/searchType/advanced';
					break;
				case 'advanced':
					thisAction = '/fastfind.cfm/search/family/searchType/advanced';
					thisCountryList = '';
					break;
			}
			break;
	}
	
	document.quicksearchForm.action = thisAction + '/aupairGender/' + thisGender;
	return true;
}