<!-- <script language="javascript1.2"> -->
function opennewwin(x)
	{
		window.open(x,"opennewwin","resizable=1,scrollbars=1,menubar=1,directories=1,top=1,toolbar=1,status=1");
	}

function opennewimagewin(x)
	{
		window.open(x,"opennewwin","resizable=1,scrollbars=1,menubar=0,directories=0,top=0,toolbar=0,status=0,width=640,height=545");
	}
	
function openselfpaymentnewwin(x)
	{
		window.open(x,"opennewwin","resizable=1,scrollbars=1,menubar=0,directories=0,top=1,toolbar=0,status=1,width=screen.width,height=screen.height");
	}
	
function gotosecureeditaccountinfo(x)
	{
		document.secureeditaccountinfoform.action = x
		document.secureeditaccountinfoform.submit()
	}
	
function focus_username()
	{
		alert("If you have already registered for this auction then log in by clicking on the LOG IN NOW button on the top left corner of this page in order to place a bid on this item.\n\nOtherwise you must first register yourself for this auction by clicking on the 'REGISTER NOW' button on the top left corner of this page, prior to placing a bid on this item.")
		//document.loginform.UserName.focus()
	}
	
function focus_username_mybidhistory()
	{
		document.loginform.UserName.focus()
	}
	
function popUp(url) 
	{
		sealWin=window.open(url,"win","toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=700,height=450");
		self.name = "mainWin"; 
	}

function validate_buymeaccountactivated(Form,accountstatus,code,validbiddername,securesiteurl)
	{
	if (accountstatus == "F")
		{
			alert("Your account status is currently 'IN-ACTIVE'. You will not be allowed to place a bid till you activate your account. Upon clicking on the 'OK' button, you will be redirected to the 'Edit Account Information' page. Please fill your E-Mail Address and click on 'Continue' button to receive an email with the account activation link.")
			document.location.href = securesiteurl + "/index.asp?refererpage=viewbiddinghistory&mybidhistorysubpage=editaccountinfo&code=" + code + "&validbiddername=" + validbiddername
			return false	
		}
	}
	
