/* links.js                                    */
/* Designed for use with eBayHacks.com         */
/* Copyright 2003-05 by Creative Element       */
/* All rights reserved                         */



function hilite(url) {
	for (var i=0; i < document.links.length; i++) {
		if (document.links[i].href.toLowerCase() == window.location.href.toLowerCase()) {
			document.links[i].style.color = '#000000';
		}
	}	
}


function go(obj) { 
	if (obj.options[obj.selectedIndex].value != "-") {
		window.location.href = basehref() + obj.options[obj.selectedIndex].value;
	}
}

function basehref() {
	var currenturl = window.location.href.toLowerCase();
	var slashelements = currenturl.split("/");
	var lastelement = slashelements[slashelements.length - 1];
	var everythingelse = currenturl.substring(0, currenturl.length - lastelement.length);
	return everythingelse;
}

function selectcurrent() {

	obj = document.pageform.pagelist;
	var currenturl = window.location.href.toLowerCase();
	var baseurl = basehref();

	var found = false;
	for (var i=0; (i < obj.length) && !found; i++) {
	    if (baseurl + obj.options[i].value.toLowerCase() == currenturl) {
	        found = true;
	        obj.options[i].selected = true;
	    }
	}
}

function selectnext() {

	obj = document.pageform.pagelist;

	var found = false;
	for (var i=obj.selectedIndex + 1; (i < obj.length) && !found; i++) {
		if (obj.options[i].value != "-") {
			found = true;
			window.location.href = basehref() + obj.options[i].value;
		}
	}
}

function selectprevious() {

	obj = document.pageform.pagelist;

	var found = false;
	for (var i=obj.selectedIndex - 1; (i > -1) && !found; i--) {
		if (obj.options[i].value != "-") {
			found = true;
			window.location.href = basehref() + obj.options[i].value;
		}
	}
}

