function mOver(m) {  // mouse over
	var temp = m;
	document.getElementById(temp).style.background = "#FFFCF3";
 	document.body.style.cursor = 'pointer';
}

function mOut(m) { // mouse out
	var temp = m;
	document.getElementById(temp).style.background = "#E4DCD6";
 	document.body.style.cursor = 'auto';	
}

function blink(m) {
	var temp = m;
	var list = [];
	list[0] = "#FFFCF3";
	list[1] = "#E4DCD6";
	document.getElementById(temp).style.background = "#FFFCF3";
	setTimeout("document.getElementById('s2').style.background = '#E4DCD6'", 750);
	setTimeout("document.getElementById('s2').style.background = '#FFFCF3'", 1500);
	setTimeout("document.getElementById('s2').style.background = '#E4DCD6'", 2250);
}

function googletag() {
	var l = document.getElementById('cartlink').href;
	var pat = /#googtrans\/[a-z][a-z]\/[a-z][a-z]$/;
	var result = pat.exec(l);
	if (result == null) {  // if there's nothing in the link, try the location hash
		var result2 = pat.exec(location.hash);
        if (result2 == null) {
			result = '';
		} else {
			result = result2;
		}
	}
	return result;
}

function changeColor(m, col) {
	var temp = m;
	document.getElementById(temp).style.background = col;
}

function reloc( newurl ) {  // this only works if it comes before ANY output!
	this.document.location.href = newurl;
}

var timerid     = null;
var matchString = "";
var mseconds    = 1000;	// Length of time before search string is reset

function shiftHighlight(keyCode,targ)
{
	keyVal      = String.fromCharCode(keyCode); // Convert ASCII Code to a string
	matchString = matchString + keyVal; // Add to previously typed characters
	elementCnt  = targ.length - 1;	// Calculate length of array -1
	for (i = elementCnt; i > 0; i--)
		{
			selectText = targ.options[i].text.toLowerCase(); // convert text in SELECT to lower case
			if (selectText.substr(0,matchString.length) == 	matchString.toLowerCase())
				{
					targ.options[i].selected = true; // Make the relevant OPTION selected
				}
		}
	clearTimeout(timerid); // Clear the timeout
	timerid = setTimeout('matchString = ""',mseconds); // Set a new timeout to reset the key press string
	
	return false; // to prevent IE from doing its own highlight switching
}
