function MyPrettyTable(){
    this.makeTableTop = makeTableTop;
    this.makeTableBottom = makeTableBottom;
    this.makeRow = makeRow;
    this.count = 0;
	this.tablestyle1 = "'tablecontent1'";
	this.tablestyle2 = "'tablecontent2'";
}

function makeRow(data,style,stuff,cell_number){
    if(!style){
        this.count%2 == 0 ? style = this.tablestyle1 : style = this.tablestyle2;
        this.count++;
    }
    
    if(!stuff){
        stuff =""
    }
    else if(stuff.indexOf('colspan') >= 0 && !cell_number){
		var row = new Array();  
         row[0] = "<tr>";
         row[1]="<td class="+style+" "+stuff+">"+data[0]+"</td>";
         row[2]='</tr>';
      // alert(row.join(""))
        document.open('text/html',"replace");
        document.write(row.join(""));
        document.close();
        return;
    }
	else if(cell_number){
		var row = new Array();
		var index = 0; 
    	row[index++] = "<tr>";
    	for(i=0;i<data.length;i++){
			if(i!= cell_number){
        		row[index++]="<td class="+style+">"+data[i]+"</td>";
			}
			else{
				row[index++]="<td class="+style+" "+stuff+">"+data[i]+"</td>";
			}
    	}
    	row[index++]='</tr>';
		//alert(row.join(""))
		document.open('text/html',"replace");
        document.write(row.join(""));
        document.close();
        return;
	}
   	var row = new Array();
	var index = 0; 
    row[index++] = "<tr>";
    for(i=0;i<data.length;i++){
        row[index++]="<td class="+style+" "+stuff+">"+data[i]+"</td>";
    }
    row[index++]='</tr>';
    document.open('text/html',"replace");
    document.write(row.join(""));
    document.close();
        
}
function makeTableTop(header,attributes){
if(!attributes){  
    attributes = 'border="0" cellspacing="0" cellpadding="0"  width="100%" bgcolor="#314745"';
}

var table_top=new Array()
table_top[0]='<table '+attributes+'>';
table_top[1]='<tr>';
table_top[2]='<td width="100%">';
table_top[3]='<table width="100%" border="0" cellspacing="1" cellpadding="1">';

document.open('text/html',"replace");
document.write(table_top.join(""));
document.close();

}

function makeTableBottom(header){
var table_bottom=new Array()
table_bottom[0]='</table></td></tr></table>';
document.open('text/html',"replace");
document.write(table_bottom.join(""));
document.close();

}

  