/*/////////////////////////////////////////////////////////////
// file: auction_tools.js
// For use with the Silver Eye benefits auction
/////////////////////////////////////////////////////////////*/

function getAuctionItems(mode,value,pages){
	var queryObj = {};
	if(mode == 'lot' || !alex.Empty(pages)){
		queryObj.mn = pages.split('-')[0];
		queryObj.mx = pages.split('-')[1];
	}
	if(mode == 'letter'){
		if(value == '--') value = 'A';
		queryObj.q = value;
	}
	processPageAction(mode,queryObj);
}

function placeBid(id,inNew){
	//alert('placeBid('+id+')');
	var inNew = (!alex.Empty(inNew) || inNew == true)? true:false;
	var formpage = 'benefit_bidform.php' + alex.To.query({lot:id});
	
	if(inNew) alex.Create.window(formpage, {width:'800', height:'600',top:'auto',left:'auto',scrollbars:'yes',status:'yes',titlebar:'yes',toolbar:'yes',location:'yes'});
	if(!inNew) window.location = formpage;
}

function openFullSizeImage(id){
	var appendedLink = 'collect_benefit_item.php' + alex.To.query({lot:id});
	alex.Create.window(appendedLink,{width:600,height:760,top:'auto',left:'auto',scrollbars:'yes'});
}

function processPageAction(action,queryObj){
	queryObj.mode = action;
	window.location = 'collect_benefit.php' + alex.To.query(queryObj);
}