function validate_bid(Form,retailprice,currentleadingbidderid,currentsessionid,minimumincrement,currentleadingbid,startingbid,accountstatus,code,validbiddername,securesiteurl,currenthighbid,reservebid)
	{
	var comp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()_-+=|\{[}]:;'<,>.?/" 
	var val = "false"
	var templeadingbid = 0
	
	if (accountstatus == "F")
		{
			alert("Your account status is currently 'IN-ACTIVE'. You will not be allowed to place a bid till you activate your account. Upon clicking on the 'OK' button, you will be redirected to the 'Edit Account Information' page. Please fill your E-Mail Address and click on 'Continue' button to receive an email with the account activation link.")
			document.location.href = securesiteurl + "/index.asp?refererpage=viewbiddinghistory&mybidhistorysubpage=editaccountinfo&code=" + code + "&validbiddername=" + validbiddername
			return false	
		}
	
	if(Form.Bid.value.length == 0 || Form.Bid.value == " " || Form.Bid.value == "  " || Form.Bid.value == "   " || Form.Bid.value == "    " || Form.Bid.value == "     " || Form.Bid.value == "     ")
		{
			alert("You must enter a valid bid amount")
			Form.Bid.focus()
			return false	
		}
	if(parseInt(Form.Bid.value) <= 0)
		{
			alert("Bid amount must be greater than $0.00")
			Form.Bid.focus()
			return false
		}
	for(j=0;j<Form.Bid.value.length;j++)
		{
			var bb
			var aa
			bb=Form.Bid.value.substring(j,j+1)
			for(i=0;i<comp.length;i++)
				{
					aa=comp.substring(i,i+1)
					if (aa==bb)
						{
							alert("Please enter your bid in even dollar(s). Please do not use the characters such as ' $ . , ' etc. in the bid amount")
							Form.Bid.focus()
							return false
						}
				}
		}
	
	if (parseInt(startingbid) > parseInt(currentleadingbid))
		{
			templeadingbid = parseInt(startingbid)
		}
	else
		{		
			for(var i=0;i<Form.elements.length;i++)
				{
					if (Form.elements[i].name == "bidtype")
						{
							if (Form.elements[i].type == "radio")
								{
									if(Form.elements[i].checked)
									{
										if (Form.elements[i].value == "P")
											{
												templeadingbid =  parseInt(parseInt(currentleadingbid) + parseInt(minimumincrement))
											}
										if (Form.elements[i].value == "F")
											{
							 					templeadingbid = parseInt(parseInt(currentleadingbid) + parseInt(minimumincrement))
											}
									}
								}
						}
				}
		}

	if (parseInt(Form.Bid.value) < parseInt(templeadingbid))
		{
				alert("The next allowable bid must be equal or higher than $" + parseInt(templeadingbid)) + ". This equals the current leading bid plus the minimum bid increment."
				Form.Bid.focus()
				return false
		}
	
	for(var i=0;i<Form.elements.length;i++)
				{
					if (Form.elements[i].name == "bidtype")
						{
							if (Form.elements[i].type == "radio")
								{
									if(Form.elements[i].checked)
									{
										if (Form.elements[i].value == "P")
											{
												if (parseInt(Form.Bid.value) >= parseInt(reservebid))
													{
														alert("Any Maximum Secret Bid placed, which exceeds the reserve, will automatically be placed at the reserve price by the Auction Manager.")
														//Form.Bid.focus()
														//return false
													}
											}
				
									}
								}
						}
				}	
		
	if (currentleadingbidderid == currentsessionid) 
		{
			if (!confirm('WARNING! - Our system indicates that you are already the leading bidder on this item. If you place a higher bid, you will be bidding against yourself! Do you still wish to place this bid?'))
				{
					return false;
				}
		}
			
	if (!confirm('Are You Sure You Want To Bid - $' + Form.Bid.value + '?'))
		{
			return false;
		}
	else 
		{
			if (parseInt(retailprice) >= 2500)
				{
					alert("The bid you are about to submit is a legally binding offer to purchase this item at the price bid, regardless of whether or not the item has or will meet the reserve price set by the Auction Committee. The Auction Committee may choose to contact you by phone or e-mail to confirm your bid. The  Auction Committee also reserves the right to request a deposit (by  credit card) be paid immediately following the close of the auction to hold your item while financing is arranged.")
				}
			if (parseInt(Form.Bid.value) >= (1.5 * retailprice))
				{
					if (!confirm('WARNING! - Your Bid of $' + Form.Bid.value + ' is equal or greater than 1.5 times the retail price of $' + retailprice + ' for this product. Do you still wish to place this to bid?'))
						{
						return false;
						}
				}
		}
	}

function validate_advancedsearchform(Form)
	{
	var comp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~`!@#$%^&*()_-+=|\{[}]:;'<,>.?/" 
	
	for(j=0;j<Form.query.value.length;j++)
		{
			var bb
			bb=Form.query.value.substring(j,j+1)
			if(bb.charCodeAt(0) == 34)
			{
				Form.query.value = Form.query.value.replace('"','')
			}
		}
	
	if(Form.minprice.value.length > 0)
		{
			if (Form.maxprice.value.length > 0)
				{
				
				}
			else
				{
					alert("Please enter the maximum retail price")
					Form.maxprice.focus()
					return false
				}
			if(parseInt(Form.minprice.value) <= 0)
				{
					alert("Minimum Retail Price must be greater than $0.00")
					Form.minprice.focus()
					return false
				}
				
			for(j=0;j<Form.minprice.value.length;j++)
				{
					var bb
					var aa
					bb=Form.minprice.value.substring(j,j+1)
					for(i=0;i<comp.length;i++)
						{
							aa=comp.substring(i,i+1)
							if (aa==bb)
								{
									alert("You must enter a Valid Price")
									Form.minprice.focus()
									return false
								}
						}
				}
		}	
	if(Form.maxprice.value.length > 0)
		{
			if (Form.minprice.value.length > 0)
				{
				
				}
			else
				{
					alert("Please enter the minimum retail price")
					Form.minprice.focus()
					return false
				}
			if(parseInt(Form.maxprice.value) <= 0)
				{
					alert("Maximum Retail Price must be greater than $0.00")
					Form.maxprice.focus()
					return false
				}
			for(j=0;j<Form.maxprice.value.length;j++)
				{
					var bb
					var aa
					bb=Form.maxprice.value.substring(j,j+1)
					for(i=0;i<comp.length;i++)
						{
							aa=comp.substring(i,i+1)
							if (aa==bb)
								{
									alert("You must enter a amount")
									Form.maxprice.focus()
									return false
								}
						}
				}	
		}
	if (parseInt(Form.maxprice.value) <= parseInt(Form.minprice.value))
		{
			alert("Maximum retail price must be greater than minimum retail price")
			Form.maxprice.focus()
			return false
		}
	return true
	}

function validate_passwordform1(Form)
	{
		var iLength;
		iLength = 0;
		var cStandardStripString;
		var cAddressStripString;
		var cAlphabet;
		cAddressStripString = "!@$%^&*()<>?/;:][}{\|=`~";
		cStandardStripString = ",!@$%^&*()<>.?/;:][}{\|=`~#";
		cAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		var lContainsChar;

		ret = CheckEMail(Form.email, "\You must enter a valid email address");
		if (ret == 0)
			{
				return false;
			}
	}
