	obj = document.getElementsByTagName("div");
	objtb = document.getElementsByTagName("table");
	var string_sent = "";
	var credentials = "";
	var xmlhttp
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	  try {
	  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
	    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
	   xmlhttp=false;
	  }
	 }
	@else
		xmlhttp=false
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
			if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	
	var ManageTabs = new Array();
		ManageTabs[0] = new Array("0","Items","")
		ManageTabs[1] = new Array("1","Add Item","3")
		ManageTabs[2] = new Array("2","Pictures","3")
		
	var ManufactureList = 'Abarth,AC,Acura,Alfa Romeo,Alvis,AMC,Aston Martin,Audi,Austin,Bentley,BMC,BMW,Bombardier,Bond,Borgward,Bricklin,Bristol,Bugatti,Buick,Cadillac,Caterham,Chevrolet,Chrysler,Citroen,Corbin,Crosley,Dacia,Daewoo,Daihatsu,Daimler,Delage,Dellow,DeLorean,DeSoto,DeTomaso,Dodge,DSM,Durant,Eagle,Edsel,Ferrari,Fiat,Ford,GM,Geo,GMC,Harley Davidson,Hillman,Holden,Honda,Hudson,Humber,Hummer,Hyundai,Infiniti,International,Isuzu,Jaguar,Jeep,Jensen,Kawasaki,Kia,Lada,Lamborghini,Lancia,Land Rover,La Salle,Lexus,Lincoln,Lotus,Maserati,Mazda,McLaren,Mercedes,Mercury,Merkur,MG,Mini,Mitsubishi,Morgan,Morris,Nash,Navistar,Nissan,NSU,Oldsmobile,Opel,Other,Packard,Panhard,Peugeot,Plymouth,Polaris,Pontiac,Porsche,Puma,Reliant,Renault,Riley,Rolls-Royce,Rootes,Rover,Saab,Saleen,Salmson,Saturn,Seat,Simca,Singer,Skoda,Smart,Studebaker,Subaru,Sunbeam,Suzuki,Tatra,Toyota,Trabant,Triumph,Tucker,TVR,Vauxhall,Volkswagen,Volvo,Wartburg,Willys,Wolseley,Yugo,ZAZ'
	
	var Holders = new Array();
	Holders[0] = new Array("","","","","","","","","","","","","","","","","","","","","","","","","","","","","","")
	//------------------------
	//0-reference
	//1-lot
	//2-auc_type
	//3-consignor
	//4-make
	//5-make_other
	//6-model/title
	//7-year
	//8-vin
	//9-odometer
	//10-mileorhour
	//11-engine
	//12-TranType
	//13-color
	//14-ItemDetails
	//15-Pictures
	//16-Options
	//------------------------
	
	function ChangeSort(id){
		if(id != ''){
			var theurl = location.href.replace("&sort=1","")
			theurl = theurl.replace("&sort=2","")
			theurl = theurl.replace("&sort=3","")
			theurl = theurl.replace("&sort=4","")
			window.location.href=theurl+'&sort='+id
		}
	}
	
	function CheckManufacture(){
		var selectedItem = document.forms['addaucitem'].make.selectedIndex;
		var selectedValue =document.forms['addaucitem'].make.options[selectedItem].value;
		if (selectedValue.toLowerCase() == 'other'){
			document.forms['addaucitem'].make_other.disabled = false;
			document.forms['addaucitem'].make_other.style.background = '#ffffff';
		}else{
			document.forms['addaucitem'].make_other.disabled = true;
			document.forms['addaucitem'].make_other.style.background = '#cccccc';
			document.forms['addaucitem'].make_other.value = '';
		}
		var yearmodelhtml = '';
		
		
		if(selectedValue == '0'){
			yearmodelhtml = yearmodelhtml + 'Auction Title:<input type="text" onKeyUp="Holders[0][6]=this.value" id="model" style="width:218px;height:19px;font-size:11px;margin-left:3px" value="'+Holders[0][6]+'">'
			obj['yearmodel'].style.display = 'block';
			obj['car_options_list'].style.display = 'none';
		}else if(selectedValue != ''){
			obj['car_options_list'].style.display = 'block';
			yearmodelhtml = yearmodelhtml + '<div>Model:<input type="text" id="model" onKeyUp="Holders[0][6]=this.value" style="width:126px;height:19px;font-size:11px;margin-left:3px;margin-right:6px" value="'+Holders[0][6]+'">Year:<select id="year" onChange="Holders[0][7]=this.value" style="width:52px;height:18px;font-size:11px;margin-left:3px">'
			var currentyear = new Date().getFullYear();
			for(var i=1900;i < currentyear + 2;i++){
				if (i == Holders[0][7]){
					yearmodelhtml = yearmodelhtml + '<option value="'+i+'" selected>'+i+'</option>'
				}else{
					yearmodelhtml = yearmodelhtml + '<option value="'+i+'">'+i+'</option>'
				}
			}
			if (Holders[0][7] == ''){
				yearmodelhtml = yearmodelhtml + '<option value="" selected></option>'
			}
			yearmodelhtml = yearmodelhtml + '</select></div>'
			yearmodelhtml = yearmodelhtml + '<div>VIN #:<input type="text" id="vin" onKeyUp="Holders[0][8]=this.value" style="width:218px;height:19px;font-size:11px;margin-left:3px;margin-top:3px" value="'+Holders[0][8]+'"></div>'
			yearmodelhtml = yearmodelhtml + '<div style="margin-top:3px">Odometer:<input type="text" onKeyUp="Holders[0][9]=this.value" id="mileagehour" style="width:159px;height:19px;font-size:11px;margin-left:3px" value="'+Holders[0][9]+'"><select id="mileorhour" onChange="Holders[0][10]=this.value" style="width:58px;height:18px;font-size:11px;margin-left:1px">'
			for(var i in VehicleMiles){
				if (i == Holders[0][10]){
					yearmodelhtml = yearmodelhtml + '<option value="'+i+'" selected>'+VehicleMiles[i][1]+'</option>'
				}else{
					yearmodelhtml = yearmodelhtml + '<option value="'+i+'">'+VehicleMiles[i][1]+'</option>'
				}
			}
			yearmodelhtml = yearmodelhtml + '</select></div>'
			
			yearmodelhtml = yearmodelhtml + '<div style="margin-top:3px">Engine:<select id="transmission" onChange="Holders[0][11]=this.value" style="width:74px;height:18px;font-size:11px;margin-left:3px;margin-right:2px">'
			for(var i in EngineType){
				if (i == Holders[0][11]){
					yearmodelhtml = yearmodelhtml + '<option value="'+i+'" selected>'+EngineType[i][0]+'</option>'
				}else{
					yearmodelhtml = yearmodelhtml + '<option value="'+i+'">'+EngineType[i][0]+'</option>'
				}
			}
			yearmodelhtml = yearmodelhtml + '</select>'
			
			yearmodelhtml = yearmodelhtml + 'Transmission:<select id="automatic" onChange="Holders[0][12]=this.value" style="width:61px;height:18px;font-size:11px;margin-left:1px">'
			for(var i in Transmissions){
				if (i == Holders[0][12]){
					yearmodelhtml = yearmodelhtml + '<option value="'+i+'" selected>'+Transmissions[i][1]+'</option>'
				}else{
					yearmodelhtml = yearmodelhtml + '<option value="'+i+'">'+Transmissions[i][1]+'</option>'
				}
			}
			yearmodelhtml = yearmodelhtml + '</select>'
			
			yearmodelhtml = yearmodelhtml + '</div>'
			
			obj['yearmodel'].style.display = 'block';
		}else{
			yearmodelhtml = yearmodelhtml + ''
			obj['yearmodel'].style.display = 'none';
			obj['car_options_list'].style.display = 'none';
		}
		yearmodelhtml = yearmodelhtml + '<div id="color" style="text-align:right;margin-top:3px">Color:<input type="text" id="colour" onKeyUp="Holders[0][13]=this.value" style="width:218px;height:19px;font-size:11px;margin-left:3px;border:1px solid #666666" value="'+Holders[0][13]+'"></div>'
		yearmodelhtml = yearmodelhtml + '<div id="picture_folders" style="text-align:right;margin-top:3px">Picture Folder:<select id="picturefolders" onChange="GetPictureFolders(this.value)" style="width:218px;height:18px;font-size:11px;margin-left:3px">'
		yearmodelhtml = yearmodelhtml + AuctionsManage('folders='+credentials[1],'user')
		yearmodelhtml = yearmodelhtml + '</select></div>'
		yearmodelhtml = yearmodelhtml + '<div id="picture_files" style="text-align:right;margin-top:3px">Pictures:<select id="picturefiles" style="width:178px;height:18px;font-size:11px;margin-left:3px">'
		yearmodelhtml = yearmodelhtml + AuctionsManage('folders='+credentials[1]+'&files='+credentials[1],'user')
		yearmodelhtml = yearmodelhtml + '</select><input type="button" onClick="PreviewPicture(document.addaucitem.picturefiles.value,\'add\');document.addaucitem.picturefiles.selectedIndex = 0" value="Add" id="addpicture" style="width:37px;height:19px;font-size:11px;margin-left:3px"></div>'
		yearmodelhtml = yearmodelhtml + '<div id="picture_previews" style="vertical-align:top;margin-top:3px;text-align:left;height:33px">'
		yearmodelhtml = yearmodelhtml + '	<div style="position:absolute;border:1px solid #666666;margin-left:93px"><img src="images/spacer.gif" style="width:40px;height:30px" onClick="TheBigPicture(this.src,\'auctions\')" oncontextmenu="PreviewPicture(this.src,\'remove\');return false;" id="previewpic_0"></div>'
		yearmodelhtml = yearmodelhtml + '	<div style="position:absolute;border:1px solid #666666;margin-left:137px"><img src="images/spacer.gif" style="width:40px;height:30px" onClick="TheBigPicture(this.src,\'auctions\')" oncontextmenu="PreviewPicture(this.src,\'remove\');return false;" id="previewpic_1"></div>'
		yearmodelhtml = yearmodelhtml + '	<div style="position:absolute;border:1px solid #666666;margin-left:181px"><img src="images/spacer.gif" style="width:40px;height:30px" onClick="TheBigPicture(this.src,\'auctions\')" oncontextmenu="PreviewPicture(this.src,\'remove\');return false;" id="previewpic_2"></div>'
		yearmodelhtml = yearmodelhtml + '	<div style="position:absolute;border:1px solid #666666;margin-left:225px"><img src="images/spacer.gif" style="width:40px;height:30px" onClick="TheBigPicture(this.src,\'auctions\')" oncontextmenu="PreviewPicture(this.src,\'remove\');return false;" id="previewpic_3"></div>'
		yearmodelhtml = yearmodelhtml + '	<div style="position:absolute;border:1px solid #666666;margin-left:269px"><img src="images/spacer.gif" style="width:40px;height:30px" onClick="TheBigPicture(this.src,\'auctions\')" oncontextmenu="PreviewPicture(this.src,\'remove\');return false;" id="previewpic_4"></div>'
		yearmodelhtml = yearmodelhtml + '</div>'
		yearmodelhtml = yearmodelhtml + '<div style="text-align:right;margin-right:-1px"><img src="images/reuse/click_preview.gif"></div>'
		yearmodelhtml = yearmodelhtml + '<div style="text-align:left"><div style="position:absolute;margin-left:16px">Item Details:</div><div style="text-align:right"><textarea onKeyUp="Holders[0][14]=this.value" id="notes_item" style="width:218px;height:70px;overflow:auto;border:1px solid #999999">'+Holders[0][14]+'</textarea></div></div>'
		yearmodelhtml = yearmodelhtml + '<div style="margin-top:2px"><input type="button" onclick="SubmitNewItem()" id="addnewitem" value="Submit" style="height:21px;font-family:Tahoma"></div>'
		obj['yearmodel'].innerHTML = yearmodelhtml
		if(PreviewPics[0].length > 0){
			PreviewPicture('0','refresh')
		}
		document.addaucitem.addnewitem.value = obj['crtab_1'].innerHTML
		//HERE IS THE HOLDERS ALERT
		//alert(Holders[0])
	}
	
	var PreviewPics = new Array();
		PreviewPics[0] = new Array("","","","","")
	
	function SubmitNewItem(){
		var submitstring = ''
		var submitoptions = ''
		var submitnonoptions = ''
		var picturestring = ''
		if (document.addaucitem.consigner.value == '0'){
			alert('Please choose a consignor.')
			return false;
		}
		if (document.addaucitem.make.value != '0'){
			if (isNaN(document.addaucitem.mileagehour.value)){
				alert('Odometer reading must be numeric or nothing.')
				return false;
			}
		}
		if (document.addaucitem.make.value == 'Other' && document.addaucitem.make_other.value == ''){
			alert('Please provide a vehicle make.')
			return false;
		}
		if (Trim(document.addaucitem.model.value)== '' && document.addaucitem.make.value == '0'){
			alert('Please provide a title for this auction')
			return false;
		}
		for (var i=0;i<document.addaucitem.elements.length;i++){
			if (document.addaucitem.elements[i].type=="checkbox" && document.addaucitem.elements[i].id=="options"){
				if(document.addaucitem.elements[i].checked==true){
					submitoptions = submitoptions + document.addaucitem.elements[i].value + '|'
				}else{
					submitnonoptions = submitnonoptions + document.addaucitem.elements[i].value + '|'
				}
			}else{
				if(document.addaucitem.elements[i].id != 'picturefolders' && document.addaucitem.elements[i].id != 'picturefiles' && document.addaucitem.elements[i].type!="button"){
					submitstring = submitstring + '&'+document.addaucitem.elements[i].id+'='+escape(document.addaucitem.elements[i].value)
				}
			}
		}
		for(var i=0;i < PreviewPics[0].length;i++){
			if(PreviewPics[0][i] != ''){
				picturestring = picturestring + PreviewPics[0][i] + ','
			}
		}
		var senditem = AuctionsManage('pictures='+escape(picturestring.substr(0,picturestring.length - 1))+submitstring+'&options='+submitoptions+'&nonoptions='+submitnonoptions,'addmod')
		obj['test'].innerHTML = senditem
		if (senditem == 'True'){
			ClearAuctionForm()
			for (var i=0;i<document.addaucitem.elements.length;i++){
				if (document.addaucitem.elements[i].type=="checkbox"){
					document.addaucitem.elements[i].checked = false;
				}else if(document.addaucitem.elements[i].type=="select"){
					document.addaucitem.elements[i].selectedIndex = 0;
				}else{
					if(document.addaucitem.elements[i].type!="button"){
						document.addaucitem.elements[i].value = '';
					}
				}
			}
			obj['yearmodel'].style.display = 'none';
			obj['car_options_list'].style.display = 'none';
			if (obj['crtab_1'].innerHTML == 'Modify Item'){
				alert('Item has been modified')
				obj['crtab_1'].innerHTML = 'Add Item'
			}else{
				alert('Item has been added')
			}
		}else{
			//obj['test'].innerHTML = (senditem)
			alert(senditem)
		}
	}
	
	function PreviewPicture(id,addremove){		
		var pictureadd = id;
		var temppictureadd = '';
		var newpicturearray = '';
		if (addremove == 'add'){
			for(var i=0;i < PreviewPics[0].length;i++){
				if (PreviewPics[0][i] == ''){
					PreviewPics[0][i] = pictureadd
					pictureadd = ''
				}else if(PreviewPics[0][i] == pictureadd){
					pictureadd = ''
					alert('You already have that picture chosen')
					return false;
				}
			}
			if (pictureadd != ''){
				alert('You must remove a picture to add another one. Limit of 5 pictures per item')
			}
		}else if(addremove == 'remove'){
			temppictureadd = pictureadd.substr(pictureadd.lastIndexOf('&file=')+6,pictureadd.length)
			for(var i=0;i < PreviewPics[0].length;i++){
				if (PreviewPics[0][i] == temppictureadd){
					PreviewPics[0][i] = ''
					pictureadd = ''
				}else{
					newpicturearray = newpicturearray + PreviewPics[0][i] + ","
				}
			}
			var newtemppicturearray = newpicturearray.split(",")
			for(var i=0;i < PreviewPics[0].length;i++){
				PreviewPics[0][i] = newtemppicturearray[i]
			}
		}
		for(var i=0;i < PreviewPics[0].length;i++){
			var imgobj = document.getElementsByTagName("img")
			if (PreviewPics[0][i] != ''){
				imgobj['previewpic_'+i].src = 'images/images.asp?path=auctions&width=40&sharpen=true&file='+PreviewPics[0][i]
			}else{
				imgobj['previewpic_'+i].src = 'images/spacer.gif'
			}
		} 
		//alert(PreviewPics[0])
	}
	
	function GetPictureFolders(id){
		obj['picture_files'].innerHTML = 'Pictures:<select id="picturefiles" style="width:178px;height:18px;font-size:11px;margin-left:3px">' + AuctionsManage('folders='+id+'&files=True','user') + '</select><input onClick="PreviewPicture(document.addaucitem.picturefiles.value,\'add\');document.addaucitem.picturefiles.selectedIndex = 0" type="button" id="addpicture" value="Add" style="width:37px;height:19px;font-size:11px;margin-left:3px">'
	}
	
	function CreateManufactures(){
		var TempManHTML = '';
		TempManHTML = TempManHTML + '<div style="text-align:right;margin-top:3px">Vehicle Make:<select id="make" onChange="Holders[0][4]=this.value;CheckManufacture()" style="width:98px;height:18px;font-size:11px;margin-left:3px">'
		var TempManufactures = ManufactureList.split(",")
		TempManHTML = TempManHTML + '<option value="" selected></option><option value="0">Not A Vehicle</option>'
		for(var i=0;i < TempManufactures.length;i++){
			TempManHTML = TempManHTML + '<option value="'+TempManufactures[i]+'">'+TempManufactures[i]+'</option>'
		}
		TempManHTML = TempManHTML + '</select><input type="text" id="make_other" onKeyUp="Holders[0][5]=this.value" style="width:117px;height:19px;font-size:11px;margin-left:3px;background-color:#cccccc" value="'+Holders[0][5]+'" disabled></div>'
		TempManHTML = TempManHTML + '<div id="yearmodel" style="display:none;text-align:right;margin-top:3px"></div>'
		return TempManHTML;
	}
	
	function CreateTabs(){
		var CreateTabsHTML = '';
		CreateTabsHTML = CreateTabsHTML + '<table class="nobordertable"><tr>'
		for(var i in ManageTabs){
			if (ManageTabs[i][2] != credentials[0]){
				CreateTabsHTML = CreateTabsHTML + '<td><div id="tab_'+ManageTabs[i][0]+'" style="display:inline;cursor:pointer" onClick="CallSelectedTab(\''+ManageTabs[i][0]+'\')"><table class="nobordertable" id="tab_'+ManageTabs[i][0]+'" style="background-color:#cccccc"><tr><td style="height:20px;vertical-align:top;width:2px"><img src="images/round_boxes_multi/top_left_white.gif" style="width:2px;height:2px"></td><td style="padding:3px"><div id="crtab_'+i+'">'+ManageTabs[i][1]+'</div></td><td style="width:2px;vertical-align:top"><img src="images/round_boxes_multi/top_right_white.gif" style="width:2px;height:2px"></td><td style="width:1px;background-color:#ffffff"></td></tr></table></div></td>'
			}
		}
		CreateTabsHTML = CreateTabsHTML + '</tr></table>'
		return CreateTabsHTML;
	}
	
	function ClearAuctionForm(){
		for(var i=0;i < Holders[0].length;i++){
			Holders[0][i] = ''
		}
		PreviewPics[0] = new Array("","","","","")
		//for (var i=0;i<document.addaucitem.elements.length;i++){
		//	if (document.addaucitem.elements[i].type=="checkbox"){
		//		document.addaucitem.elements[i].checked = false;
		//	}else if(document.addaucitem.elements[i].type=="select"){
		//		document.addaucitem.elements[i].selectedIndex = 0
		//	}else{
		//		document.addaucitem.elements[i].value = ''
		//	}
		//}
	}
	
	function showRowIndex(button){
		var el = button;
		while(el.tagName.toLowerCase() != "tr")
		el = el.parentNode;
		return el.sectionRowIndex;
	}

	
	function ManageFiles(filename,id,dothis){
		if(dothis=='delete' && confirm('OK To Delete File')){
			var theTable, theTableBody
			theTable = (document.all) ? document.all.tablefilelists : document.getElementById("tablefilelists")
			theTableBody = theTable.tBodies[0]
			theTableBody.deleteRow(id)
			alert(AuctionsManage('mfg_delete=delete_folder&folders='+filename,'user'))
			
		}else if(dothis=='addfile'){
			ManageFolders(addfile)
		}
	}
	var tempdividnumber = 1

	function UploadOverlay(show){		
		if(show == 'show'){
			obj['upload_overlay'].style.display = 'block';
			var opacity = 80
		}else{
			obj['upload_overlay'].style.display = 'none';
			var opacity = 0
		}
		obj['upload_overlay'].style.height = obj['wrapper_addfiles_filebox'].clientHeight + 1
		obj['upload_overlay'].style.width = obj['wrapper_addfiles_filebox'].clientWidth + 1
		var object = document.getElementById('upload_overlay').style;
		object.opacity = (opacity / 100); 
		object.MozOpacity = (opacity / 100); 
		object.KhtmlOpacity = (opacity / 100); 
		object.filter = "alpha(opacity=" + opacity + ")";
		obj['upload_overlay'].innerHTML = '<div style="margin-top:'+obj['wrapper_addfiles_filebox'].clientHeight/2+';margin-left:'+obj['wrapper_addfiles_filebox'].clientWidth/2+'"><img src="images/reuse/loading.gif" style="margin-top:-15px"></div>'
	}
	
	function ManageFolders(id){
		var tempmanagehtml = ''
		if(id==''){
			tempmanagehtml = '';
			obj['addfolderboxlist'].style.display = 'none';
		}else if(id=='0'){
			tempmanagehtml = tempmanagehtml + '<div style="text-align:right"><form style="display:inline" name="create_folder">Folder Name:<input type="text" id="folder" style="width:287px;margin-left:3px;margin-right:3px;height:20px"><input type="button" onClick="ManageFolders(\'createfolder\')" value="Create" style="width:60px;height:20px;font-size:11px"></form></div>';
			obj['addfolderboxlist'].style.display = 'block';
		}else if(id=='deletefolder'){
			var deletefolder = AuctionsManage('mng_folders=deletefolder&folders='+escape(document.mng_folders.folders.value),'user')
			if (deletefolder == credentials[1]){
				CallSelectedTab('2')
			}else{
				alert('An Error Occured. Folder Was Not Deleted')
			}
			
		}else if(id=='createfolder'){
			if (document.create_folder.folder.value.match(/[^\w\ ]/)){
				alert('Folder names must be alphanumeric.')
				return false;
			}else if(document.create_folder.folder.value == 'createfolder' || document.create_folder.folder.value == 'deletefolder'){
				alert('Invalid Folder Name. Folder was not created.')
				return false;
			}
			alert(AuctionsManage('mng_folders=createfolder&folders='+credentials[1]+'/'+escape(document.create_folder.folder.value),'user'))
			CallSelectedTab('2')
		}else{
			tempmanagehtml = tempmanagehtml + '<div id="upload_overlay" style="position:absolute;display:none;z-index:100;margin:-1px;background-color:#ffffff"></div><div style="width:100%" id="wrapper_addfiles_filebox" style="">'
			tempmanagehtml = tempmanagehtml + '	<form name="addfiles" style="display:inline" method="post" enctype="multipart/form-data" action="data/uploads_files.asp" target="upload">'
			tempmanagehtml = tempmanagehtml + '	<input name="uploadpath" type="hidden" value="images/auctions/'+id+'">'
			var dividdisplay = '';
			var divid = 0
			
			for (var i = 0; i < 11; i++){
				divid++
				if(i != 0){
					 dividdisplay = ';display:none'
				}
				tempmanagehtml = tempmanagehtml + '	<div id="af_'+i+'" style="height:26px;vertical-align:top'+dividdisplay+'"><input type="file" size="46" style="height:22px" name="file_'+i+'" onChange="ShowHideDiv(\'af_'+divid+'\',\'\');"><input type="button" value="Clear" onClick="obj[\'af_'+i+'\'].innerHTML = obj[\'af_'+i+'\'].innerHTML" style="width:60px;height:22px;margin-left:3px"></div>'
			}
			
			tempmanagehtml = tempmanagehtml + ' <div id="files_buttons" style="text-align:right;margin-right:6px;_margin-right:1px;margin-bottom:5px"><input type="submit" style="height:21px;" onClick="UploadOverlay(\'show\');" value="Upload Files"></div>'
			tempmanagehtml = tempmanagehtml + '	</form>'
			tempmanagehtml = tempmanagehtml + ' </div>'
			var returnfiles = AuctionsManage('folders='+id+'&folderlists=True&files=True','user')
			if(returnfiles != ''){
				tempmanagehtml = tempmanagehtml + '<div style="width:100%"><table class="nobordertable" style="width:100%" name="tablefilelists" id="tablefilelists">'+returnfiles+'</table></div>'
			}
			obj['addfolderboxlist'].style.display = 'block';
			tempmanagehtml = tempmanagehtml + ' <iframe name="upload" noresize scrolling="no" src="about:blank" id="upload" style="width:1px;height:1px;border:0px" frameborder="0"></iframe><div style="text-align:right">'
			if (id.indexOf('/') != -1){
				tempmanagehtml = tempmanagehtml + '<input type="button" value="Delete Folder" onClick="ManageFolders(\'deletefolder\')" style="width:115px;height:22px;margin-top:2px;margin-right:1px"></div>'
			}
		}
		obj['addfolderboxlist'].innerHTML = tempmanagehtml
	}
	
	var DisplayTypes = new Array();
		DisplayTypes[0] = new Array("1","Marked As Rejected",",2,3,4,5,7,8,",",0,")
		DisplayTypes[1] = new Array("3","Awaiting Admin Approval",",2,3,4,5,7,8,",",2,")
		DisplayTypes[2] = new Array("5","Awaiting Rideau Approval",",3,4,5,6,7,8,",",3,4,5,")
		DisplayTypes[3] = new Array("4","Administrative Hold",",5,6,7,8,",",6,7,8,")
		DisplayTypes[4] = new Array("6","Currently Active",",3,4,5,6,7,8,",",6,7,8,")
		
	function AdminMoveIt(id){
		var strAdminMoveIt = '';
		if (id != ''){
			var IFar = document.getElementsByTagName('input')
			for (var i = 0; i < IFar.length; i++){
				if(IFar[i].type == 'checkbox' && IFar[i].id == 'singleuse' && IFar[i].checked == true){
					strAdminMoveIt = strAdminMoveIt + IFar[i].value + ','
				}
			}
			if(strAdminMoveIt != ''){
				xmlhttp.close
				xmlhttp.open("POST","data/post_xmldata_moveit.asp",false);
				xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
				xmlhttp.send('moveit='+id+'&items='+strAdminMoveIt)
				xmlhttp.close
				CallItemBottom(current_auc_type,credentials[1],credentials[0])
			}
		}
	}
	
	var current_auc_type
	function CallItemBottom(auc_type,account,authid){
		current_auc_type = auc_type
		var current_items_string = 'account='+account+'&auc_type='+auc_type+'&authid='+authid+'&type='+document.status_types.status.value
		xmlhttp.close
		xmlhttp.open("POST","data/xml_getdata_itemdata.asp",false);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
		xmlhttp.send(current_items_string)
		//Changed June 16th to AUTO from 360px
		obj['items_bottom_content'].style.height = 'auto'
		obj['items_bottom_content'].innerHTML = '<div style="height:360px;overflow:auto">'+xmlhttp.responseText+'</div>'
		xmlhttp.close
		
		var tempadmindobox = '';
		tempadmindobox = tempadmindobox + '<div style="position:absolute;margin-left:242px;*margin-left:121px;*margin-top:6px"><input onClick="AdminMoveIt(document.adminitemmove.moveselected.value)" type="button" value="Submit" style="font-size:11px;font-family:Tahoma;width:60px;height:19px"></div>'
		tempadmindobox = tempadmindobox + '<div style="margin-top:7px;">'
		tempadmindobox = tempadmindobox + '	<form name="adminitemmove" style="display:inline">'
		tempadmindobox = tempadmindobox + '		<select id="moveselected" style="width:240px;height:19px;font-size:11px;font-family:Tahoma">'
		tempadmindobox = tempadmindobox + '			<option value=""></option>'
		tempadmindobox = tempadmindobox + '			<option value="0">Delete Selected Items</option>'
		var currentmoveid = document.status_types.status.value
		if(currentmoveid == '3' && authid > 3){
			tempadmindobox = tempadmindobox + '			<option value="5">Send Selected Items For Rideau Approval</option>'
			tempadmindobox = tempadmindobox + '			<option value="1">Reject Selected Items</option>'
		}
		if(currentmoveid == '4' && authid > 4){
			tempadmindobox = tempadmindobox + '			<option value="6">Approve Selected Items For Website</option>'
			tempadmindobox = tempadmindobox + '			<option value="1">Reject Selected Items</option>'
		}
		if(currentmoveid == '5' && authid > 4){
			tempadmindobox = tempadmindobox + '			<option value="6">Approve Selected Items For Website</option>'
			tempadmindobox = tempadmindobox + '			<option value="1">Reject Selected Items</option>'
			tempadmindobox = tempadmindobox + '			<option value="4">Put Items On Administrative Hold</option>'
		}
		if(currentmoveid == '6' && authid > 4){
			tempadmindobox = tempadmindobox + '			<option value="1">Reject Selected Items</option>'
			tempadmindobox = tempadmindobox + '			<option value="4">Put Items On Administrative Hold</option>'
		}
		tempadmindobox = tempadmindobox + '		</select>'
		tempadmindobox = tempadmindobox + '	</form>'
		tempadmindobox = tempadmindobox + '</div>'
		obj['items_lower'].innerHTML = tempadmindobox
	}
	
	function ModifyIndividualDelItem(id,formreset){
		if(confirm('Delete this item?')){
			xmlhttp.close
			xmlhttp.open("POST","data/xml_getdata_itemdata.asp",false);
			xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
			xmlhttp.send('delete=true&id='+id+'&account='+credentials[1])
			xmlhttp.close
			if(formreset == 'items'){
				CallItemBottom(current_auc_type,credentials[1],credentials[0])
			}
		}
	}
	
	function ModifyIndividualSalePrice(id,formtype){
		if (obj['pricewar_'+id].style.display == 'none'){
			if(formtype == 'price'){
				obj['pricewar_'+id].innerHTML = '<form name="updateprice" style="display:inline"><input type="hidden" value="'+id+'" id="id"><select id="date" style="width:150px;height:19px;font-size:11px;font-family:Tahoma;margin-right:3px;">'+AuctionsManage('auctiondates=true&auction_type='+current_auc_type+'&hm=5','user')+'</select>Amount:<input type="text" value="" id="amount" style="height:19px;width:80px;font-family:Tahome;margin-left:2px;font-size:11px"><input type="button" onclick="ModifyIndividualAction(document.updateprice.date.value,\'price\',document.updateprice.amount.value)" style="height:20px;width:60px;font-size:11px;font-family:Tahoma;position:absolute;margin-top:-1px;margin-left:2px" value="Update"></form>';
			}else if(formtype == 'move'){
				obj['pricewar_'+id].innerHTML = '<form name="moveauction" style="display:inline"><input type="hidden" value="'+id+'" id="id"><select id="auction" style="width:190px;height:19px;font-size:11px;font-family:Tahoma;margin-right:3px;">'+AuctionsManage('auctiontypes='+current_auc_type,'user')+'</select><input type="button" onclick="ModifyIndividualAction(document.moveauction.auction.value,\'move\',\'\')" style="height:19px;width:60px;font-size:11px;font-family:Tahoma;position:absolute;margin-top:-1px" value="Move"></form>';
			}
			obj['pricewar_'+id].style.display = 'block';
		}else{
			obj['pricewar_'+id].innerHTML = '';
			obj['pricewar_'+id].style.display = 'none';
		}
	}
	
	function ModifyIndividualAction(id,dowhat,extra){
		if(dowhat == 'price'){
			AuctionsManage('quicky=true&action_type='+dowhat+'&atid='+id+'&extra='+extra+'&itemid='+document.updateprice.id.value,'user')
		}else if(dowhat == 'move'){
			AuctionsManage('quicky=true&action_type='+dowhat+'&atid='+id+'&extra='+extra+'&itemid='+document.moveauction.id.value,'user')
		}
		CallItemBottom(current_auc_type,credentials[1],credentials[0])
	}
	
	function ModifyIndividualItem(id){
		xmlhttp.close
		xmlhttp.open("POST","data/xml_getdata_itemdata.asp",false);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
		xmlhttp.send('id='+id+'&act='+credentials[1])
		//alert(xmlhttp.responseText)
		if (window.ActiveXObject){
			var doc=new ActiveXObject("Microsoft.XMLDOM");
			doc.async="false";
			doc.loadXML(xmlhttp.responseText);
		}else{
			var parser=new DOMParser();
			var doc=parser.parseFromString(xmlhttp.responseText,"text/xml");
		}
		xmlhttp.close
		obj['crtab_1'].innerHTML = 'Modify Item'
		var objXML = doc.getElementsByTagName('item')[0]
		Holders[0][0] = objXML.childNodes[3].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][1] = objXML.childNodes[2].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][2] = objXML.childNodes[1].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][3] = objXML.childNodes[38].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][4] = objXML.childNodes[5].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][5] = objXML.childNodes[5].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][6] = objXML.childNodes[6].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][7] = objXML.childNodes[4].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][8] = objXML.childNodes[10].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][9] = objXML.childNodes[7].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][10] = objXML.childNodes[8].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][11] = objXML.childNodes[11].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][12] = objXML.childNodes[12].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][13] = objXML.childNodes[9].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][14] = objXML.childNodes[34].childNodes[0].nodeValue.replace("|empty|","")
		Holders[0][15] = objXML.childNodes[33].childNodes[0].nodeValue.replace("|empty|","")
		for(var i=0;i < PreviewPics[0].length;i++) {
			PreviewPics[0][i] = ''
		}
		var TemporaryPicturesMod = Holders[0][15].split(',');
		for(var i=0;i < TemporaryPicturesMod.length;i++) {
			PreviewPics[0][i] = TemporaryPicturesMod[i]
		}
		Holders[0][17] = objXML.childNodes[0].childNodes[0].nodeValue
		CallSelectedTab(1)
		var CurrentVehicleMake = ''
		if(Holders[0][4] == ''){
			CurrentVehicleMake = 1
		}else{
			for (var i = 0; i < document.addaucitem.make.length; i++){
				if (document.addaucitem.make.options[i].value == Holders[0][4]){
					CurrentVehicleMake = i
				}
			}
		}
		if(CurrentVehicleMake == ''){
			for (var i = 0; i < document.addaucitem.make.length; i++){
				if (document.addaucitem.make.options[i].value == 'Other'){
					CurrentVehicleMake = i
					document.addaucitem.make_other.value = Holders[0][4]
				}
			}
		}
		document.addaucitem.make.options[CurrentVehicleMake].selected = true;
		document.addaucitem.lot_consigner.value = Holders[0][0]
		document.addaucitem.lot_rideau.value = Holders[0][1]
		CheckManufacture()
		for (var i = 0; i < objXML.childNodes.length; i++){
			if(objXML.childNodes[i].childNodes[0].nodeValue == 'True'){
				for (var ii = 0; ii < document.addaucitem.options.length; ii++){
					if (document.addaucitem.options[ii].value == objXML.childNodes[i].nodeName){
						document.addaucitem.options[ii].checked = true;
					}
				}
			}
		}
		if(document.addaucitem.auction_type != null){
			for (var i = 0; i < document.addaucitem.auction_type.length; i++){
				if (document.addaucitem.auction_type.options[i].value == Holders[0][2]){
					document.addaucitem.auction_type.options[i].selected = true;
				}
			}
		}
		if(document.addaucitem.consigner != null){
			for (var i = 0; i < document.addaucitem.consigner.length; i++){
				if (document.addaucitem.consigner.options[i].value == Holders[0][3]){
					document.addaucitem.consigner.options[i].selected = true;
				}
			}
		}
		obj['crtab_1'].innerHTML = 'Modify Item'
	}
	
	function CallSelectedTab(id){
		if (credentials[0] < 2){
			alert('Credentials Are Required To Access This Section')
		}else{
			for(var i in ManageTabs){
				if (ManageTabs[i][2] != credentials[0]){
					objtb['tab_'+i].style.background = '#cccccc'
				}
			}
			objtb['tab_'+id].style.background = '#e4e4e4'
			if(id==0){
				obj['crtab_1'].innerHTML = 'Add Item'
				var auc_type;
				if(credentials[0] > 4){
					obj['manage_items_content'].innerHTML = '<div style="padding:3px;_width:100%"><div id="items_top">'+AuctionsManage('auction='+getQueryVariable('auc_type'),'consigners')+'</div><div id="items_middle"></div><div id="items_bottom"></div><div id="items_lower"></div></div>'
				}else{
					obj['manage_items_content'].innerHTML = '<div style="padding:3px;_width:100%"><div id="items_middle"></div><div id="items_bottom"></div><div id="items_lower"></div></div>'
				}
				
				if (document.auction_types != null){
					auc_type = document.auction_types.auction.value
				}else{
					auc_type = getQueryVariable('auc_type')
				}
				var item_middleHTML = '';
				item_middleHTML = item_middleHTML + '<form style="display:inline" name="status_types"><div style="text-align:right;margin-bottom:6px">Display Items:<select id="status" onChange="CallItemBottom(current_auc_type,credentials[1],credentials[0])" style="width:200px;height:20px;font-size:11px;margin-left:3px">'
				var remake_credential = ','+credentials[0]+','
				for(var i in DisplayTypes){
					if (DisplayTypes[i][2].indexOf(remake_credential) != -1){
						if (DisplayTypes[i][3].indexOf(remake_credential) != -1){
							item_middleHTML = item_middleHTML + '<option value="'+DisplayTypes[i][0]+'" selected>'+DisplayTypes[i][1]+'</option>'
						}else{
							item_middleHTML = item_middleHTML + '<option value="'+DisplayTypes[i][0]+'">'+DisplayTypes[i][1]+'</option>'
						}
					}
				}
				item_middleHTML = item_middleHTML + '</select></div></form>'
				obj['items_middle'].innerHTML = item_middleHTML
				var item_bottomHTML = '';
				item_bottomHTML = item_bottomHTML + '<div style="width:100%"><div style="_width:100%;">'
				item_bottomHTML = item_bottomHTML + '<table class="nobordertable" style="background-color:#ffffff;width:100%">'
				item_bottomHTML = item_bottomHTML + '  <tr>'
				item_bottomHTML = item_bottomHTML + '    <td style="vertical-align:top;width:2px;height:2px"><img src="images/round_boxes_multi/top_left.gif" style="width:2px;height:2px"></td>'
				item_bottomHTML = item_bottomHTML + '	 <td style="height:2px"><img src="images/spacer.gif"></td>'
				item_bottomHTML = item_bottomHTML + '	 <td style="width:2px;vertical-align:top"><img src="images/round_boxes_multi/top_right.gif" style="width:2px;height:2px"></td>'
				item_bottomHTML = item_bottomHTML + '  </tr>'
				item_bottomHTML = item_bottomHTML + '  <tr>'
				item_bottomHTML = item_bottomHTML + '    <td style="vertical-align:top;width:2px;height:2px"><img src="images/spacer.gif" style="width:2px;height:2px"></td>'
				item_bottomHTML = item_bottomHTML + '	 <td style=""><div id="items_bottom_content"></div></td>'
				item_bottomHTML = item_bottomHTML + '	 <td style="width:2px;vertical-align:top"><img src="images/spacer.gif" style="width:2px;height:2px"></td>'
				item_bottomHTML = item_bottomHTML + '  </tr>'
				item_bottomHTML = item_bottomHTML + '  <tr>'
				item_bottomHTML = item_bottomHTML + '    <td style="vertical-align:top;width:2px;height:2px"><img src="images/round_boxes_multi/bottom_left.gif" style="width:2px;height:2px"></td>'
				item_bottomHTML = item_bottomHTML + '	 <td style="height:2px"><img src="images/spacer.gif"></td>'
				item_bottomHTML = item_bottomHTML + '	 <td style="width:2px;vertical-align:top"><img src="images/round_boxes_multi/bottom_right.gif" style="width:2px;height:2px"></td>'
				item_bottomHTML = item_bottomHTML + '  </tr>'
				item_bottomHTML = item_bottomHTML + '</table>'
				item_bottomHTML = item_bottomHTML + '</div></div>'
				obj['items_bottom'].innerHTML = item_bottomHTML
				CallItemBottom(auc_type,credentials[1],credentials[0])
				return false;
			}else if(id==1){
				if(obj['crtab_1'].innerHTML == 'Add Item'){
					ClearAuctionForm()
				}
				obj['manage_items_content'].innerHTML = '<div style="padding:3px;_width:100%">'+AddModifyAuction()+'</div>'
			}else if(id==2){
				obj['crtab_1'].innerHTML = 'Add Item'
				var addfolderhtml = '';
				addfolderhtml = addfolderhtml + '<div style="width:100%"><div style="margin:3px;_width:100%;">'
				addfolderhtml = addfolderhtml + '<table class="nobordertable" style="background-color:#ffffff;width:100%">'
				addfolderhtml = addfolderhtml + '  <tr>'
				addfolderhtml = addfolderhtml + '    <td style="vertical-align:top;width:2px;height:2px"><img src="images/round_boxes_multi/top_left.gif" style="width:2px;height:2px"></td>'
				addfolderhtml = addfolderhtml + '	 <td style="height:2px"><img src="images/spacer.gif"></td>'
				addfolderhtml = addfolderhtml + '	 <td style="width:2px;vertical-align:top"><img src="images/round_boxes_multi/top_right.gif" style="width:2px;height:2px"></td>'
				addfolderhtml = addfolderhtml + '  </tr>'
				addfolderhtml = addfolderhtml + '  <tr>'
				addfolderhtml = addfolderhtml + '    <td style="vertical-align:top;width:2px;height:2px"><img src="images/spacer.gif" style="width:2px;height:2px"></td>'
				addfolderhtml = addfolderhtml + '	 <td style=""><div id="addfolderbox" style=";margin:3px;text-align:right">Manage Folder:<form name="mng_folders" style="display:inline"><select id="folders" onChange="ManageFolders(document.mng_folders.folders.value)" style="height:20px;width:350px;font-size:12px;margin-left:3px"><option value="" selected></option><option value="0">Create New Folder</option>'+AuctionsManage('mng_folders=True&folders='+credentials[1],'user')+'</select></form></div></td>'
				addfolderhtml = addfolderhtml + '	 <td style="width:2px;vertical-align:top"><img src="images/spacer.gif" style="width:2px;height:2px"></td>'
				addfolderhtml = addfolderhtml + '  </tr>'
				addfolderhtml = addfolderhtml + '  <tr>'
				addfolderhtml = addfolderhtml + '    <td style="vertical-align:top;width:2px;height:2px"><img src="images/round_boxes_multi/bottom_left.gif" style="width:2px;height:2px"></td>'
				addfolderhtml = addfolderhtml + '	 <td style="height:2px"><img src="images/spacer.gif"></td>'
				addfolderhtml = addfolderhtml + '	 <td style="width:2px;vertical-align:top"><img src="images/round_boxes_multi/bottom_right.gif" style="width:2px;height:2px"></td>'
				addfolderhtml = addfolderhtml + '  </tr>'
				addfolderhtml = addfolderhtml + '</table>'
				addfolderhtml = addfolderhtml + '</div></div>'
				addfolderhtml = addfolderhtml + '<div id="addfolderboxlist" style="margin:0px 3px 0px 3px;background-color:#ffffff;display:none;padding:5px"></div>'
				obj['manage_items_content'].innerHTML = addfolderhtml
			}else if(id==3){
				ClearAuctionForm()
				Holders[0] = new Array("","","","","","","","","","","","","","","","","","","","","","","","","","","","","","")
				obj['manage_items_content'].innerHTML = '<div style="padding:3px;_width:100%">'+AddModifyAuction()+'</div>'
			}else{
				obj['manage_items_content'].innerHTML = ''
			}
		}
	}
	
	function MainAuctions(id,aucid,sub,extra){	
		AuctionsManage('action=verify&stringfiller=a&auction='+aucid,'user')
		if(sub=='load' && aucid > 0){
			credentials = AuctionsManage('usersettings=true','user').split("-")
			if (credentials[0] > 1){
				var CurrentHTML = '';
				CurrentHTML = CurrentHTML + '<div style="margin-top:3px">'+CreateTabs()+'</div>'
				CurrentHTML = CurrentHTML + '<div style="background-color:#e4e4e4">'
				CurrentHTML = CurrentHTML + '	<table class="nobordertable" style="width:100%"><tr><td style="vertical-align:top;width:2px;height:2px"><img src="images/spacer.gif" style="width:2px;height:2px"></td><td style="height:2px"><img src="images/spacer.gif" style="width:2px;height:2px"></td><td style="width:2px;height:2px"><img src="images/round_boxes_multi/top_right_white.gif" style="width:2px;height:2px"></td></tr></table>'
				CurrentHTML = CurrentHTML + '	<div style="padding:2px" id="manage_items_content"></div>'
				CurrentHTML = CurrentHTML + '	<table class="nobordertable" style="width:100%"><tr><td style="vertical-align:top;width:2px;height:2px"><img src="images/round_boxes_multi/bottom_left_white.gif" style="width:2px;height:2px"></td><td style="height:2px"><img src="images/spacer.gif" style="width:2px;height:2px"></td><td style="width:2px;height:2px"><img src="images/round_boxes_multi/bottom_right_white.gif" style="width:2px;height:2px"></td></tr></table>'
				CurrentHTML = CurrentHTML + '</div>'
				obj['CurrentContent'].innerHTML = CurrentHTML;
				CallSelectedTab('0')
			}else{
				alert('Please Recheck Your Credentials For This Account')
				var imgobj = document.getElementsByTagName("img")
				imgobj['manage_auctions_image'].src = 'images/spacer.gif'
			}
		}
	}
	
	function AddModifyAuction(){
		var temporaryhtml = '';
		temporaryhtml = temporaryhtml + '<form name="addaucitem" style="display:inline"><input type="hidden" value="'+Holders[0][17]+'" id="id"><table class="nobordertable" style="width:100%">'
		temporaryhtml = temporaryhtml + '  <tr>'
		temporaryhtml = temporaryhtml + '    <td style="vertical-align:top">'
		temporaryhtml = temporaryhtml + AuctionsManage('consignor='+credentials[1]+'&auction='+credentials[2],'user')
		temporaryhtml = temporaryhtml + CreateManufactures()
		temporaryhtml = temporaryhtml + '    </td>'
		temporaryhtml = temporaryhtml + '    <td style="width:5px"></td>'
		temporaryhtml = temporaryhtml + '    <td style="width:140px;border-left:1px solid #999999;vertical-align:top"><div id="car_options_list" style="display:none">'
		for(var i in VehicleOptions){
			temporaryhtml = temporaryhtml + '<div style="padding:2px;vertical-align:top"><input type="checkbox" id="options" value="'+VehicleOptions[i][0]+'" style="margin:0px;padding:0px;height:12px;width:12px;margin-right:2px;margin-left:3px">'+VehicleOptions[i][2]+'</div>'
		}
		temporaryhtml = temporaryhtml + '    </div></td>'
		temporaryhtml = temporaryhtml + '  <tr>'
		temporaryhtml = temporaryhtml + '<table></form>'
		return temporaryhtml;
	}
	
	function AuctionsManage(strString,filename){
		var urlstring = 'data/post_auctions_'+filename+'.asp'
		xmlhttp.close
		xmlhttp.open("POST",urlstring,false);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
		xmlhttp.send(strString)
		return xmlhttp.responseText;
		xmlhttp.close
	}
	
	
	var aucid_hold
	function MarketReport(display,aucid){
		
		aucid_hold = aucid
		if(display == 'view'){			
			xmlhttp.close
			xmlhttp.open("POST","data/get_xmldata_marketreports.asp",false);
			xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
			xmlhttp.send('display=xml&auction='+aucid)
			if (window.ActiveXObject){
				var doc=new ActiveXObject("Microsoft.XMLDOM");
				doc.async="false";
				doc.loadXML(xmlhttp.responseText);
			}else{
				var parser=new DOMParser();
				var doc=parser.parseFromString(xmlhttp.responseText,"text/xml");
			}
			//alert(xmlhttp.responseText)
			xmlhttp.close
			var objXML = doc.getElementsByTagName('results')[0]
			if (objXML.getElementsByTagName('auctiondata')[0].getAttribute('type') == 'valid'){
				var PageHeight = getPageSize()+''
				PageHeight = PageHeight.split(",")
				if(obj['ActualContent'].clientHeight < PageHeight[3]){
					if (window.ActiveXObject){
						obj['ActualContent'].style.height = PageHeight[1]-4+'px'
					}else{
						obj['ActualContent'].style.height = PageHeight[1]-10+'px'
					}
				}
				obj['ActualContent'].style.display = 'none';
				obj['MarketReportsContent'].style.display = 'block';
				var Nodes = objXML.getElementsByTagName('auctioninfo')[0]
				obj['market_modify_pagetitle'].innerHTML = Nodes.childNodes[1].childNodes[0].nodeValue+' - '+Nodes.childNodes[0].childNodes[0].nodeValue
				obj['market_modify_pagetitle2'].innerHTML = Nodes.childNodes[1].childNodes[0].nodeValue+' - '+Nodes.childNodes[0].childNodes[0].nodeValue
				var temporaryhtml = '';
				var rowbackground = 'd1d1d1'
				temporaryhtml = temporaryhtml + '<table class="nobordertable" style="width:100%">'
				temporaryhtml = temporaryhtml + '<tr style=""><th style="width:40px;border-bottom:1px solid #'+rowbackground+';padding:5px">Year</th><th style="width:120px;border-bottom:1px solid #'+rowbackground+'">Make</th><th style="width:150px;border-bottom:1px solid #'+rowbackground+'">Model</th><th style="width:115px;border-bottom:1px solid #'+rowbackground+'">Kms/Hrs</th><th style="width:95px;border-bottom:1px solid #'+rowbackground+'">Sale Price</th><th style="border-bottom:1px solid #'+rowbackground+'">Consignor</th></tr>'
				var items = doc.getElementsByTagName('items')[0]
				var backgrounds = ''
				var backgroundnumber = '0'
				var adminback = ''
				var remakeid = 0
				for (var i = 0; i < items.childNodes.length; i++){
					remakeid = items.childNodes[i].childNodes[7].childNodes[0].nodeValue
					if (backgroundnumber == '0'){
						backgroundnumber = '1'
						backgrounds = '#eeeeee'
					}else{
						backgroundnumber = '0'
						backgrounds = '#ffffff'
					}
					if(objXML.getElementsByTagName('auctiondata')[0].getAttribute('access') > 5){
						adminback = ' onClick="MoveMarketItem('+remakeid+')"'
					}
					temporaryhtml = temporaryhtml + '<tr'+adminback+' id="mr_'+remakeid+'" style="background-color:'+backgrounds+'" onMouseOver="ItemMouseOvers(\'mr_'+remakeid+'\',\'#FFFFCC\')" onMouseOut="ItemMouseOvers(\'mr_'+remakeid+'\',\''+backgrounds+'\')"><td class="marketreporttd">'+items.childNodes[i].childNodes[0].childNodes[0].nodeValue.replace("|empty|","")+'</td><td class="marketreporttd">'+items.childNodes[i].childNodes[1].childNodes[0].nodeValue.replace("|empty|","")+'</td><td class="marketreporttd">'+items.childNodes[i].childNodes[2].childNodes[0].nodeValue.replace("|empty|","")+'</td><td class="marketreporttd">'+items.childNodes[i].childNodes[3].childNodes[0].nodeValue.replace("|empty|","")+' '+items.childNodes[i].childNodes[4].childNodes[0].nodeValue.replace("|empty|","")+'</td><td class="marketreporttd"><div id="saleprice_'+remakeid+'">'+items.childNodes[i].childNodes[5].childNodes[0].nodeValue.replace("|empty|","")+'</div></td><td class="marketreporttd"><div id="saledates_'+remakeid+'">'+items.childNodes[i].childNodes[6].childNodes[0].nodeValue.replace("|empty|","")+'</div></td></tr>'
				}
				temporaryhtml = temporaryhtml + '</table>'
				obj['market_reports_content'].innerHTML = temporaryhtml
			}else{
				if (objXML.getElementsByTagName('auctiondata')[0].getAttribute('type') == 'credentials'){
					alert('Only authorized users are allowed to view those Market Reports')
				}else{
					alert('Invalid Auction')
				}
			}
		}else if(display == 'download'){
			var winpops=window.open('data/get_xmldata_marketreports.asp?display=download&auction='+aucid,'marketwindow')		
		}else if(display == 'hide'){
			obj['MarketReportsContent'].style.display = 'none';
			obj['ActualContent'].style.display = 'block';
		}
	}
	
	
	function Vote(){
		var PoleChoice = 0;
		for (i=0;i<document.poll_box.poll_vote.length;i++){ 
			if (document.poll_box.poll_vote[i].checked){ 
				PoleChoice = document.poll_box.poll_vote[i].value; 
		    } 
		}
		if (PoleChoice > 0 && (CookieMonster('poll','','','read') != obj['poll_box_id'].innerHTML)){
			xmlhttp.close
			xmlhttp.open("POST","data/polls.asp",false);
			xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
			xmlhttp.send('choice='+PoleChoice+'&poll='+obj['poll_box_id'].innerHTML)
			xmlhttp.close
			CookieMonster('poll',obj['poll_box_id'].innerHTML,'1','create')
			window.location.reload()
		}
	}
	
	var VehicleOptions = new Array();
	VehicleOptions[0] = new Array("air_brakes","AIR BRAKES","Air Brakes")
	VehicleOptions[1] = new Array("air_condition","AIR","Air Conditioning")
	VehicleOptions[2] = new Array("radio","AM/FM","AM/FM Radio")
	VehicleOptions[3] = new Array("cd_player","CD","CD Player")
	VehicleOptions[4] = new Array("club_cab","CLUB CAB","Club Cab")
	VehicleOptions[5] = new Array("crew_cab","CREW CAB","Crew Cab")
	VehicleOptions[6] = new Array("cruise","CRUISE","Cruise Control")
	VehicleOptions[7] = new Array("diesel","DIESEL","Diesel")
	VehicleOptions[8] = new Array("extended_cab","EXT CAB","Extended Cab")
	VehicleOptions[9] = new Array("navigation","NAV","Navigation")
	VehicleOptions[10] = new Array("power_brakes","PW","Power Brakes")
	VehicleOptions[11] = new Array("power_locks","PL","Power Locks")
	VehicleOptions[12] = new Array("power_seats","PS","Power Seats")
	VehicleOptions[13] = new Array("power_windows","PW","Power Windows")
	VehicleOptions[14] = new Array("quad_cab","QUAD CAB","Quad Cab")
	VehicleOptions[15] = new Array("stereo","STEREO","Stereo")
	VehicleOptions[16] = new Array("sun_roof","SUN ROOF","Sun Roof")
	VehicleOptions[17] = new Array("super_cab","SUP CAB","Super Cab")
	VehicleOptions[18] = new Array("tilt","TILT","Tilt Steering")
	VehicleOptions[19] = new Array("turbo_diesel","TURBO DIESEL","Turbo Diesel")
	
	
	var EngineType = new Array();
	EngineType[0] = new Array("")
	EngineType[1] = new Array("2 Cylinder")
	EngineType[2] = new Array("4 Cylinder")
	EngineType[3] = new Array("6 Cylinder")
	EngineType[4] = new Array("8 Cylinder")
	EngineType[5] = new Array("12 Cylinder")
	EngineType[6] = new Array("2 Stroke")
	EngineType[7] = new Array("4 Stroke")
	EngineType[8] = new Array("Other")
	
	var Transmissions = new Array();
	Transmissions[0] = new Array("","")
	Transmissions[1] = new Array("Automatic","Auto")
	Transmissions[2] = new Array("Manual","Manual")
	Transmissions[3] = new Array("Other","Other")
	
	var VehicleDivs = new Array();
	VehicleDivs[0] = new Array("lot_rideau","Lot")
	VehicleDivs[1] = new Array("vin","VIN")
	VehicleDivs[2] = new Array("colour","Color")
	
	var VehicleMiles = new Array();
	VehicleMiles[0] = new Array("","","")
	VehicleMiles[1] = new Array("Kilometers","KMS","Odometer:")
	VehicleMiles[2] = new Array("Miles","MILES","Odometer:")
	VehicleMiles[3] = new Array("Hours","HRS","Engine Hours:")
	
	
	function CarOptions(option,returnit){
		for(var i in VehicleOptions){
			if (VehicleOptions[i][0] == option){
				if (returnit == 'True'){
					return VehicleOptions[i][1]
				}
			}
		}
	}
	
	function TheBigPicture(id,folder){
		if (id.indexOf('images/spacer.gif') == -1){
			var thepic = folder+'/'+id.substr(id.lastIndexOf('&file=')+6,id.length)
			window.open("images/images.html?"+thepic, "BigWindow", "resizable=0");
		}
	}
	
	function ShowAuctionItem(subfunction,id,extra){
		imgobj = document.getElementsByTagName("img");
		if (subfunction == 'showitem'){
			var infoboxhtml = '';
			infoboxhtml = infoboxhtml + '<div style="position:absolute;margin:6px 0px 0px 8px;width:430px;overflow:hidden">'
				infoboxhtml = infoboxhtml + '<div style="font-size:14px;font-weight:bolder;white-space:nowrap;width:430px;color:#999999" id="AI_NameUnder"></div>'
				infoboxhtml = infoboxhtml + '<div style="font-size:14px;font-weight:bolder;white-space:nowrap;width:430px;margin:-18px 0px 0px -1px" id="AI_Name"></div>'
				infoboxhtml = infoboxhtml + '<div style="font-size:10px;margin-top:-4px;white-space:nowrap;width:430px" id="AI_Consignor"></div>'
			infoboxhtml = infoboxhtml + '</div>'
			infoboxhtml = infoboxhtml + '<div style="position:absolute;margin:40px 0px 0px 9px;height:193px;width:257px;overflow:hidden" id="AI_BigPic"><img name="AI_Picture_Main" src="images/spacer.gif" onClick="TheBigPicture(this.src,\'auctions\')" style="margin:0px;width:257px;height:193px"></div>'
			infoboxhtml = infoboxhtml + '<div style="position:absolute;margin:244px 0px 0px 9px;height:49px;width:64px;overflow:hidden" id="AI_Small1"><img name="AI_Small1" src="images/spacer.gif" onClick="ShowAuctionItem(\'changepic\',this.name,this.src)" style="margin:0px;width:62px;height:47"></div>'
			infoboxhtml = infoboxhtml + '<div style="position:absolute;margin:244px 0px 0px 74px;height:49px;width:64px;overflow:hidden" id="AI_Small2"><img name="AI_Small2" src="images/spacer.gif" onClick="ShowAuctionItem(\'changepic\',this.name,this.src)" style="margin:0px;width:62px;height:47"></div>'
			infoboxhtml = infoboxhtml + '<div style="position:absolute;margin:244px 0px 0px 139px;height:49px;width:64px;overflow:hidden" id="AI_Small3"><img name="AI_Small3" src="images/spacer.gif" onClick="ShowAuctionItem(\'changepic\',this.name,this.src)" style="margin:0px;width:62px;height:47"></div>'
			infoboxhtml = infoboxhtml + '<div style="position:absolute;margin:244px 0px 0px 204px;height:49px;width:64px;overflow:hidden" id="AI_Small4"><img name="AI_Small4" src="images/spacer.gif" onClick="ShowAuctionItem(\'changepic\',this.name,this.src)" style="margin:0px;width:62px;height:47"></div>'
			infoboxhtml = infoboxhtml + '<div style="position:absolute;margin:39px 0px 0px 270px;width:195px;overflow:hidden" id="AI_Content"></div>'
			obj['infobox'].innerHTML = infoboxhtml
			
			xmlhttp.close
			xmlhttp.open("POST","data/get_xmldata_items.asp",false);
			xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
			xmlhttp.send('id='+id+'&item='+extra)
			if (window.ActiveXObject){
				var doc=new ActiveXObject("Microsoft.XMLDOM");
				doc.async="false";
				doc.loadXML(xmlhttp.responseText);
			}else{
				var parser=new DOMParser();
				var doc=parser.parseFromString(xmlhttp.responseText,"text/xml");
			}
			xmlhttp.close
			
			if (extra == 'vehicle'){
				
				var OptionsList = ''
				var objXML = doc.getElementsByTagName('item')[0]
				for (var i = 0; i < objXML.childNodes.length; i++){
					var Option = CarOptions(objXML.childNodes[i].nodeName,objXML.childNodes[i].childNodes[0].nodeValue)
					if(Option != null){
						OptionsList = OptionsList + Option +', '
					}
				}
			
				infoboxhtml = ''
				
				for(var i in VehicleDivs){
					if (objXML.getElementsByTagName(''+VehicleDivs[i][0]+'')[0].childNodes[0].nodeValue != '|empty|'){
						infoboxhtml = infoboxhtml + '<div class="aucitem1"><div class="aucitem2">'+VehicleDivs[i][1]+':</div><div class="aucitem3">'+objXML.getElementsByTagName(VehicleDivs[i][0])[0].childNodes[0].nodeValue+'</div></div>';
					}
				}
				
				var itemtitle = ''
				if (objXML.getElementsByTagName('make')[0].childNodes[0].nodeValue != '|empty|' && objXML.getElementsByTagName('make')[0].childNodes[0].nodeValue != '0'){
					itemtitle = itemtitle + objXML.getElementsByTagName('make')[0].childNodes[0].nodeValue + ' '
				}
				if (objXML.getElementsByTagName('model')[0].childNodes[0].nodeValue != '|empty|'){
					itemtitle = itemtitle + objXML.getElementsByTagName('model')[0].childNodes[0].nodeValue + ' '
				}
				if (objXML.getElementsByTagName('year')[0].childNodes[0].nodeValue != '|empty|'){
					itemtitle = itemtitle + objXML.getElementsByTagName('year')[0].childNodes[0].nodeValue + ' '
				}
				
				if (objXML.getElementsByTagName('transmission')[0].childNodes[0].nodeValue > 0){
					infoboxhtml = infoboxhtml + '<div class="aucitem1"><div class="aucitem2">Engine:</div><div class="aucitem3">'+EngineType[objXML.getElementsByTagName('transmission')[0].childNodes[0].nodeValue][0]+'</div></div>'
				}
				
				if (objXML.getElementsByTagName('automatic')[0].childNodes[0].nodeValue > 0){
					infoboxhtml = infoboxhtml + '<div class="aucitem1"><div class="aucitem2">Transmission:</div><div class="aucitem3">'+Transmissions[objXML.getElementsByTagName('automatic')[0].childNodes[0].nodeValue][0]+'</div></div>'
				}
				
				if (objXML.getElementsByTagName('mileagehour')[0].childNodes[0].nodeValue > 0){
					infoboxhtml = infoboxhtml + '<div class="aucitem1"><div class="aucitem2">'+VehicleMiles[objXML.getElementsByTagName('mileorhour')[0].childNodes[0].nodeValue][2]+'</div><div class="aucitem3">'+objXML.getElementsByTagName('mileagehour')[0].childNodes[0].nodeValue+' '+VehicleMiles[objXML.getElementsByTagName('mileorhour')[0].childNodes[0].nodeValue][1]+'</div></div>'
				}
				
				if (OptionsList != ''){
					OptionsList = OptionsList.substring(0,OptionsList.length - 2)
					infoboxhtml = infoboxhtml + '<div class="aucitem1"><div class="aucitem2">Options:</div><div class="aucitem3" style="font-size:10px">'+OptionsList+'</div></div>'
				}
				
				obj['AI_Content'].innerHTML = infoboxhtml + '<div><form style="display:inline" name="itemdescription"><textarea id="description" style="height:1px;width:195px;border:0px;background:transparent;overflow:auto;font-size:11px;font-family:Tahoma;padding:5px 2px 2px 2px">'+objXML.getElementsByTagName('notes_item')[0].childNodes[0].nodeValue.replace("|empty|","")+'</textarea></form></div>'
				setTimeout("document.itemdescription.description.style.height = 270 - obj['AI_Content'].clientHeight",1)
				obj['AI_NameUnder'].innerHTML = itemtitle
				obj['AI_Name'].innerHTML = itemtitle
				if (objXML.getElementsByTagName('conid')[0].childNodes[0].nodeValue > 1){
					obj['AI_Consignor'].innerHTML = 'Consignor: '+objXML.getElementsByTagName('consigner_name')[0].childNodes[0].nodeValue;
				}else{
					obj['AI_Consignor'].innerHTML = 'Consignor:'
				}
				
				var current_images = objXML.getElementsByTagName('pictures')[0].childNodes[0].nodeValue;
				var current_images_array = current_images.split(",");
				var current_images_length = current_images_array.length
				if(current_images == '|empty|'){
					imgobj['AI_Picture_Main'].src = 'images/auctions/nopic.gif'
				}else{
					imgobj['AI_Picture_Main'].src = 'images/images.asp?path=auctions&width=257&sharpen=true&file='+current_images_array[0]
					imgobj['AI_Picture_Main'].style.cursor = 'pointer';
					//imgobj['AI_Picture_Main'].src = 'images/auctions/'+current_images_array[0]
					if(current_images_length > 1){
						for (var i=1; i < current_images_array.length; i++){
							imgobj['AI_Small'+i].src = 'images/images.asp?path=auctions&width=62&sharpen=true&file='+current_images_array[i]
							//imgobj['AI_Small'+i].src = 'images/auctions/'+current_images_array[i]
							imgobj['AI_Small'+i].style.cursor = 'pointer'
						}
					}
				}
				
			}else{
			
			}
		}else if(subfunction == 'changepic'){
			if (extra.indexOf('images/spacer.gif') == -1){
				extra = extra.substr(extra.lastIndexOf('&file=')+6,extra.length)
				var current_large = imgobj['AI_Picture_Main'].src
				imgobj['AI_Picture_Main'].src = 'images/images.asp?path=auctions&width=257&sharpen=true&file='+extra
				imgobj['AI_Picture_Main'].style.cursor = 'pointer';
				imgobj[id].src = current_large.replace("width=257","width=62")
			}
		}
	}
	
	function ContactUs(reaction){
		if (reaction == 'changing'){
			if (Trim(document.submit_contact_info.name.value) != '' && Trim(document.submit_contact_info.email.value) != '' && Trim(document.submit_contact_info.comments.value) != ''){
				document.submit_contact_info.comment_button.disabled = false;
			}else{
				document.submit_contact_info.comment_button.disabled = true;
			}
		}else if(reaction == 'submit'){
			if (Trim(document.submit_contact_info.name.value) == ''){
				alert('Please Provide Your Name')
				return false;
			}else if (Trim(document.submit_contact_info.email.value) == ''){
				alert('Please Provide Your Email Address')
				return false;
			}else if (Trim(document.submit_contact_info.comments.value) == ''){
				alert('Please Provide A Comment')
				return false;
			}
			var emailvalidator = 'False';
			xmlhttp.close
			xmlhttp.open("POST","data/validator.asp",false);
			xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
			xmlhttp.send('validate=email&item='+Trim(document.submit_contact_info.email.value))
			emailvalidator = xmlhttp.responseText
			xmlhttp.close
			if (emailvalidator == 'True'){
				var opacity = 40
				obj['submitting_comment_form'].style.display = 'block';
				document.submit_contact_info.comment_button.disabled = true;
				document.submit_contact_info.name.disabled = true;
				document.submit_contact_info.email.disabled = true;
				document.submit_contact_info.comments.disabled = true;
				var object = document.getElementById('comment_form').style;
				xmlhttp.close
				xmlhttp.open("POST","data/post_message.asp",false);
				xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
				xmlhttp.send('name='+escape(document.submit_contact_info.name.value)+'&email='+escape(document.submit_contact_info.email.value)+'&message='+escape(document.submit_contact_info.comments.value)+'&error='+escape(getQueryVariable("type"))+'&replyid='+obj['replyid'].innerHTML)
				xmlhttp.close	
				object.opacity = (opacity / 100); 
				object.MozOpacity = (opacity / 100); 
				object.KhtmlOpacity = (opacity / 100); 
				object.filter = "alpha(opacity=" + opacity + ")";
				setTimeout("UpdateMailMessage('Preparing To Send..')",1500)
				setTimeout("UpdateMailMessage('Preparing To Send...')",3000)
				setTimeout("UpdateMailMessage('Preparing To Send....')",4500)
				setTimeout("UpdateMailMessage('Sending.')",6000)
				setTimeout("UpdateMailMessage('Sending..')",7500)
				setTimeout("UpdateMailMessage('Sending...')",9000)
				setTimeout("UpdateMailMessage('Sending....')",10500)
				setTimeout("UpdateMailMessage('Message Has Been Sent<br>Thank You.')",12000)
				setTimeout("UpdateMailFinish()",13500)
			}else{
				alert('Please provide a valid email address');
				return false;
			}
		}
	}
	
	function ItemMouseOvers(strId,strColor){
		document.getElementById(strId).style.backgroundColor = strColor;
	}
	
		
	function NotifyMe(id,secondary){
		if (obj['notify_'+id].style.display == 'none'){
			obj['notify_'+id].style.display = 'block';
			var NotifyEmailAddress = "";
			var RemoveNotification = "";
			if (CookieMonster('email','','','read') != null){
				NotifyEmailAddress = CookieMonster('email','','','read')
			}
			if (CookieMonster('n'+id,'','','read') != null){
				RemoveNotification = CookieMonster('n'+id,'','','read')
			}
			if (RemoveNotification != ''){
				obj['notify_'+id].innerHTML = '<form name="notify_warning_'+id+'" style="display:inline"><div style="padding:5px">Get notified about this auction, enter your email address below.</div><div style="padding:5px">I would like to be notified <select name="hours" style="width:40px;height:16px;font-size:10px"><option value="24">24</option><option value="48">48</option><option value="72">72</option></select> hours before this auction starts.</div><div style="padding:0px 5px 0px 5px">My email address is <input type="text" value="'+NotifyEmailAddress+'" style="width:160px;height:18px;font-size:10px" disabled id="ea" name="ea"><div style="position:absolute"><input type="button" onClick="NotifyMe(\''+id+'\',\'add\')" value="Update" style="margin-left:3px;font-size:9px;font-family:Tahoma;line-height:9px;width:40px;height:17px"><input type="button" onClick="NotifyMe('+id+',\'remove\')" value="Stop Notification" style="margin-left:3px;font-size:9px;font-family:Tahoma;line-height:9px;width:80px;height:17px"></div></div></form>'
				if (RemoveNotification == '24'){
					document.forms['notify_warning_'+id].hours.selectedIndex = 0
				}else if(RemoveNotification == '48'){
					document.forms['notify_warning_'+id].hours.selectedIndex = 1
				}else{
					document.forms['notify_warning_'+id].hours.selectedIndex = 2
				}
			}else{
				obj['notify_'+id].innerHTML = '<form name="notify_warning_'+id+'" style="display:inline"><div style="padding:5px">Get notified about this auction, enter your email address below.</div><div style="padding:5px">I would like to be notified <select name="hours" style="width:40px;height:16px;font-size:10px"><option value="24" selected="true">24</option><option value="48">48</option><option value="72">72</option></select> hours before this auction starts.</div><div style="padding:0px 5px 0px 5px">My email address is <input type="text" value="'+NotifyEmailAddress+'" style="width:160px;height:18px;font-size:10px" id="ea" name="ea"><div style="position:absolute;margin:-18px 0px 0px 280px;*margin:0px"><input type="button" onClick="NotifyMe(\''+id+'\',\'add\')" value="Signup" style="margin-left:3px;font-size:9px;font-family:Tahoma;line-height:9px;width:50px;height:17px"><input type="button" onClick="NotifyMe('+id+',\'remove\')" value="Cancel" style="margin-left:3px;font-size:9px;font-family:Tahoma;line-height:9px;width:50px;height:17px"></div></div></form>'
			}
			
		}else{
			if (document.forms['notify_warning_'+id].ea.value != ''){
				var ExtraValues = "";
				if (secondary == 'remove'){
					if (CookieMonster('n'+id,'','','read') != null){
						CookieMonster('n'+id,'-1','-1','create')
						ExtraValues = '&remove=true'
						alert('Notification has been removed')
					}else{
						obj['notify_'+id].innerHTML = ""
						obj['notify_'+id].style.display = 'none';
						return false;
					}
				}else if(secondary == 'add'){
					ExtraValues = obj['date_'+id].innerHTML
					CookieMonster('email',document.forms['notify_warning_'+id].ea.value,'365','create')
					var selectedItem = document.forms['notify_warning_'+id].hours.selectedIndex;
					var selectedValue =document.forms['notify_warning_'+id].hours.options[selectedItem].text;
					if (CookieMonster('n'+id,'','','read') != null){
						alert('Notification time has been adjusted.')
					}else{
						alert('Notification has been set.')
					}
					CookieMonster('n'+id,selectedValue,ExtraValues,'create')
					ExtraValues = ''			
				}
				if (secondary != ''){
					xmlhttp.close
					xmlhttp.open("POST","data/post_warning.asp",false);
					xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
					xmlhttp.send('ea='+escape(document.forms['notify_warning_'+id].ea.value)+'&hours='+document.forms['notify_warning_'+id].hours.value+'&auction='+id+ExtraValues)
					xmlhttp.close
				}
			}
			obj['notify_'+id].innerHTML = ""
			obj['notify_'+id].style.display = 'none';
		}
	}
	
	function UpdateMailFinish(){
		var object = document.getElementById('comment_form').style;
		document.submit_contact_info.name.value = '';
		document.submit_contact_info.email.value = '';
		document.submit_contact_info.comments.value = '';
		document.submit_contact_info.comment_button.disabled = true;
		document.submit_contact_info.name.disabled = false;
		document.submit_contact_info.email.disabled = false;
		document.submit_contact_info.comments.disabled = false;
		obj['submitting_comment_form'].style.display = 'none';
		opacity = 100
		object.opacity = (opacity / 100); 
		object.MozOpacity = (opacity / 100); 
		object.KhtmlOpacity = (opacity / 100); 
		object.filter = "alpha(opacity=" + opacity + ")";
	}
	
	function UpdateMailMessage(message){
		obj['submitting_comment_form'].innerHTML = message;
	}
	
	function Auctions_Show(){
		obj['auctions_dropdown_high'].style.display = 'block';
		obj['auctions_dropdown_low'].style.display = 'block';
	}
	
	function Auctions_Hide(){
		obj['auctions_dropdown_high'].style.display = 'none';
		obj['auctions_dropdown_low'].style.display = 'none';
	}
	
	function MapFunction(what_event){
		imgobj = document.getElementsByTagName("img");
		image_string = imgobj['MapIt'].src;
		image_string = image_string.split("/");
		//alert(what_event)
		var current_image = image_string[image_string.length-1]
		current_image = current_image.split(".");
		current_image = current_image[0]
		if (what_event > 1){
			if (current_image == 4){
				current_image = 3
			}else if(current_image == 3){
				current_image = 2
			}else if (current_image == 2){
				current_image = 1
			}else{
				current_image = 0
			}
		}else{
			if (current_image == 4){
				current_image = 0
			}else if(current_image == 3){
				current_image = 4
			}else if (current_image == 2){
				current_image = 3
			}else if (current_image == 1){
				current_image = 2
			}else{
				current_image = 0
			}
		}
		if (current_image != 0){
			imgobj['MapIt'].src = 'images/maps/'+current_image+'.jpg';
		}
	}
	
	function Markets_Show(){
		obj['markets_dropdown_high'].style.display = 'block';
		obj['markets_dropdown_low'].style.display = 'block';
	}
	
	function Markets_Hide(){
		obj['markets_dropdown_high'].style.display = 'none';
		obj['markets_dropdown_low'].style.display = 'none';
	}
	
	function CookieMonster(name,value,days,type){
		if (type == "create"){
			if (days) {
				var date = new Date();
				date.setTime(date.getTime()+(days*24*60*60*1000));
				var expires = "; expires="+date.toGMTString();
			}
			else var expires = "";
			document.cookie = name+'='+value+expires+'; path=/; domain=.'+document.domain;
		}else if (type == "read"){
			var nameEQ = name + "=";
			var ca = document.cookie.split(';');
			for(var i=0;i < ca.length;i++) {
				var c = ca[i];
				while (c.charAt(0)==' ') c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
			}
			return null;
		}else if (type == "delete"){
			CookieMonster(name,"",-1,"create");
		}

	}
	
	function getQueryVariable(variable){
		var query = window.location.search.substring(1);
		var vars = query.split("&");
		for (var i=0;i<vars.length;i++) {
			var pair = vars[i].split("=");
			if (pair[0] == variable) {
				return pair[1];
			}
		}
	}

	
	function Logout(){
		CookieMonster("memid","","","delete")
		obj['nav_login'].innerHTML = '<a href="javascript:void(0)" onclick="ShowLogin()" class="navigationlinks">Login</a>'
		//window.location.href='http://'+document.domain+'/?'
		alert("You have been logged out")
		window.location.reload()
	}
	
	function PrintPage(pagestring){
		//alert(obj['CurrentContent'].innerHTML)
		if(getQueryVariable('id') != '6'){
			window.open(pagestring,'printwindow','width=495,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=no')
		}else{
			alert('Please print this page from its current location.')
		}
	}
	
	function ShowLogin(){
		if (obj['nav_login_lower'].style.display == 'block'){
			obj['nav_login_lower'].style.display = 'none';
		}else{
			obj['nav_login_lower'].style.display = 'block';
			document.login.uname.focus();
		}
	}
	
	function ShowHideDiv(divid,pointer){
		if (obj[divid].style.display == 'block'){
			obj[divid].style.display = 'none';
		}else{
			obj[divid].style.display = 'block';
		}
		if (pointer != ''){
			imgobj = document.getElementsByTagName("img");
			image_string = imgobj[pointer].src
			if (image_string.indexOf('arrow_down.gif') > -1){
				imgobj[pointer].src = 'images/reuse/arrow_up.gif';
			}else{
				imgobj[pointer].src = 'images/reuse/arrow_down.gif';
			}
		}
	}
	
	function StartUp(){		
		if (getQueryVariable("print") == 'True'){
			var tempprintpage
			tempprintpage = '<div style="margin:0px;padding:2px;border:1px solid #666666;text-align:right;width:467"><input type="button" value="Print Page" onClick="javascript:window.print()"><input type="button" value="Close Window" onClick="javascript:window.close()" style="margin-left:5px"></div>'
			document.body.innerHTML = tempprintpage + obj['CurrentContent'].innerHTML
			document.body.style.background = ''
			document.body.style.backgroundColor = '#ffffff'
			document.body.style.margin = '5'
		}else{
			var PageHeight = getPageSize()+''
			PageHeight = PageHeight.split(",")
			if(obj['maincontentdiv'].clientHeight < PageHeight[3]){
				if (window.ActiveXObject){
					obj['maincontentdiv'].style.height = PageHeight[1]-4+'px'
				}else{
					obj['maincontentdiv'].style.height = PageHeight[1]-10+'px'
				}
			}
		}
	}
	
	function XMLData(dataid){
		var error_message = "";
		xmlhttp.open("POST","data/postit.asp",false);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
		if (dataid == 'login'){
			if (document.login.uname.value != "" && document.login.pname.value != ""){
				string_sent = 'u='+document.login.uname.value+'&p='+document.login.pname.value+'&proc=login'
			}else{
				error_message = "You must provide a Username And Password"
			}
		}else if(dataid == 'checkdates'){
			if (document.anad.auc_type.options.value != "" && document.anad.auc_date_month.value != "" && document.anad.auc_date_day.value != "" && document.anad.auc_date_year.value != "" && document.anad.auc_date_hour.value != "" && document.anad.auc_date_minutes.value != "" && document.anad.auc_date_tod.value != ""){
				string_sent = 'm='+document.anad.auc_date_month.value+'&d='+document.anad.auc_date_day.value+'&y='+document.anad.auc_date_year.value+'&h='+document.anad.auc_date_hour.value+'&mm='+document.anad.auc_date_minutes.value+'&tod='+document.anad.auc_date_tod.value+'&proc=checkdates'
			}else{
				error_message = "New item could not be added. Please check the form for errors"
			}
		}else if(dataid == 'newsletter_email_add'){
			if (document.newsletter_email_add.newsletter_email.value != ""){
				var WhichButton = document.getElementById("newsletter_email_button").value
				if (WhichButton.indexOf('Remove') > -1){
					string_sent = 'ea='+document.newsletter_email_add.newsletter_email.value+'&remove=True&proc=newsletter_email_add'
				}else{
					string_sent = 'ea='+document.newsletter_email_add.newsletter_email.value+'&remove=False&proc=newsletter_email_add'
				}
				document.newsletter_email_add.newsletter_email.value = ""
			}else{
				return;
			}
		}
		if (string_sent != ""){
			//alert(string_sent)
			xmlhttp.send(string_sent)
			if (dataid == 'login'){
				if (xmlhttp.readyState==4){
					//alert(xmlhttp.responseText)
					if (xmlhttp.responseText != "False"){
						document.login.uname.value = ""
						document.login.pname.value = ""
						ShowLogin()						
						obj['nav_login'].innerHTML = '<a href="javascript:void(0)" onclick="Logout()" class="navigationlinks">Logout</a>'
						if (document.login.remember_login.checked == true){
							CookieMonster("memid",xmlhttp.responseText,365,"create")
						}else{
							CookieMonster("memid",xmlhttp.responseText,"","create")
						}
						window.location.reload()
						alert("You have successfully logged in.")
					}else{
						document.login.uname.value = ""
						document.login.pname.value = ""
						alert("An invalid username and/or password was used.")
						return false;
					}				
				}else{
					alert("An error occured, Please try again later")
					document.login.uname.value = ""
					document.login.pname.value = ""
					ShowLogin()
					return false;
				}
			}else{
				if (xmlhttp.readyState==4){
					if(dataid == 'checkdates'){
						if (xmlhttp.responseText != "False"){
							return true;
						}else{
							alert("You provided an invalid date. Please choose a valid date.")
							return false;
						}
					}else if (dataid == 'deleteauction'){
						if (xmlhttp.responseText != "False"){
							window.location.reload()
							alert("Auction Deleted")
						}else{
							alert("Could Not Find The Auction to Delete")
						}
					}else if (dataid == 'deletenewsitem'){
						if (xmlhttp.responseText != "False"){
							window.location.reload()
							alert("News Item Deleted")
						}else{
							alert("Could Not Find The News Item to Delete")
						}
					}else if (dataid == 'deletenewsletteremail'){
						if (xmlhttp.responseText != "False"){
							alert("Email address was removed.")
						}else{
							alert("Couldnt find the email address to remove.")
						}
					}else if(dataid == 'newsletter_email_add'){
						var WhichButton = document.getElementById("newsletter_email_button").value
						if (WhichButton.indexOf('Remove') > -1 && xmlhttp.responseText != "False"){
							ShowHideDiv('morenewsletterclick','')
							ShowHideDiv('morenewsletterclickremove','')
							ButtonText('newsletter_email_button','SignUp')
							alert("Email address was removed.")
						}else if(WhichButton.indexOf('Remove') > -1 && xmlhttp.responseText == "False"){
							alert("Email address does not exists in our database.")
						}else if (xmlhttp.responseText != "False"){
							var testingpattern = xmlhttp.responseText
							if (testingpattern.indexOf("Exists") != -1){
								alert("Your email address already exists in our database")
							}else{
								alert("Your email address has been added to our mailing list.")
							}
						}else{
							alert("Please enter a valid email address.")
						}
					}else{
						alert("An error occured, Please try again later")
						return false;
					}
				}else{
					alert("An error occured, Please try again later")
					return false;
				}
			}
		}else{
			alert(error_message)
			return false;
		}
	}
	
	var ourInterval;
	var scrollSpeed = 50;
	var scrollHeight = 5;

	function scrollStart(direction, divID){
		ourInterval = setInterval("scroll"+direction+"('"+divID+"')", scrollSpeed);
	}
	function scrollEnd(which){
		clearInterval(ourInterval);
	}
	function scrollUp(which){
		document.getElementById(which).scrollTop = document.getElementById(which).scrollTop - scrollHeight;
	}
	function scrollDown(which){
		document.getElementById(which).scrollTop = document.getElementById(which).scrollTop + scrollHeight;
	}
	
	function Trim(STRING){
		STRING = LTrim(STRING);
		return RTrim(STRING);
	}
	
	function imgreplace(imgname){
		imgobj = document.getElementsByTagName("img");
		imgobj[imgname].src = 'images/spacer.gif';
	}

	function RTrim(STRING){
		while(STRING.charAt((STRING.length -1))==" "){
			STRING = STRING.substring(0,STRING.length-1);
		}
		return STRING;
	}

	function LTrim(STRING){
		while(STRING.charAt(0)==" "){
			STRING = STRING.replace(STRING.charAt(0),"");
		}
		return STRING;
	}
	
	var Drag = {
		obj : null,

		init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
		{
			o.onmousedown	= Drag.start;

			o.hmode			= bSwapHorzRef ? false : true ;
			o.vmode			= bSwapVertRef ? false : true ;

			o.root = oRoot && oRoot != null ? oRoot : o ;

			if (o.hmode  && isNaN(parseInt(o.root.style.left  ))) o.root.style.left   = "0px";
			if (o.vmode  && isNaN(parseInt(o.root.style.top   ))) o.root.style.top    = "0px";
			if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right  = "0px";
			if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";

			o.minX	= typeof minX != 'undefined' ? minX : null;
			o.minY	= typeof minY != 'undefined' ? minY : null;
			o.maxX	= typeof maxX != 'undefined' ? maxX : null;
			o.maxY	= typeof maxY != 'undefined' ? maxY : null;

			o.xMapper = fXMapper ? fXMapper : null;
			o.yMapper = fYMapper ? fYMapper : null;

			o.root.onDragStart	= new Function();
			o.root.onDragEnd	= new Function();
			o.root.onDrag		= new Function();
		},

		start : function(e)
		{
			var o = Drag.obj = this;
			e = Drag.fixE(e);
			var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
			var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
			o.root.onDragStart(x, y);

			o.lastMouseX	= e.clientX;
			o.lastMouseY	= e.clientY;

			if (o.hmode) {
				if (o.minX != null)	o.minMouseX	= e.clientX - x + o.minX;
				if (o.maxX != null)	o.maxMouseX	= o.minMouseX + o.maxX - o.minX;
			} else {
				if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
				if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
			}

			if (o.vmode) {
				if (o.minY != null)	o.minMouseY	= e.clientY - y + o.minY;
				if (o.maxY != null)	o.maxMouseY	= o.minMouseY + o.maxY - o.minY;
			} else {
				if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
				if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
			}

			document.onmousemove	= Drag.drag;
			document.onmouseup		= Drag.end;

			return false;
		},

		drag : function(e)
		{
			e = Drag.fixE(e);
			var o = Drag.obj;

			var ey	= e.clientY;
			var ex	= e.clientX;
			var y = parseInt(o.vmode ? o.root.style.top  : o.root.style.bottom);
			var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
			var nx, ny;

			if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
			if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
			if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
			if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);

			nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
			ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));

			if (o.xMapper)		nx = o.xMapper(y)
			else if (o.yMapper)	ny = o.yMapper(x)

			Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
			Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
			Drag.obj.lastMouseX	= ex;
			Drag.obj.lastMouseY	= ey;

			Drag.obj.root.onDrag(nx, ny);
			return false;
		},

		end : function()
		{
			document.onmousemove = null;
			document.onmouseup   = null;
			Drag.obj.root.onDragEnd(	parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), 
										parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
			Drag.obj = null;
		},

		fixE : function(e)
		{
			if (typeof e == 'undefined') e = window.event;
			if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
			if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
			return e;
		}
	};