/**(C)2007 Scripterlative.com ** These instructions may be removed but not the above text. Frame Resizer Generates a styleable hyperlink that provides a convenient means of toggling the dimensions of all the frames within the immediate frameset, between the default setting and a specifed alternative. Typically such a facility may be used to reveal and hide a normally-concealed frame. Installation ~~~~~~~~~~~~ Save this file or text as rframe.js and copy it to a suitable folder relating to your web pages. Within the section of the document that will display the toggling link, insert the following: [These tags must be positioned anywhere prior to the other script statements described below] Configuration ~~~~~~~~~~~~~ Decide upon the alternate proportions to which the frameset is to be toggled. The syntax for specifying row and column sizes, is the same as used in the HTML tag. There are four functions used to configure the script, with examples of usage given below. ------ FrameResizer.rows( rows ); Specifies the alternate row proportions. The frameset must have a rows specifier by default. ------ FrameResizer.cols( cols ); Specifies the alternate column proportions. The frameset must have a cols specifier by default. ------ FrameResizer.captions( default text, alternate text ); Specifies the text to be displayed by the toggling link in both states. To display the same text in both states, specify only one parameter. If this function is not called, a default will be displayed. ----- Example 1. A 2-frame frameset is configured with rows, and is to be toggled between its default proportions and cols="50%,*". The toggling link will display the same custom text in both states. At the exact location at which the link will appear, insert these lines: Example 2. A 4-frame frameset is configured with both rows and cols, and is to be toggled between its default proportions, and rows="60%,*" & cols="85%,*". The toggling link will display alternate text. At the exact location at which the link will appear, insert these lines: Styling of Toggling Link ~~~~~~~~~~~~~~~~~~~~~~~~ The link has the class name 'FrameResizer', and can be styled by creating a suitable CSS stylesheet of that name. GratuityWare ~~~~~~~~~~~~ If you wish to express your gratitude for my efforts, please visit: scripterlative.com *** DO NOT EDIT BELOW THIS LINE ******/ var FrameResizer= { defaultRows : (parent!=self && parent.document.body && parent.document.body.rows) ? parent.document.body.rows: "", defaultCols : (parent!=self && parent.document.body && parent.document.body.cols) ? parent.document.body.cols: "", altRows:"", altCols:"", defCaption:"", altCaption:"", rows:function( r ) { if(this.defaultRows!="") this.altRows=r; else if(document.body) this.noDefWarn("rows",r); }, cols:function( c ) { if(this.defaultCols!="") this.altCols=c; else if(document.body) this.noDefWarn("cols",c); }, noDefWarn:function(prop,param) { alert("Attempted to set alternate value for "+prop+": "+param+" for a frameset with no default value.\n\n"+ "Remove the call to FrameResizer."+prop+"() or add the required parameter to the relevant tag."); }, captions:function(c1, c2) { this.defCaption=c1; if(c2!=undefined) this.altCaption=c2; }, go:function() { if( this.defaultRows!="" || this.defaultCols!="" ) document.write(''+(this.defCaption=="" ? "Toggle Frame Sizes":this.defCaption)+''); }, set:function( linkRef ) { if(this.altRows!="") parent.document.body.rows=(parent.document.body.rows==this.defaultRows) ? this.altRows : this.defaultRows; if(this.altCols!="") parent.document.body.cols=(parent.document.body.cols==this.defaultCols) ? this.altCols : this.defaultCols; if( this.altCaption!="" && linkRef.firstChild ) linkRef.firstChild.data=( this.defaultRows==parent.document.body.rows && this.defaultCols==parent.document.body.cols) ? this.defCaption : this.altCaption; return false; } }