/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2007, 2008, Oracle. All rights reserved.
// Function : ATSGreyAuctionResults
// Comments : 
/////////////////////////////////////////////////////////////////////////////

function ATSGreyAuctionResults (rdate, date, resday, result_type,
	bookmark_titles, bookmark_resdays, bookmark_prefixes,
	result_types, result_titles, result_bookmarks_enable, result_graph, result_tables, result_tables_titles)
{
	this.rdate = ((date != "null")? date: rdate).replace(/\./g, "");
	this.resday = resday;
	this.zspcode = '';

	this.bookmarks_titles = bookmark_titles.split(',');
	this.bookmarks = bookmark_resdays.split(',');
	this.bookmarks_prefixes = bookmark_prefixes.split(',');
	this.result_types = result_types.split(',');
	this.result_titles = result_titles.split(',');
	this.result_bookmarks_enable = result_bookmarks_enable.split(',');
	this.result_graph = result_graph.split(',');
	this.result_tables = result_tables.split(',');
	this.result_tables_titles = result_tables_titles.split(',');

	this.id = 0;
	for (var i = 0; i < this.result_types.length; i++) {
		if (result_type == this.result_types[i]) this.id = i;
	}

	this.enable_prefix = this.result_bookmarks_enable[this.id];

	ATSGreyAuctionResults.prototype.getBookmarkTitle = ATSGreyAuctionResults_GetBookmarkTitle;
	ATSGreyAuctionResults.prototype.getDate = ATSGreyAuctionResults_GetDate;
	ATSGreyAuctionResults.prototype.setDate = ATSGreyAuctionResults_SetDate;
	ATSGreyAuctionResults.prototype.getFormatDate = ATSGreyAuctionResults_GetFormatDate;
	ATSGreyAuctionResults.prototype.getPrefix = ATSGreyAuctionResults_GetPrefix;
	ATSGreyAuctionResults.prototype.setResday = ATSGreyAuctionResults_SetResday;
	ATSGreyAuctionResults.prototype.getResday = ATSGreyAuctionResults_GetResday;
	ATSGreyAuctionResults.prototype.getZsp = ATSGreyAuctionResults_GetZsp;
	ATSGreyAuctionResults.prototype.setZsp = ATSGreyAuctionResults_SetZsp;
	ATSGreyAuctionResults.prototype.getTitle = ATSGreyAuctionResults_GetTitle;
	ATSGreyAuctionResults.prototype.getGraph = ATSGreyAuctionResults_GetGraph;
	ATSGreyAuctionResults.prototype.getTables = ATSGreyAuctionResults_GetTables;
	ATSGreyAuctionResults.prototype.getTableTitles = ATSGreyAuctionResults_GetTableTitles;
}

function ATSGreyAuctionResults_GetBookmarkTitle(bid) {
	return this.bookmarks_titles[bid];
}

function ATSGreyAuctionResults_GetDate() {
	return this.rdate;
}

function ATSGreyAuctionResults_SetDate(rdate) {
	this.rdate = rdate;
}

function ATSGreyAuctionResults_GetFormatDate() {
	return this.rdate.substring(0,2)+'.'+this.rdate.substring(2,4)+'.'+this.rdate.substring(4);
}

function ATSGreyAuctionResults_GetPrefix() {
	if (this.enable_prefix == 'true') {
		r = 0;
		for (var i = 0; i < this.bookmarks.length; i++) {
			if (this.bookmarks[i] == this.resday) r = i;
		}
		return this.bookmarks_prefixes[r]+" ";
	} else {
		return "";
	}
}

function ATSGreyAuctionResults_GetResday() {
	return this.resday;
}

function ATSGreyAuctionResults_SetResday(rid) {
	this.resday = this.bookmarks[rid];
}

function ATSGreyAuctionResults_GetZsp() {
	return this.zsp;
}

function ATSGreyAuctionResults_SetZsp(zsp) {
	this.zsp = zsp;
}

function ATSGreyAuctionResults_GetTitle() {
	return this.result_titles[this.id];
}

function ATSGreyAuctionResults_GetGraph() {
	return this.result_graph[this.id];
}

function ATSGreyAuctionResults_GetTables() {
	return this.result_tables[this.id].split(':');
}

function ATSGreyAuctionResults_GetTableTitles() {
	return this.result_tables_titles[this.id].split(':');
}
