function Frameset(c,a,d,b){this.frames=c;this.name=a;this.id=d;this.moreParams=b;this.lockRows=false;this.lockCols=false}Frameset.prototype.write=function(){document.write(this.toHTML())};Frameset.prototype.toggleFrame=function(a){var b=this.findFrame(a);if(b){(b.visible==true)?b.setInvisible():b.setVisible();this.refreshFrameset()}};Frameset.prototype.showFrame=function(a){var b=this.findFrame(a);if(b){if(b.visible==false){b.setVisible();this.refreshFrameset()}}};Frameset.prototype.hideFrame=function(a){var b=this.findFrame(a);if(b){if(b.visible==true){b.setInvisible();this.refreshFrameset()}}};Frameset.prototype.setFrameDimensions=function(a,c,b){var d=this.findFrame(a);if(d){d.setHeight(b);d.setWidth(c);this.refreshFrameset()}};Frameset.prototype.findFrame=function(b){for(var a=0;a<this.frames.length;a++){if(this.frames[a]){if(this.frames[a].frames){var c=this.frames[a].findFrame(b);if(c){return c}}if(this.frames[a].name==b){return this.frames[a]}}}return""};Frameset.prototype.refreshFrameset=function(){document.getElementById(this.id).setAttribute("cols",this.buildCols());document.getElementById(this.id).setAttribute("rows",this.buildRows());this.onChange()};Frameset.prototype.onChange=function(){};Frameset.prototype.getHeight=function(){return"*"};Frameset.prototype.buildRows=function(){if(this.lockRows){return"*"}var b="";for(var a=0;a<this.frames.length;a++){if(this.frames[a]){b+=(a==0)?this.frames[a].getHeight():","+this.frames[a].getHeight()}}return b};Frameset.prototype.buildCols=function(){if(this.lockCols){return"*"}var b="";for(var a=0;a<this.frames.length;a++){if(this.frames[a]){b+=(a==0)?this.frames[a].getWidth():","+this.frames[a].getWidth()}}return b};Frameset.prototype.getWidth=function(){return"*"};Frameset.prototype.toHTML=function(){var c=(this.lockRows)?"*":"";var d=(this.lockCols)?"*":"";var b="";for(var a=0;a<this.frames.length;a++){if(this.frames[a]){if(!this.lockRows){c+=(a==0)?this.frames[a].getHeight():","+this.frames[a].getHeight()}if(!this.lockCols){d+=(a==0)?this.frames[a].getWidth():","+this.frames[a].getWidth()}b+=this.frames[a].toHTML()}}b='<frameset rows="'+c+'" cols="'+d+'" name="'+this.name+'" id="'+this.id+'" '+this.moreParams+" >"+b;b+="</frameset>";return b};function Frame(a,g,b,c,f,e,d){this.name=a;this.id=g;this.rows=b;this.cols=c;this.src=f;this.params=e;this.visible=d}Frame.prototype.setGreedy=function(a){this.greedy=a};Frame.prototype.onVisible=function(){this.onChange()};Frame.prototype.onInvisible=function(){this.onChange()};Frame.prototype.onResize=function(){this.onChange()};Frame.prototype.onChange=function(){};Frame.prototype.setVisible=function(){this.visible=true;this.onVisible()};Frame.prototype.setInvisible=function(){this.visible=false;this.onInvisible()};Frame.prototype.setHeight=function(a){this.rows=a};Frame.prototype.setWidth=function(a){this.cols=a};Frame.prototype.getHeight=function(){var a=(this.rows<0)?"*":this.rows;return(this.visible)?a:0};Frame.prototype.getWidth=function(){var a=((this.cols<0)||(this.greedy))?"*":this.cols;return(this.visible)?a:0};Frame.prototype.toHTML=function(){return'<frame name="'+this.name+'" src="'+this.src+'" id="'+this.id+'" '+this.params+">"};