if (navigator.appName == "Netscape")
{
	// Netscape and Firefox
	BROWSER = "NS";
}
else if ((navigator.userAgent.indexOf("opera") != -1) || (navigator.userAgent.indexOf("Opera") != -1))
{
	BROWSER = "OPERA";
}
else
{
	BROWSER = "IE";
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function changePreview(img_name,sel_index,pics_array,text_array) {
	preview_id = (pics_array.length - Math.max(sel_index,0) - 1);
	if (document.images && (preloadFlag == true)) {
		document[img_name].src = pics_array[preview_id];
	}
	document.getElementById('prev_txt').innerHTML = text_array[preview_id];
}

function JumpTo(form_obj)
{
	if (form_obj.value != "")
	{
		window.location = form_obj.value;
	}
}

function popup(url) {
	window.open(url,"","toolbar=no,status=no,resizable=yes,menubar=no,width=630,height=575,scrollbars=no");
}

function pic_popup(url) {
	window.open(url,"picWin","toolbar=no,status=no,resizable=yes,menubar=no,width=630,height=555,scrollbars=yes");
}

function gen_popup(url, w, h) {
	window.open(url,"","toolbar=no,status=no,resizable=yes,menubar=no,width="+w+",height="+h+",scrollbars=no");
}

function popup_player(newFile,title)
{
	window.open("mp3player.php?file="+newFile+"&title="+title+"&browser="+BROWSER,null,"height=120, width=320, left=400, top=300, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no");
}

function ticker(tickerText, tickerLength, tickerCellId, speed)
{
	/*
	** Speed is in chars per second
	*/
	var tickerTextO = new string(tickerText);
	var startChar = 0;

	var endChar = tickerLength - 1;

	document.getElementById(tickerCellId).innerHTML = tickerTextO.substring(startChar, endChar);
	var timeoutID = setTimeout('ticker(tickerText, tickerLength, tickerCellId, speed)', 1000./speed);
}
