<!-- hide
// JAVASCRIPT INCLUDE FILE - FOR ALL AUCTION PAGES
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function toggleDisplay(DOM_Item) {
	if (document.getElementById) {
		thisItem = document.getElementById(DOM_Item).style
		if (thisItem.display == "block") {
			thisItem.display = "none";
		} else {
			thisItem.display = "block";
		}
	}
}

function show(DOM_Item)
{
	if (document.getElementById) // netscape 6+   IE 5+  - make IE 4 compatible
	{
		thisItem = document.getElementById(DOM_Item).style;
		thisItem.display = "block";
	}
}

function hide(DOM_Item)
{
	if (document.getElementById)
	{
		thisItem = document.getElementById(DOM_Item).style;
		thisItem.display = "none";
	}
}

function popupHelp(iHelpItemID)
{
	sPageURL = "help_popup.asp?id=" + iHelpItemID;
	helpWindow=window.open(sPageURL,"helpWindow","toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,top=10,left=10,width=500,height=350");
}

function openTerms()
{
	sPageURL = "terms_print.asp";
	termsWindow=window.open(sPageURL,"termsWindow","toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,top=10,left=10,width=600,height=500");
}
function creditCardDetails(iMemberID)
{
	sPageURL = "my_account_credit_card.asp?id=" + iMemberID;
	photoWindow=window.open(sPageURL,"creditCardWindow","toolbar=0,location=0,status=1,menubar=0,scrollbars=0,resizable=0,top=200,left=150,width=600,height=250");
}

function trim(strText)
{
    // get rid of leading spaces
    while (strText.substring(0,1) == ' ')
        strText = strText.substring(1, strText.length);

    // get rid of trailing spaces
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

    return strText;
}

// jumps to a category page, based on the user selection in header
function jumpToCategory()
{
	if ( document.formSearch.category.value == "Select" )
	{
		return false;
	}
	else	//get value of browse drop-down and jump to new page
	{
		window.location="category_view.asp?id=" + document.formSearch.category.options[document.formSearch.category.selectedIndex].value;

	}
}

function stripSpaces(x) {
    while (x.substring(0,1) == ' ') x = x.substring(1);
    return x;
}

function empty(x) { if (x.length > 0) return false; else return true; }


/*
 * Functions added by GG 06/04/2004
 */

function checkStringLength(str,minLen)
{
	if (trim(str).length < minLen) {
		return (false);
	} else {
		return (true);
	}
}

function checkEmail(emailAddress,mailType)
{
	var atIndex  = emailAddress.indexOf('@')
	var dotIndex = emailAddress.indexOf('.',atIndex)

	// check 0 < atIndex < dotindex < length
	if( (0 < atIndex) && (atIndex < dotIndex) && (dotIndex < emailAddress.length-1) )
	{
	// first character is a letter and all other are not whitespace
		var firstChar = emailAddress.charAt(0);

		if( (firstChar>='a' && firstChar<='z') || (firstChar>='A' && firstChar<='Z') || (firstChar>='0' && firstChar<='9') )
		{
			for(var i=1; i<emailAddress.length; ++i)
			{
				if(emailAddress.charCodeAt(i) <= 0x20)
				{
					if(emailAddress.charAt(i) == ' ') {
						return("  " + mailType + "Email address must not contain spaces.\n");
					} else {
						return("  " + mailType + "Email address must not contain the character \"" + emailAddress.charAt(i) + "\".\n")
					}
				}
			}
			return ("");
		}
		return("  " + mailType + "Email address cannot start with the character \"" + firstChar + "\".\n")
	}
	return("  " + mailType + "Email address invalid.\n")
}

/*
 * Function to write HTML options for a time selection box in the format:-
 *
 *       <option value="8">08:00</option>
 *
 * Parameter passed in is used to specify the selected value, range is from 0 to 23
 */

function writeTimes(selIndex)
{
	var i         = 0;
	var maxCount  = 23;
	var addZero   = "";
	var txtSelect = "";

	for (i=0; i <= maxCount; i++)
	{
		if (i < 10) {
			addZero = "0";
		} else {
			addZero = "";
		}

		if (i == selIndex && i != -1) {
			txtSelect = " selected";
		} else {
			txtSelect = "";
		}
		document.write("<option value=\"" + i + "\"" + txtSelect + ">" + addZero + i + ":00</option>\n");
	}
}

