// this is the custom hashtable class
Hashtable.prototype.hash 	 = null;
Hashtable.prototype.keys 	 = null;
Hashtable.prototype.location = null;

function Hashtable(){
    this.hash = new Array();
    this.keys = new Array();
    this.location = 0;
}

Hashtable.prototype.get = function (key)
{
    return this.hash[key];
}

Hashtable.prototype.put = function (key, value)
{
    if (value == null)
        return null;

	if (this.hash[key] == null)
		this.keys[this.keys.length] = key;

	this.hash[key] = value;
}
// end custom hashtable class

function createRow(table)
{
    var row = document.createElement('TR');
    table.appendChild(row);
    
    return row;
}

function createCell(row)
{
    var cell = document.createElement('TD');
    row.appendChild(cell);
    
    return cell;
}

function CreateGraphWindow()
{
	var div, table, row, cell;

	div = document.createElement('DIV');
	
	table = document.createElement('TABLE');
	table.style.fontFamily = 'Verdana';
	table.style.fontSize = 'small';
	table.style.backgroundColor = '#BCCBE0';
	
	row = createRow(table);
	row.align = 'center';
	
	cell = createCell(row);
	
	cell.innerHTML = 'GOLD1KG';
	cell.style.width = '250px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#1579B4';
	cell.colspan = '4';
	
	row = createRow(table);	
	cell = createCell(row);
	cell.innerHTML = 'Last Trade Price';
	//cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#AC976C';
	cell.align = 'Right';
	cell = createCell(row);
	cell.innerHTML = '';
	cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#FFF';
	
	row = createRow(table);
	cell = createCell(row);
	cell.innerHTML = 'Last Trade Time';
	//cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#AC976C';
	cell.align = 'Right';
	cell = createCell(row);
	cell.innerHTML = '';
	cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#FFF';
	
	row = createRow(table);
	cell = createCell(row);
	cell.innerHTML = 'Bid Volume';
	//cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#AC976C';
	cell.align = 'Right';
	cell = createCell(row);
	cell.innerHTML = '';
	cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#FFF';
	
	row = createRow(table);
	cell = createCell(row);
	cell.innerHTML = 'Bid';
	//cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#AC976C';
	cell.align = 'Right';
	cell = createCell(row);
	cell.innerHTML = '';
	cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#FFF';
	
	row = createRow(table);
	cell = createCell(row);
	cell.innerHTML = 'Ask';
	//cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#AC976C';
	cell.align = 'Right';
	cell = createCell(row);
	cell.innerHTML = '';
	cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#FFF';
	
	row = createRow(table);
	cell = createCell(row);
	cell.innerHTML = 'Ask Volume';
	//cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#AC976C';
	cell.align = 'Right';
	cell = createCell(row);
	cell.innerHTML = '';
	cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#FFF';
	
	row = createRow(table);
	cell = createCell(row);
	cell.innerHTML = 'High';
	//cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#AC976C';
	cell.align = 'Right';
	cell = createCell(row);
	cell.innerHTML = '';
	cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#FFF';
	
	row = createRow(table);
	cell = createCell(row);
	cell.innerHTML = 'Low';
	//cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#AC976C';
	cell.align = 'Right';
	cell = createCell(row);
	cell.innerHTML = '';
	cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#FFF';
	
	row = createRow(table);
	cell = createCell(row);
	cell.innerHTML = 'Open Intrest';
	//cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#AC976C';
	cell.align = 'Right';
	cell = createCell(row);
	cell.innerHTML = '';
	cell.style.width = '80px';
	cell.style.color = '#FFF'
	cell.style.backgroundColor = '#FFF';
	
	table1 = document.createElement('TABLE');
	row = createRow(table1);
	row.align = 'center';
	
	cell = createCell(row);
	cell.style.width = '250px';
	cell.valign = 'top';
	cell.appendChild(table)
	
	cell = createCell(row);
	cell.innerHTML = '<img src="imgs/cbg.jpg" alt="imgs/cbg.jpg"/>';
	
	div.appendChild(table1); 
	
	document.getElementById('wndGraphContent').innerHTML = div.innerHTML;
	document.getElementById('wndGraph').style.visibility = 'visible';
}
