<!-- <%
// javascript functions that mimic php array functions:

function in_array(needle, haystack, strict)
{
	var found = false;
	for (var key in haystack)
	{
		if (haystack[key] == needle && (!strict || strict && typeof(haystack[key]) == typeof(needle)))
		{
			found = true;
			break;
		}
	}
	return found;
}


function implode(glue, pieces)
{
	if (pieces.length == 0)
		return "";
	var result = pieces[0];
	for (var i = 1; i < pieces.length; i++)
		result += glue + pieces[i];
	return result;
}


function explode(seperator, str)
{
	return str.split(seperator);
}


function implode_compact(glue, pieces)
{
	// same as implode but empty strings ignored:
	if (pieces.length == 0)
		return;
	var result = pieces[0];
	for (var i = 1; i < pieces.length; i++)
	{
		if (pieces[i] != '')
			result += glue + pieces[i];
	}
	return result;
}


function debug_r(arr)
{
	var str = '';
	for (el in arr)
		str += el + " => (" + typeof(arr[el]) + ") " + arr[el] + "\n";
	alert(str);
}

// %> -->

