
//--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==//
// some functions that could be useful...  copied from menu.js in OCS

var popup = '';

function detailImage(type, num, title) {
	var cleanTitle = stripSlashes(title);
	var ident = 'img_' + num;
	var link = document.getElementById(ident);
	var options = 'width=640,height=660,resizable=yes,scrollbars=yes';
	var windowString = 'http://www.gameusedsportsonline.com/product_closeup.php?' + type + "=" + num;
	
	if (!popup.closed && popup.location) {
		popup.location.href = windowString;
	} else {
		popup = window.open(windowString,"blank",options);
		if (!popup.opener) {
			popup.opener = self;
		}
		if (window.focus) {
			popup.focus();
		}
	}
	popup.focus();
}
//------------------------------------------------------------------------------------//
function detailImage2(type, num, title) {
	var cleanTitle = stripSlashes(title);
	var windowString = 'http://www.gameusedsportsonline.com/product_closeup.php?' + type + "=" + num;
	var options = 'width=640,height=660,resizable=yes,scrollbars=yes';
	
	var newwindow = window.open(windowString, cleanTitle, options);
	
	if (window.focus) {
		newwindow.focus()
	}
	return false;
}
//------------------------------------------------------------------------------------//
function stripSlashes(str)
{
	return str.replace(/\\/g, '');
}

//------------------------------------------------------------------------------------//
function textCounter(field, countfield, maxlimit) {
/*
* The input parameters are: the field name;
* field that holds the number of characters remaining;
* the max. numb. of characters.
*/
if (field.value.length > maxlimit) // if the current length is more than allowed
field.value = field.value.substring(0, maxlimit); // don't allow further input
else
countfield.innerHTML = maxlimit - field.value.length;} // set the display field to remaining number