function validate_passwordform2(Form)
	{
		var iLength;
		iLength = 0;
		var cStandardStripString;
		var cAddressStripString;
		var cAlphabet;
		cAddressStripString = "!@$%^&*()<>?/;:][}{\|=`~";
		cStandardStripString = ",!@$%^&*()<>.?/;:][}{\|=`~#";
		cAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		var lContainsChar;

		ret = CheckEMail(Form.email, "\You must enter a valid email address");
		if (ret == 0)
			{
				return false;
			}
		if (Form.username.value.length == 0 || Form.username.value == " " || Form.username.value == "  " || Form.username.value == "   ")
			{
				alert("You Must Enter Your Emailid")
				Form.elements[1].focus()
				return false
			}
	}
	
function validate_searchform(Form)
	{
		var cquery;
		cquery = Form.query.value;
		cquery = rtrim(cquery);
		if (cquery == "")
		{
			alert("Either enter the 'Item Number' or enter the 'Search Phrase");
			Form.query.focus();
			return false;
		}
		
		for(j=0;j<Form.query.value.length;j++)
		{
			var bb
			var aa
			bb=Form.query.value.substring(j,j+1)
			if(bb.charCodeAt(0) == 34)
			{
				Form.query.value = Form.query.value.replace('"','')
			}
		}
			
		if (Form.query.value.length == 0 || Form.query.value == " " || Form.query.value == "  " || Form.query.value == "   ")
		{
			alert("Either enter the 'Item Number' or enter the 'Search Phrase'")
			Form.query.focus()
			return false
		}
	}

function validate_loginform(Form)
	{	
		var cUserName;
		cUserName = Form.UserName.value;
		cUserName = rtrim(cUserName);
		Form.UserName.value = cUserName;
	
		if (cUserName == "")
			{
				alert("You must enter Your User Name");
				Form.UserName.focus();
				return false;
			}	
		
		var cPassword;
		cPassword = Form.Password.value;
		cPassword = rtrim(cPassword);
		Form.Password.value = cPassword;
	
		if (cPassword == "")
			{
				alert("You must enter Your Password");
				Form.Password.focus();
				return false;
			}
		
		if (cPassword.length < 6)
			{
				alert("Password must contain at least 6 characters");
				Form.Password.focus();
				return false;
			}
	}
	
function rtrim(Element)
	{
		var iLenth;
		iLength = Element.length;
		while (Element.charAt(iLength - 1) == " ")
			{		
			Element = Element.substring(0, iLength - 1);
			iLength = Element.length;
			}
		return(Element)
	}
<!-- </script> -->


<!-- ***************************************** -->
function CheckStandardField(FormElement, Message, setCase, StripString)
	{
		
	var cField;
	cField = "";
	cField = FormElement.value;	
	if (setCase == "Ucase")
		{
		cField = UpperTrim(cField);
		}
	else
		{
		cField = rtrim(cField);
		}
		
	cField = stripCharString(cField, StripString);
	FormElement.value = cField;
	var ret = test(FormElement, cField, Message);
	if (ret == "Empty")
		{
		return(0);
		}
	else
		{
		return(1);
		}
	}

