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

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;   
    }
  
    this.wholetable[this.wholetable_index++] = "<tr>";  
    for(i=0;i<data.length;i++){
       if(data[i] == ""){
            data[i] = "<br>";
       }
        if(i == td_edit){
           this.wholetable[this.wholetable_index++]="<td class='"+style+"' "+edit+">"+data[i]+"</td>";
        }
        else{
           this.wholetable[this.wholetable_index++]="<td class='"+style+"' "+this.stuff+">"+data[i]+"</td>";
		   // alert("<td class="+style+" "+this.stuff+">"+data[i]+"</td>")
        }
    }
    this.wholetable[this.wholetable_index++]= "</tr>";
    //reset this.stuff
    this.stuff = "";      
    return;  
}

function makeTableTop(attributes){
var attr = (attributes) ? attributes : 'width="100%" border="0" cellspacing="0" cellpadding="3" class="ratetable"';
this.wholetable[this.wholetable_index++]='<table '+attr+'>';
return;
}

function makeTableBottom(header){
    this.wholetable[this.wholetable_index++]='</table>';
    document.open('text/html',"replace");
    document.write(this.wholetable.join(""));
    document.close();
    return;
}


