﻿function toggleFilter(filterLayer, filterUrl) {
	if (document.getElementById) {
		// Modern
		var style2 = document.getElementById(filterLayer).style;

		style2.display = style2.display ? "" : "block";
		document.getElementById(filterLayer).innerHTML = "<center><iframe src='" + filterUrl
		    + "' style='width:750px;height:160px;' frameborder=0 scrolling=no></iframe></center>";
	}
	else if (document.all) {
		// Old IE
		var style2 = document.all[filterLayer].style;
		style2.display = style2.display ? "" : "block";
	}
	else if (document.layers) {
		// NN4
		var style2 = document.layers[filterLayer].style;
		style2.display = style2.display ? "" : "block";
	}
}

function show(id) { document.getElementById(id).style.display = 'block'; }
function hide(id) { document.getElementById(id).style.display = 'none'; }

/* search */
function clearInputValue(inputId, defaultText) {
	var obj = document.getElementById(inputId);

	if (obj.value == defaultText) {
		var color1 = obj.style.color;
		obj.style.color = '#000';

		if (color1 != obj.style.color) {
			obj.value = "";
			obj.style.color = '#000';
		}
	}
}

function setDefaultIfEmpty(inputId, defaultText) {
	var obj = document.getElementById(inputId);

	if (obj.value == "") {
		obj.value = defaultText;
		obj.style.color = '#999';
	}
}

function setDefault(inputId, defaultText) {
	var obj = document.getElementById(inputId);

	obj.value = defaultText;
	obj.style.color = '#999';
}

function submitQuery(inputID, defaultText) {
	var obj = document.getElementById(inputID);

	if (obj.value == defaultText) {
		var color1 = obj.style.color;
		obj.style.color = '#000';

		if (color1 != obj.style.color)
			obj.value = "";
	}
}

/* afc */
function google_ad_request_done(google_ads) {
	var s='';var i;
	if (google_ads.length == 0){return;}
	if (google_ads.length == 1) {
		s += '<a href=\"' +
		google_info.feedback_url + '\" >Ads by Google</a><br><br><a href="' +
		google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[0].visible_url + '\';return true">' +
		google_ads[0].line1 + '<br></a>' +
		google_ads[0].line2 + '&nbsp;' +
		google_ads[0].line3 + '<br><a href="' +
		google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[0].visible_url + '\';return true">' +
		google_ads[0].visible_url + '</a><br>';
	} else if (google_ads.length > 1) {
		s += '<a href=\"' + google_info.feedback_url + '\">Ads by Google</a><br>'
		for (i = 0; i < google_ads.length; ++i) {
			s += '<br><a href="' +
			google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[i].visible_url + '\';return true">' +
			google_ads[i].line1 + '<br></a>' +
			google_ads[i].line2 + '<br>' +
			google_ads[i].line3 + '<br></span><a href="' +
			google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[i].visible_url + '\';return true">' +
			google_ads[i].visible_url + '</span></a><br>';
		}
	}
	document.write(s);
	return;
}