<!-- ****************************************** -->

function CheckEMail(FormElement, Message)
	{
	var cEmail;
	cEmail = FormElement.value;
		
	ret = CheckStandardField(FormElement, Message, "", "'!#$;:%^&*()-=+");
	if (ret == 0)
		{
		return(0);
		}	
		
	if(FormElement.value.indexOf("@") == -1)
		{
		alert(Message);
		FormElement.focus();
		return(0);
		}
	else
		{
		if (FormElement.value.indexOf(".") == -1)
			{
			alert(Message);
			FormElement.focus();
			return(0);
			}
		}
	
	if (FormElement.length < 6)
		{
		alert(Message);
		FormElement.focus();
		return(0);
		}	
		
	ret = 1;
	return(1);
	}
<!--*****************************************************-->

function test(FormElement, ElementValue, Message)
	{
	var ret;
	if (ElementValue.length == 0)
		{
		alert(Message)
		FormElement.focus();
		ret = "Empty";		
		}
	else
		{
		ret = "";
		}
	return(ret);
	}

<!-- ************************************************ -->
function UpperTrim(cElement)
	{
	cElement = cElement.toUpperCase();
	cElement = rtrim(cElement);
	return(cElement)
	}

<!-- ************************************************ -->
function rtrim(Element)
	{
	var iLenth;
	iLength = Element.length;
	while (Element.charAt(iLength - 1) == " ")
		{		
		Element = Element.substring(0, iLength - 1);
		iLength = Element.length;
		}
	return(Element)
	}

	
<!-- ************************************************************** -->
function CheckPhoneNumber(FormElement)
	{
	var cMessage;
	var ret;
	
	ElementValue = FormElement.value;
	ElementValue = stripCharString(ElementValue, "()-.+# ");
	FormElement.value = ElementValue;
		
	cMessage = "\You do not appear to have a properly formatted PHONE NUMBER Please Include the Area Code"
	cReturn = 0;
	if (ElementValue.length > 0)
		{		
		var Ret = isNumberString(ElementValue);
		if (Ret == 0)
			{
			alert(cMessage)
			FormElement.focus();
			return(cReturn);	
			}
		if (ElementValue.length < 10)
			{
			alert(cMessage)
			FormElement.focus();
			return(cReturn);	
			}
		}
	else
		{
		alert(cMessage);
		FormElement.focus();
		return(cReturn);
		}	
	}

<!--************************************************************-->

function CheckFaxNumber(FormElement)
	{
	var cMessage;
	var ret;
	
	ElementValue = FormElement.value;
	ElementValue = stripCharString(ElementValue, "()-.+# ");
	FormElement.value = ElementValue;
		
	cMessage = "\You do not appear to have a properly formatted FAX NUMBER Please Include the Area Code"
	cReturn = 0;
	if (ElementValue.length > 0)
		{		
		var Ret = isNumberString(ElementValue);
		if (Ret == 0)
			{
			alert(cMessage)
			FormElement.focus();
			return(cReturn);	
			}
		if (ElementValue.length < 10)
			{
			alert(cMessage)
			FormElement.focus();
			return(cReturn);	
			}
		}
	else
		{
		alert(cMessage);
		FormElement.focus();
		return(cReturn);
		}	
	}

<!--************************************************************-->

function CheckCountry1(fPcode, fCountry, fProv)
	{
	
	if (fCountry.value == "CA" || fCountry.value == "CANADA" )
		{
		var cIsOkay = checkPostalCode(fPcode.value);
		if (cIsOkay == "T")
			{
			}
		else
			{
			alert("\You do not appear to have a properly formatted POSTAL CODE")
			fPcode.focus();
			return (0);
			}
		
		var cProv_State;
		cProv_State = fProv.value;
		cProv_State = checkProv(cProv_State);		
		fProv.value = cProv_State;
		if (cProv_State.length > 2)
			{
			alert("\You do not have a properly formatted 2 character province");
			fProv.focus();
			return (0);
			}
		}

	if (fCountry.value == "USA" || fCountry.value == "US" )
		{
			var Ret = isUSZip(fPcode.value);
			//alert (Ret)
			if (Ret == 0)
			{
			alert("\You do not appear to have a properly formatted ZIP CODE")
			fPcode.focus();
			return(0);	
			}
			else
			{
				return (1)
			}			
		}
	}

