function MyPrettyTable(){
    this.makeTableTop = makeTableTop;
    this.makeTableBottom = makeTableBottom;
    this.makeRow = makeRow;
    this.count = 0;
    this.stuff = "";
}

function makeRow(data,style,stuff,td_edit,edit){
    if(!style){
        this.count%2 == 0 ? style = "tablecontent1" : style = "tablecontent2";
        
    }
    if(stuff){ 
        this.stuff = stuff;   
    }
    var row_index = 0
    var row = new Array();
    row[row_index] = "<tr>";  
    for(i=0;i<data.length;i++){
        if(i == td_edit){
           row[++row_index]="<td "+edit+" class="+style+">"+data[i]+"</td>";
        }
        else{
           row[++row_index]="<td class="+style+" "+this.stuff+">"+data[i]+"</td>";
		   // alert("<td class="+style+" "+this.stuff+">"+data[i]+"</td>")
        }
    }
    row[++row_index]= "</tr>";
    document.open('text/html',"replace");
    document.writeln(row.join(""));
    document.close();
    //reset this.stuff
	this.count++;
    this.stuff = "";        
}

function makeTableTop(attributes){
if(!attributes){
        attributes = 'width="100%" cellspacing="1" cellpadding="5" align="center" border="0"';
}
var table_top=new Array();
table_top[0]='<table border="0" cellspacing="0" cellpadding="0" width="100%">';
table_top[1]='<tr>    ';
table_top[2]='<td bgcolor="#000000">';
table_top[3]='<table '+attributes+'>';

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

}

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


