function refreshpage()
{
	current = document.location;
	document.location = current;
}

function show_login_error()
{
	$('#login_error_container div:first').fadeIn(750, function() {
        $('#login_error_container').cycle({nowrap:  1, pause: 1, timeout: 10000});
    });
}

function SetVisibility(id, action)
{
	// Browser sniffer.
	type = "IE";
	if(navigator.userAgent.indexOf("Opera") != -1)
	{
		type = "OP";
	}
	else if(navigator.userAgent.indexOf("Gecko") != -1)
	{
		type = "MO";
	}
	else if(navigator.userAgent.indexOf("Firefox") != -1)
	{
		type = "MO";
	}
	else if(navigator.userAgent.indexOf("AOL") != -1)
	{
		type = "IE";
	}
	else
	{
		if (document.all)
		{
			type = "IE";
		}
		if (document.layers)
		{
			type = "NN";
		}
		if (document.addEventListener)
		{
			type = "NN";
		}
	}

	if (type=="IE") eval("document.all." + id + ".style.display='" + action + "'");
	if (type=="NN") eval("document." + id + ".display='" + action + "'");
	if (type=="MO" || type=="OP") eval("document.getElementById('" + id + "').style.display='" + action + "'");
}

function strpos (haystack, needle, offset) {
    var i = (haystack+'').indexOf(needle, (offset || 0));
    return i === -1 ? false : i;
}