<!-- ************************************************************** -->

function stripChar (InString, StripThis)  
	{
	OutString="";
	for (Count=0; Count < InString.length; Count++)  
		{
		TempChar=InString.substring (Count, Count+1);
		if (TempChar!=StripThis)
			OutString=OutString+TempChar;
		}
	return (OutString);
	}

<!-- ************************************************************** -->

function allowInString (InString, RefString)  
	{
	if(InString.length==0) return (false);
	for (Count=0; Count < InString.length; Count++)  
		{
		TempChar= InString.substring (Count, Count+1);
		if (RefString.indexOf (TempChar, 0)==-1)  
			return (false);
		}
	return (true);
	}

<!-- *************************************************************** -->

function stripCharString (InString, CharString)  
	{
	OutString="";
	for (Count=0; Count < InString.length; Count++) 
		{
		TempChar=InString.substring (Count, Count+1);
		Strip = false;
		for (Countx = 0; Countx < CharString.length; Countx++) 
			{
			StripThis = CharString.substring(Countx, Countx+1)
				if (TempChar == StripThis) 
				{
					Strip = true;
					break;
				}
			}
		if (!Strip)
			
			OutString=OutString+TempChar;
		}
	return (OutString);
	}

<!-- *********************************************************** -->

function allowNotInString (InString, RefString)  
	{
	if(InString.length==0) return (false);
	for (Count=0; Count < InString.length; Count++)  
		{
		TempChar= InString.substring (Count, Count+1);
		if (RefString.indexOf (TempChar, 0)!=-1)  
			return (false);
		}
	return (true);
	}

<!-- *********************************************************** -->

function mask (InString, Mask)  
	{
	LenStr = InString.length;
	LenMsk = Mask.length;
	if ((LenStr==0) || (LenMsk==0))
		return(0);
	if (LenStr!=LenMsk)
		return(0);
	TempString=""
	for (Count=0; Count<=InString.length; Count++)  
		{
		StrChar = InString.substring(Count, Count+1);
		MskChar = Mask.substring(Count, Count+1);
		if (MskChar=='#') 
			{
			if(!isNumberChar(StrChar))
				return(0);
			}
		else if (MskChar=='?') 
			{
			if(!isAlphabeticChar(StrChar))
				return(0);
			}
		else if (MskChar=='!') 
			{
			if(!isNumOrChar(StrChar))
				return(0);
			}
		else if (MskChar=='*') 
			{
			}
		else 
			{
			if (MskChar!=StrChar) 
				return(0);
			}
		}
	return (1);
}

<!-- ********************************************** -->
function isAlphabeticChar (InString)  
	{
	if(InString.length!=1) 
		return (false);
	InString=InString.toLowerCase();
	RefString="abcdefghijklmnopqrstuvwxyz";
	if (RefString.indexOf (InString.toLowerCase(), 0)==-1) 
		return (false);
	return (true);
	}

<!-- ********************************************* -->

function isNumberChar (InString)  
	{
	if(InString.length!=1) 
		return (false);
	RefString="1234567890";
	if (RefString.indexOf (InString, 0)==-1) 
		return (false);
	return (true);
	}

<!-- ********************************************* -->

function isNumberString (InString)  
	{
	if(InString.length==0) 
		return (false);
	RefString="1234567890";
	for (Count=0; Count < InString.length; Count++)  
		{
		TempChar= InString.substring (Count, Count+1);
		if (RefString.indexOf (TempChar, 0)==-1)  
			return (false);
		}
	return (true);
	}

<!-- *************************************** -->

function isNumOrChar (InString)  
	{
	if(InString.length!=1) 
		return (false);
	InString=InString.toLowerCase();
	RefString="1234567890abcdefghijklmnopqrstuvwxyz";
	if (RefString.indexOf (InString, 0)==-1)  
		return (false);
	return (true);
	}	

<!-- *************************************** -->

