function insertmovie($filename,$aspect,$options,$imageframe) { scroll(0,0); //scroll back to top of page // www.geekpedia.com/code100_Get-window-width-and-height.html var $x=0; var $y=0; if (self.innerHeight) // all except Explorer { $x=self.innerWidth; $y=self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) //Explorer 6 strict mode { $x=document.documentElement.clientWidth; $y=document.documentElement.clientHeight; } else if (document.body) // other Explorers { $x=document.body.clientWidth; $y=document.body.clientHeight; } // Set font relative to window size var P = Math.sqrt ($x*$x+$y*$y); P = Math.floor (8+P/125); document.body.style.fontSize = P + 'px'; // alert(" "+P); $width= 0.98*$x; if (!$imageframe) {$imageframe="imageframe";} $otherlines=$options.split(" ")[0]+''; //get up to first blank, usually "4.2 controller autoplay" if ($options.indexOf(",") != -1) //if contains comma then use "lines of text, fraction of vertical height, fraction of horizontal width". Fraction can be larger than 1. { $y2 = $otherlines.split(",")[1]*($y - $otherlines.split(",")[0] * P - P); if($otherlines.split(",")[2]) {$width = $otherlines.split(",")[2]*$width;} } else if ($otherlines < 1) //use fraction of vertical height { $y2 = $otherlines * $y; } else //use lines of text { $y2 = $y - $otherlines * P - P; } if ($width*$aspect > $y2) {$width=$y2/$aspect;} $myFramerate=1; if ($options.indexOf("framerate=") != -1) { $myFramerate=$options.split("framerate=")[1]; //portion that follows framerate= $myFramerate=1/$myFramerate.split(" ")[0]; //up to next blank } var $code = ''; document.getElementById($imageframe).innerHTML = $code; // alert($code); }