function checkFrame(url)
{
	if ( top == self ) {
		window.location = url;
	}

	try {
		var index = $('field_links').selectedIndex;
		$('field_links_index').innerHTML = index + 1;
	} catch (e) {}
}

function goURL()
{
	try {
		var index = $('field_links').selectedIndex;
		$('field_links_index').innerHTML = index + 1;
		$('link-open-one').href = $('field_links').value;
		top.frames["content"].location.href = $('field_links').value;
	} catch (e) {}
}

function changeURL(dir)
{
	try {
		var index = $('field_links').selectedIndex;
		var length = $('field_links').length;

		if ( dir == 'back' ) {
			if ( index > 0 ) {
				$('field_links').selectedIndex--;
				goURL();
			}
		}
		else if ( dir == 'next' ) {
			if ( index < (length-1) ) {
				$('field_links').selectedIndex++;
				goURL();
			}
		}
		else {
			goURL();
		}
	} catch (e) {}
}

function openAll() {
	if ( confirm('Are you sure you want to open all links?') ) {
		try {
			var links = $('field_links').getElementsByTagName('option');
			for ( var i = 0; i < links.length; i++ ) {
				open(links[i].value);
			}
		} catch (e) {}
	}
}

function $(id)
{
    if (document.getElementById)
        var returnVar = document.getElementById(id);
    else if (document.all)
        var returnVar = document.all[id];
    else if (document.layers)
        var returnVar = document.layers[id];
    return returnVar;
}