
function table_write(doc)
{

	doc.write("<style>");
	doc.write(".textw {FONT: 11px \"MS Sans Serif\"; COLOR: #000000}");
	doc.write(".textgreen {FONT: 16px \"MS Sans Serif\"; COLOR: #bbcc26}");
	doc.write("</style>");
//	doc.write("<table class=textw  cellSpacing=1 cellPadding=0   bgColor="+this.bordercolor+"	border=0 width='100%' >");
	if(this.header == 1)
	{
cell = this.cellspac*4;
		doc.write("<tr>");
		doc.write("<td  width='100%' >");
		doc.write("<table   cellSpacing=1 cellPadding=0   	border=0  width='100%'>");
		doc.write("<tr>");
		doc.write("<td height=30 width='100%' valign=middle bgColor="+this.tablecolor+" align=left  class=textgreen ><B>  "+this.headercontent+" </B></td>");
		doc.write("</tr>");
		doc.write("</table>");
		doc.write("</td>");
		doc.write("</tr>");

	}
/*
	doc.write("<tr>");
	doc.write("<td align=left width='100%' >");
	doc.write("<table class=textw   cellSpacing=0 cellPadding=0   	border=0 width='100%' >");
	doc.write("<tr>");
	doc.write("<td bgColor="+this.bordercolor+" width='100%' >");
	doc.write("<table class=textw   cellSpacing=1 cellPadding=0   	border=0 width='100%' >");
*/


//	doc.write("<tr>");
//	doc.write("<td height=10 colspan="+this.columns+" bgColor="+this.tablecolor+" ></td>");
//	doc.write("</tr>");









	for(var i=0;i<this.rows;++i)
	{
		doc.write("<TR bgcolor='#444444' >");
		for(var j=0;j<this.columns;++j)
		{

				doc.write("<td width=210 height=140   align=center bgcolor=#444444 ><table width=160 height=120 border=0 cellpadding=2 cellspacing=1 bgcolor=#747474 class=textw ><tr valign=top><td height=30 align=center bgcolor=#363636 class=textblack >");
				doc.write(this.data[i*this.columns+j]);
				doc.write("</td></tr></table></td>");


		}
		doc.writeln("</tr>");
	}
//		doc.writeln("<tr>");
//		doc.writeln("<td height=10 colspan="+this.columns+" bgColor=#2d2c22 ></td>");
//		doc.writeln("</tr>");
/*
		doc.writeln("</table>");
		doc.writeln("</td>");
		doc.writeln("</tr>");
		doc.writeln("</table>");
		doc.writeln("</td>");
		doc.writeln("</tr>");
		doc.writeln("</table>");
*/

}

function table_getValue(row,col)
{
	return this.data[row*this.columns+col];
}

function table_setValue(row,col,value)
{
	this.data[row*this.columns+col] = value;
}

function table_set(contents)
{
	var n = contents.length;
	for(var j=0;j<n;++j) 
	{	
	this.data[j] = contents[j];
	}
}

function table_setheader(headertext,width)
{

	this.headercontent = headertext;
	this.width = width;
}

function table_settd(width1,width2,width3)
{
	this.width1 = width1;
	this.width2 = width2;
	this.width3 = width3;
}
var width1;
var width2;
var width3;
function table(rows,columns)
{
	this.rows = rows;
	this.columns = columns;
	this.header = 0;
	this.headercontent = "Header";
	this.cellspac = 1;
	this.width = 200;
	this.width1 = "xxxx";
	this.width2 = "xxss";
	this.width3 = "dsfd";
//	this.bordercolor= "#53523e";
	this.bordercolor= "#444444";
	this.tablecolor = "#444444";
	this.data = new Array(rows*columns);
	this.write = table_write;
	this.getValue = table_getValue;
	this.setValue = table_setValue;
	this.set = table_set;
	this.setheader = table_setheader;
	this.settd = table_settd;
}

  

    function MoveItem(ctrlSource, ctrlTarget) {
        var Source = document.getElementById(ctrlSource);
        var Target = document.getElementById(ctrlTarget);

        if ((Source != null) && (Target != null)) {

            while ( Source.options.selectedIndex >= 0 ) {
                var newOption = new Option(); // Create a new instance of ListItem
                newOption.text = Source.options[Source.options.selectedIndex].text;
                newOption.value = Source.options[Source.options.selectedIndex].value;
                
                Target.options[Target.length] = newOption; //Append the item in Target
                Source.remove(Source.options.selectedIndex);  //Remove the item from Source
            }
        }
    }


    function MoveItem2(ctrlSource, ctrlTarget) {
        var Target = document.getElementById(ctrlSource);
        var Source = document.getElementById(ctrlTarget);

        if ((Source != null) && (Target != null)) {

            while ( Source.options.selectedIndex >= 0 ) {
                var newOption = new Option(); // Create a new instance of ListItem
                newOption.text = Source.options[Source.options.selectedIndex].text;
                newOption.value = Source.options[Source.options.selectedIndex].value;
                
                Target.options[Target.length] = newOption; //Append the item in Target
                Source.remove(Source.options.selectedIndex);  //Remove the item from Source
            }
        }
    }

var x
var k
function openpop(k,x)
{
x=x+1;

//win = window.open("http://sf.gg.in.th/community/activity/SFWorld20072007/SFWorld2007_preview.asp?dayx=1&picx=1"  , "height=250,width=400,scrollbars=no,minimize=no") ;
window.open("http://sf.gg.in.th/community/activity/SFTGS2008/SFTGS2008_preview.asp?dayx="+k+"&picx="+x+"","bannerpopup","height=800,width=700,left=200,top=50,scrollbars=no,minimize=no" );
}

