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";
        this.count++;
    }
    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>";
        }
    }
    row[++row_index]= "</tr>";
    document.open('text/html',"replace");
    document.writeln(row.join(""));
    document.close();
    //reset this.stuff
    this.stuff = "";        
}

function makeTableTop(attributes){
if(!attributes){
    if(document.layers){
        attributes = 'width="100%" cellspacing="0" cellpadding="0" align="center"';
    }
    else{
        attributes = 'width="100%" cellspacing="1" cellpadding="5"';
    }
}
var table_top=new Array();
table_top[0]='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
table_top[1]='<tr>    ';
table_top[2]='<td bgcolor="#333366" align="center">';
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>';
document.open('text/html',"replace");
document.writeln(table_bottom.join(""));
document.close();
}

