All pastes #765289 Raw Edit

Untitled

public javascript v1 · immutable
·published 2007-11-07 22:32 UTC
rendered paste body
function random_ADA(){  var myimages=new Array()  myimages[1]="img/ada01_1.jpg"  myimages[2]="img/ada01_2.jpg"  var ry=Math.floor(Math.random()*myimages.length)  if (ry==0)     ry=1     document.write('<img src="'+myimages[ry]+'">')}function random_MAN(){  var myimages=new Array()  myimages[1]="img/man01_1.jpg"  myimages[2]="img/man01_2.jpg"  var ry=Math.floor(Math.random()*myimages.length)  if (ry==0)     ry=1     document.write('<img src="'+myimages[ry]+'">')}function random_WHY(){  var myimages=new Array()  myimages[1]="img/why01_1.jpg"  myimages[2]="img/why01_2.jpg"  var ry=Math.floor(Math.random()*myimages.length)  if (ry==0)     ry=1     document.write('<img src="'+myimages[ry]+'">')}function MM_openBrWindow(theURL,winName,features) { //v2.0  window.open(theURL,winName,features);}// scrolling down to anchor links and// highlighting anchor linksEvent.observe(window, 'load', function() {		myhighlighter = new AnchorHighlighter('a.anchorlink', 'div.anchor', '#ffffff', '#93c630', '#000000', '#ffffff');	});AnchorHighlighter = Class.create();AnchorHighlighter.prototype = {	lastAnchor: null,					initialize: function(linkclass, anchorclass, startcolor, endcolor, startfont, endfont) {		this.anchors = $$(anchorclass);		this.startcolor = startcolor;		this.endcolor = endcolor;		this.startfont = startfont;		this.endfont = endfont;				$$(linkclass).each(function(e) {			Event.observe(e, 'click', this.highlight.bindAsEventListener(this));		}.bind(this));					},		highlight: function(event) {		var element = $(Event.element(event));                var name = element.href.substr(element.href.indexOf('#')+1);		this.anchors.each(function(e) {			if(e.id == name)			{				if(this.lastAnchor != null && this.lastAnchor.id != e.id)				{					this.lastAnchor.setStyle({color: this.startfont});												var oldchange = new Effect.Highlight(this.lastAnchor, {startcolor: this.endcolor, endcolor: this.startcolor, restorecolor: this.startcolor});				}								e.setStyle({color: this.endfont});                                var scroller = new Effect.ScrollTo(e.id, {duration: .2});				var newchange = new Effect.Highlight(e, {startcolor: this.startcolor, endcolor: this.endcolor, restorecolor: this.endcolor});													this.lastAnchor = e;				delete newchange;				delete oldchange;                                delete scroller;				throw $break;			}		}.bind(this));                Event.stop(event);	}			};