function isUSZip (InString)  
	{
	//alert(InString)
	if (InString.length==0) 
		return (0);
	if ((InString.length!=5) && (InString.length!=10))
		return (0);
	RefString="1234567890-";
	for (Count=0; Count < InString.length; Count++)  
		{
		TempChar= InString.substring (Count, Count+1);
		if (RefString.indexOf (TempChar, 0)==-1) 
			return (0);
		}
	return (1);
	}

<!-- ************************************** -->

function ifExists (CheckVar) 
	{
	CheckVar = "" + CheckVar; 
	if (CheckVar == "<undefined>")
		return (false);
	else
		return (true);
	}

<!-- ****************************************** -->

function checkCountry(cCountry)
	{
	if (cCountry == "CANADA")
		{
		cCountry = "CA";		
		}	

	if (cCountry == "CAN")
		{
		cCountry = "CA"		
		}
	
	if (cCountry == "US")
		{
		cCountry = "USA";		
		}
	if (cCountry == "UNITED STATES OF AMERICA")
		{
		cCountry = "USA";
		}
	if (cCountry == "UNITED STATES")
		{
		cCountry = "USA";		
		}
	
	return (cCountry);
	}

<!-- ********************************************** -->

function checkProv(cProv)
	{

	
	if (cProv == "ONT")
		{
		cProv = "ON";			
		}		
	if (cProv == "ONTARIO")
		{
		cProv = "ON";			
		}
		
	if(cProv == "NEW FOUNDLAND")
		{
		cProv = "NF";			
		}
	if (cProv == "NFLD")
		{
		cProv = "NF";
		}
	
	if (cProv == "PRINCE EDWARD ISLAND")	
		{
		cProv = "PE";
		}
		
	if (cProv == "PRINCE EDWARD ISLE")
		{
		cProv = "PE";
		}
	
	if (cProv == "PEI")
		{
		cProv = "PE";
		}		
	
	if (cProv == "NOVA SCOTIA")
		{
		cProv = "NS";
		}

	if (cProv == "NEW BRUNSWICK")
		{
		cProv = "NB";
		}
	if (cProv == "NEWBRUNSWICK")
		{
		cProv = "NB";
		}

	if (cProv == "QUEBEC")
		{
		cProv = "QC";
		}		
	if (cProv == "PQ")
		{
		cProv = "QC";
			}
	if (cProv == "PROVINCE QUEBEC")
		{
		cProv = "QC";
		}
	if (cProv == "PROVINCE DE QUEBEC")
		{
		cProv = "QC";
		}

	if (cProv == "MANITOBA")
		{
		cProv = "MB";
		}
	
	if (cProv == "MAN")
		{
		cProv = "MB";
		}

	if (cProv == "ALBERTA")
		{
		cProv = "AB";
		}

	if (cProv == "ALTA")
		{
		cProv = "AB";
		}

	if (cProv == "BRITISH COLUMBIA")
		{
		cProv = "BC";
		}
	
	if (cProv == "YUKON TERRITORIES")
		{
		cProv = "YK";
		}
	
	if (cProv == "YUKON TERR")
		{
		cProv = "YK";
		}

	if (cProv == "YKN")
		{
		cProv = "YK";
		}

	if (cProv == "YKT")
		{
		cProv = "YK";
		}
		
	if (cProv == "NORTH WEST TERRITORIES")
		{
		cProv = "NT";
		}
		
	if (cProv == "NORTHWEST TERRITORIES")
		{
		cProv = "NT";
		}

	if (cProv == "NWT")
		{
		cProv = "NT";
		}
	
	return (cProv);
	}

<!-- ****************************************** -->

function checkPostalCode(cPcode)
	{
	var cIsOkay;
	cIsOkay = "T";
	if (cPcode.length < 6)
		{
		cIsOkay = "F";
		}

	if (cPcode.length > 7)
		{
		cIsOkay = "F";
		}
		
	if (cPcode.length == 6)
		{
		var Ret = mask(cPcode, "?#?#?#");
		if (Ret == 0)
			{
			cIsOkay = "F";
			}
		}

	if (cPcode.length == 7)
		{
		var Ret = mask(cPcode, "?#? #?#");
		if (Ret == 0)
			{
			cIsOkay = "F";
			}
		}
	return (cIsOkay);
	}

<!-- ********************************************** -->