function chkNumericField(formField,numberType,messPrefix)
{
	var formElement = trim(formField.value);

	if (formElement.length == 0) {
		return ("  " + messPrefix + " value is empty.\n");
	} else {
		if (isANumber(formField.value)) {
			if (numberType == "int") {
				if (Number(formField.value) != parseInt(formField.value,10)) {
					return("  " + messPrefix + " must be a whole number.\n");
				}
			}
		} else {
			return("  " + messPrefix + " value is not a number.\n");
		}

		if (formElement <= 0) {
			return ("  " + messPrefix + " must be greater than zero.\n");
		}
	}
	return ("");
}

function validatedNumber(string) {
    for (var i=0, output='', valid="0123456789.'"; i<string.length; i++)
       if (valid.indexOf(string.charAt(i)) != -1)
          output += string.charAt(i)
    return output;
}

function isANumber(theElement)
{
  s = theElement;
  if ( (s == "") || (isNaN(Math.abs(s)) && (s.charAt(0) != '#')))
  {
    return false;
  }
  return true;
}

function plural(noun,nounPlural,numberUnits)
{
	var retStr = "";

	switch (noun)
	{
		case "day":
			if (numberUnits > 1) {
				retStr = nounPlural;
			}
		break;
		case "week":
			if (numberUnits > 1) {
				retStr = nounPlural;
			}
		break;
	}

	return (retStr);
}

function browserDetect()
{
	var agt = navigator.userAgent.toLowerCase();

	if ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1))) {
		ns  = true;
		ie  = false;
		ver = parseFloat(navigator.appVersion,10);
	} else if (agt.indexOf("msie") != -1) {
		ie  = true;
		ns  = false;
		s   = navigator.appVersion;
		s   = s.substr(s.indexOf("MSIE")).substr(5);
		ver = parseFloat(s,10)
	}
}
// This function requires three parameters date1 & date2 are in dd/mm/yyyy format
// comparison is evaluation and can be ==, <, <=, >, >=
// returns true or false depending on the comparison required

//function compareDates(strdate1,strdate2,comparison)
//{
	// Must include the radix of 10 in the parseInt function otherwise can cause
	// erroneous results if string preceeds with a zero eg '08'
//	var day1    = parseInt(strdate1.substr(0,2),10);
//	var month1  = parseInt(strdate1.substr(3,2),10);
//	var year1   = parseInt(strdate1.substr(6,4),10);
//	var day2    = parseInt(strdate2.substr(0,2),10);
//	var month2  = parseInt(strdate2.substr(3,2),10);
//	var year2   = parseInt(strdate2.substr(6,4),10);
//	var retStat;

//	month1--; // i.e. January is 0
//	month2--;

//	var date1   = new Date(year1,month1,day1);
//	var date2   = new Date(year2,month2,day2);

//	eval ("if (date1 " + comparison + " date2) { retStat=true; } else { retStat=false; }");
//	return (retStat);
//}



//**************************************************************************************






//**************************************************************************************

function js_SetValue(theForm, theElement, newValue)
{
	document.forms[theForm].elements[theElement].value=newValue;
}

function js_EnableSelect(theForm, theSelect)
{
	// Enable target drop down
	document.forms[theForm].elements[theSelect].disabled=false;
}

function js_AddSelectOption(theForm, theSelect, selText, selValue)
{
	var opt = new Option(selText, selValue);
	var sel = document.forms[theForm].elements[theSelect];
	sel.options[sel.options.length] = opt;
}

function js_DeleteSelectOptions(theForm,theSelect)
{
	// Clear drop down contents
	document.forms[theForm].elements[theSelect].length = 0;
}

function js_JumpToSelectOption(theForm, theSelect, theOptionValue)
{

	for(var i = 0; i < document.forms[theForm].elements[theSelect].length; i++)
	{

	    if (document.forms[theForm].elements[theSelect].options[i].value == theOptionValue)
	    	document.forms[theForm].elements[theSelect].options[i].selected = true;

	}


}

function writeSelectFieldValues(maxValue)
{

	// zero to maxValue
	var i         = 0;

	var addZero   = "";
	var txtSelect = "";

	for (i=0; i <= maxValue; i++)
	{
		if (i < 10) {
			addZero = "0";
		} else {
			addZero = "";
		}

		//if (i == selIndex && i != -1) {
		//	txtSelect = " selected";
		//} else {
		//	txtSelect = "";
		//}
		document.write("<option value=\"" + i + "\"" + txtSelect + ">" + addZero + i + "</option>\n");
	}
}



//**************************************************************************************

// IMAGE ROLLOVER ROUTINES

function swapTabImage(imgNameID,imgNewImageFilenameX)
{
	if(document.images)document.images[imgNameID].src=imgNewImageFilenameX;
}


function preloadImages()
{
	var toW='<layer top="-100" left="0" visibility="hide"><div style="position:absolute; top:-100px; left:0px; visibility:hidden">';
	for(ii=0;ii<arguments.length;ii++)toW+='<img src="'+arguments[ii]+'" height="10" width="10">';
	toW+='</div></layer>';
	document.write(toW);
}


function changeChildTDs(eTR, sNewTDClassName)
{
// take a TR element and change the className of it's children TDs to new className

	childrenTDs = eTR.childNodes;
	 for(var i = 0; i < childrenTDs.length; i++)
	 {
		//if (childrenTDs[i].tagName == "TD")
			childrenTDs[i].className = sNewTDClassName;
	 }
}
function isNumbers(checkValue)
{
	if (!isANumber(checkValue))
	{
	alert('Please insert numbers only!');
	}
}

function setItems(items)
{
var i=0;
var itemSpace=document.getElementById("itemSpace");
if (itemSpace.hasChildNodes())
{
	 while ( itemSpace.childNodes.length >= 1 )
    {
        itemSpace.removeChild( itemSpace.firstChild );
    }
}


while(i<items)
{
var b=i+1;
//create fieldset
var itemFieldSet=document.createElement("fieldset");
//itemFieldSet.setAttribute("id","");
//itemFieldSet.id="fieldSetItem_"+i;
//itemFieldSet.setAttribute("name","");
//itemFieldSet.name="fieldSetItem_"+i;
//itemFieldSet.className="items";
itemSpace.appendChild(itemFieldSet);
//great legend
var itemLegend=document.createElement("legend");
var itemLegendText=document.createTextNode("Item Size "+b+"");
itemLegend.appendChild(itemLegendText);
itemFieldSet.appendChild(itemLegend);

var nameLabel=document.createElement("label");
var nameLabelText=document.createTextNode("Item Name(optional):");
nameLabel.appendChild(nameLabelText);
nameLabel.className="items";
itemFieldSet.appendChild(nameLabel);

var nameInput=document.createElement("input");
nameInput.setAttribute("type","");
nameInput.type="text";
nameInput.setAttribute("id","");
nameInput.id="itemName_"+i;
nameInput.setAttribute("name","");
nameInput.name="itemName_"+i;
nameInput.className="items";
//set max size, set form length
itemFieldSet.appendChild(nameInput);
var setBreak=document.createElement("<br>");
itemFieldSet.appendChild(setBreak);

var noItemsLabel=document.createElement("label");
var noItemsText=document.createTextNode("Number of items this size:");
noItemsLabel.className="items";
noItemsLabel.appendChild(noItemsText);
itemFieldSet.appendChild(noItemsLabel);

var noItems=document.createElement("input");
noItems.type="text";
noItems.setAttribute("id","");
noItems.id="noItems_"+i;
noItems.setAttribute("name","");
noItems.name="noItems_"+i;
noItems.className="items";
noItems.setAttribute("onKeyUp","checkNumber(this.value)");
noItems.onkeyup = function(){isNumbers(this.value)}

itemFieldSet.appendChild(noItems);
var setBreak=document.createElement("<br>");
itemFieldSet.appendChild(setBreak);

//width
var widthLabel=document.createElement("label");
var widthText=document.createTextNode("Item Width: ");
widthLabel.className="items";
widthLabel.appendChild(widthText);
itemFieldSet.appendChild(widthLabel);

var widthInput=document.createElement("input");
widthInput.setAttribute("type","");
widthInput.type="text";
widthInput.setAttribute("id","");
widthInput.id="itemWidth_"+i;
widthInput.setAttribute("name","");
widthInput.name="itemWidth_"+i;
widthInput.setAttribute("onKeyUp","checkNumber(this.value)");
widthInput.className="items";
widthInput.onkeyup = function(){isNumbers(this.value)}
itemFieldSet.appendChild(widthInput);
var setBreak=document.createElement("<br>");
itemFieldSet.appendChild(setBreak);
//height
var heightLabel=document.createElement("label");
var heightText=document.createTextNode("Item height: ");
heightLabel.className="items";
heightLabel.appendChild(heightText);
itemFieldSet.appendChild(heightLabel);

var heightInput=document.createElement("input");
heightInput.setAttribute("type","");
heightInput.type="text";
heightInput.setAttribute("id","");
heightInput.id="itemHeight_"+i;
heightInput.setAttribute("name","");
heightInput.name="itemHeight_"+i;
heightInput.setAttribute("onKeyUp","checkNumber(this.value)");
heightInput.className="items";
heightInput.onkeyup = function(){isNumbers(this.value)}
itemFieldSet.appendChild(heightInput);
var setBreak=document.createElement("<br>");
itemFieldSet.appendChild(setBreak);
//length
var lengthLabel=document.createElement("label");
var lengthText=document.createTextNode("Item length: ");
lengthLabel.className="items";
lengthLabel.appendChild(lengthText);
itemFieldSet.appendChild(lengthLabel);

var lengthInput=document.createElement("input");
lengthInput.setAttribute("type","");
lengthInput.type="text";
lengthInput.setAttribute("id","");
lengthInput.id="itemLength_"+i;
lengthInput.setAttribute("name","");
lengthInput.name="itemLength_"+i;
lengthInput.setAttribute("onKeyUp","checkNumber(this.value)");
lengthInput.className="items";
lengthInput.onkeyup = function(){isNumbers(this.value)}
itemFieldSet.appendChild(lengthInput);
var setBreak=document.createElement("<br>");
itemFieldSet.appendChild(setBreak);

var diaLabel=document.createElement("label");
var diaText=document.createTextNode("Measurements in: ");
diaLabel.className="items";
diaLabel.appendChild(diaText);
itemFieldSet.appendChild(diaLabel);

var diaSelect=document.createElement("select");
diaSelect.setAttribute("id","");
diaSelect.id="diaSelect_"+i;
diaSelect.setAttribute("name","");
diaSelect.name="diaSelect_"+i;
diaSelect.className="items";

option = new Option("meters [m]","meters [m]");
diaSelect.options[0]=option;
option = new Option("centimeters [cm]","centimeters [cm]");
diaSelect.options[1]=option;
option = new Option("feet","feet");
diaSelect.options[2]=option;
option = new Option("inches","inches");
diaSelect.options[3]=option;
itemFieldSet.appendChild(diaSelect);
var setBreak=document.createElement("<br>");
itemFieldSet.appendChild(setBreak);

//item weight
var weightLabel=document.createElement("label");
var weightText=document.createTextNode("Item weight: ");
weightLabel.className="items";
weightLabel.appendChild(weightText);
itemFieldSet.appendChild(weightLabel);

var weightInput=document.createElement("input");
weightInput.setAttribute("type","");
weightInput.type="text";
weightInput.setAttribute("id","");
weightInput.id="itemWeight_"+i;
weightInput.setAttribute("name","");
weightInput.name="itemWeight_"+i;
weightInput.setAttribute("onKeyUp","checkNumber(this.value)");
weightInput.className="items";
weightInput.onkeyup = function(){isNumbers(this.value)}
itemFieldSet.appendChild(weightInput);
var setBreak=document.createElement("<br>");
itemFieldSet.appendChild(setBreak);

var weightTypeLabel=document.createElement("label");
var weightTypeText=document.createTextNode("Weight Measurements in: ");
weightTypeLabel.className="items";
weightTypeLabel.appendChild(weightTypeText);
itemFieldSet.appendChild(weightTypeLabel);

var weightTypeSelect=document.createElement("select");
weightTypeSelect.setAttribute("id","");
weightTypeSelect.id="weightTypeSelect_"+i;
weightTypeSelect.setAttribute("name","");
weightTypeSelect.name="weightTypeSelect_"+i;
weightTypeSelect.className="items";

option = new Option("Kilograms [KG]","Kilograms [KG]");
weightTypeSelect.options[0]=option;
option = new Option("Tons [Metric]","Tons [Metric]");
weightTypeSelect.options[1]=option;
option = new Option("Pounds [lb]","Pounds [lb]");
weightTypeSelect.options[2]=option;
option = new Option("Tons [US]","Tons [US]");
weightTypeSelect.options[3]=option;
itemFieldSet.appendChild(weightTypeSelect);
var setBreak=document.createElement("<br>");
itemFieldSet.appendChild(setBreak);


i++;
} // while
}

//-- END -->