<!-- Flooble.com toggler start -->
		var togglermax = 3;
		var togglerscore = 0;
		var togglermoves = 0;
		
		function press(form, button) {
			name = button.name;
			x = name.substring(0,1);
			y = name.substring(2,3);
			play(form, (x-1+1), (y-1+1));
		}
		
		function play(form, x, y) {
			togglermoves++;
			toggle(form, x, y);
			toggle(form, x-1, y);
			toggle(form, x+1, y);
			toggle(form, x, y-1);
			toggle(form, x, y+1);
			if (togglerscore == 16) {
				if (togglermoves == 4) { w = 'That\'s the best possible score!'; }
                                else { w = 'See if you can do any better!'; }
                                alert('You win after ' + togglermoves + ' moves! \n' + w);
				resetboard(form);
			}
		}

		function showrules() {
			rules = 'Toggler - from flooble.com \n\n'
				+ 'The goal of the game is to turn \n' 
				+ 'all the buttons from [X] to [.]. \n'
				+ 'This is done by clicking buttons. \n'
				+ 'When a button is clicked, its state is \n'
				+ 'toggeled, but so is the state of four \n'
				+ 'buttons around it, so plan carefully! \n';
			alert(rules);
		}
		
		function resetboard(form) {
			var i,j,button;
			for (i = 0; i < 4; i++) {
				for (j = 0; j < 4; j++) {
					button = getelement(form, i + '_' + j);	
					button.value='X';
				}
			}
			togglerscore = 0;
			togglermoves = 0;
		}

		function getelement(form, name) {
			var k;
			var elements = form.elements;
			for (k = 0; k < elements.length; k++) {
				if (elements[k].name == name) return elements[k];
			}
		}
	
		function toggle(form, x, y) {
			if (x < 0 || y < 0 || x > togglermax || y > togglermax) {
				//alert('Ignore (' + x + ',' + y + ')');
				return;
			}
			name = x + '_' + y;
			button = getelement(form, name);
			a = button.value;
			button.value = '!!!';
			//alert(a + '  (' + x + ',' + y + ')') ;
			button.value = a;
			if (button.value == 'X') {
				button.value = '.';
				togglerscore ++;
			} else {
				button.value = 'X';
				togglerscore --;
			}
		}

<!-- Flooble.com toggler end -->

<!-- Flooble.com peeptin start -->
		var peeptinmax = 3;
		var peeptinscore = 0;
		var peeptinmoves = 0;
		var ex = 3;
		var ey = 3;
		
		function getElement15(form, name) {
			var k;
			var elements = form.elements;
			for (k = 0; k < elements.length; k++) {
				if (elements[k].name == name) return elements[k];
			}
		}
		
		function press15(form, button) {
			name = button.name;
			x = name.substring(0,1);
			y = name.substring(2,3);
			play15(form, (x-1+1), (y-1+1));
		}
		
		function shuffle15(form, num) {
			for (i = 0; i < num; i++) {
				x = Math.floor(Math.random(4) * 4);
				if (x == 0) { toggle15(form, ex, ey, ex + 1, ey); }
				else if (x == 1) { toggle15(form, ex, ey, ex - 1, ey); }
				else if (x == 2) { toggle15(form, ex, ey, ex, ey + 1); }
				else if (x == 3) { toggle15(form, ex, ey, ex, ey - 1); }
			}
		}
		
		function play15(form, x, y) {			
			if (Math.abs(ex - x) + Math.abs(ey - y) == 1) {
				done = toggle15(form, x, y, x+1, y);
				if (!done) { done = toggle15(form, x, y, x-1, y); }
				if (!done) { done = toggle15(form, x, y, x, y+1); }
				if (!done) { done = toggle15(form, x, y, x, y-1);	}
				peeptinmoves++;
				if (check15(form)) {
					alert('You win with ' + peeptinmoves + ' moves!');
					resetboard15(form);
				}
			}
			
		}

		function showrules15() {
			rules = 'Peeptin by flooble.com \n\n' 
				+ 'The goal of the game is to arrange \n' 
				+ 'the blocks from 1 to 15 in their \n'
				+ 'numeric order. Click a number next to\n'
				+ 'the empty cell to move it into that cell.\n'
				+ 'The game is won when all the numbers\n'
				+ 'are sorted, and the empty square is in the \n'
				+ 'lower-righthand corner.';
			alert(rules);
		}
		
		function resetboard15(form) {
			for (i = 0; i < 4; i++) {
				for (j = 0; j < 4; j++) {
					val = 1 + i + (4*j);
					if (val == 16) {
						getElement15(form,i + '_' + j).value = ' ';
					} else {
						getElement15(form,i + '_' + j).value = val;
					}
				}
			}
			peeptinscore = 0;
			peeptinmoves = 0;
			ex = 3;
			ey = 3;
		}
	
		function toggle15(form, x, y, x1, y1) {
			if (x < 0 || y < 0 || x > peeptinmax || y > peeptinmax) {
				return false;
			}
			if (x1 < 0 || y1 < 0 || x1 > peeptinmax || y1 > peeptinmax) {
				return false;
			}

			name = x + '_' + y;
			button = getElement15(form,name);
			name = x1 + '_' + y1;
			button1 = getElement15(form,name);
			if (button.value == ' ' || button1.value == ' ') {
				tmp = button.value;
				button.value = button1.value;
				button1.value = tmp;
				if (button.value == ' ') {
					ex = x;
					ey = y;
				} else {
					ex = x1;
					ey = y1;
				}
				return true;
			}
			return false;
		}
		
		function check15(form) {
			peeptinscore = 0;
			for (i = 0; i < 4; i++) {
				for (j = 0; j < 4; j++) {
					val = 1 + i + (4*j);
					if (val < 16) {
						if (getElement15(form,i + '_' + j).value == val) {
							peeptinscore++;
						}
					}
				}
			}
			return peeptinscore == 15;
		}
<!-- Flooble.com peeptin end -->

theSongFiles = new Array();
theSongFiles[0] = 'Music/silence.mp3';
theSongFiles[1] = 'http://www.sixredcarpets.com/mp3/04.mp3';
theSongFiles[2] = 'http://cumberlandpunch.com/autovaughn/music/AutoVaughn_The_Cycles.mp3';
theSongFiles[3] = ' '; // One Step Away is a special case


theSongData = new Array();
theSongData[0] = '<br>Now playing:<br>Nothing, but choose whatever music you like from the dropdown list below.';
theSongData[1] = '<br>Now playing:<br>Selections from <a href="http://www.sixredcarpets.com" target="_SixRedCarpets">Six Red Carpets</a>';

theSongData[2] = '<br>Now Playing:<br>Selections from <a href="http://www.autovaughn.com/" target="_AutoVaughn">AutoVaughn</a>';
theSongData[3] = 'Now playing:<br>Selections from <a href="http://www.myspace.com/1stepawayband" target="_OneStepAway"> One Step Away</a>';

theBookThumbs = new Array();
theBookThumbs[0] = 'http://www.aprillhamilton.com/images/SnowBallThumb.jpg';
theBookThumbs[1] = 'http://www.alanbaxteronline.com/images/RealmShift-Cover-thumb.jpg';
theBookThumbs[2] = 'http://c1.ac-images.myspacecdn.com/images01/3/m_04d6aa183a4b3b29016e142a0d9fc834.jpg';

theBookPitches = new Array();
theBookPitches[0] = 'When Cinder\'s husband disappears, she learns who---and how few---her friends are in this darkly comic tale of dueling schemers and incompetents.';
theBookPitches[1] = 'A race against time and the Devil. Magic, action and intrigue, from dank city streets to the depths of Hell and beyond.';
theBookPitches[2] = 'Denver Psychologist Kismet Knight doesn\’t believe in vampires. But when a new client introduces her to gorgeous Devereux, who insists he\’s an ancient bloodsucker, Kismet soon finds herself up to her neck in the undead.';

theBookData = new Array();
theBookData[0] = 'Now featured:<br><i><a href="http://www.amazon.com/Snow-Ball-Novel-April-Hamilton/dp/1434890465" target="_SnowBall">Snow Ball</a></i> by <a href="http://www.aprillhamilton.com/" target="_AprilHamilton">April Hamilton</a>';
theBookData[1] = 'Now featured:<br><i><a href="http://www.amazon.com/RealmShift-Alan-Baxter/dp/0980578205/ref=ed_oe_p" target="_RealmShiftAmazon">RealmShift</a></i> by <a href="http://www.alanbaxteronline.com" target="_AlanBaxter">Alan Baxter</a>';
theBookData[2] = 'Now featured:<br><i><a href="http://www.amazon.com/Vampire-Shrink-Kismet-Knight-Psychologist/dp/1933836237" target="_VampireShrink">The Vampire Shrink</a></i> by <a href="http://www.LyndaHilburnAuthor.com">Lynda Hilburn</a>';

theQuips = new Array();
theQuips[0] = 'J.W. EAGAN:  Never judge a book by its movie.';
theQuips[1] = 'CLARENCE DARROW:  Someday I hope to write a book where the royalties will pay for the copies I give away.';
theQuips[2] = 'TOM CLANCY:  The difference between fiction and reality? Fiction has to make sense.';
theQuips[3] = 'ERASMUS:  When I get a little money, I buy books. And if there is any left over, I buy food.';
theQuips[4] = 'MARK TWAIN:  The man who does not read good books has no advantage over the man who can\'t read them.';
theQuips[5] = 'LOGAN PEARSALL SMITH:  People say that life is the thing, but I prefer reading.';
theQuips[6] = 'A PASSERBY:  Book lovers never go to bed alone.';
theQuips[7] = 'TOM MASSON:  Seventy million books in America\'s libraries, but the one you want to read is always out.';
theQuips[8] = 'ANATOLE FRANCE:  Never lend books, for no one ever returns them; the only books I have in my library are books that other people have lent me.';
theQuips[9] = 'MARK TWAIN:  Be careful of reading health books. You may die of a misprint.';
theQuips[10] = 'HOMER SIMPSON:  I didn\'t lie! I was writing fiction with my mouth!';
theQuips[11] = 'ERNEST HEMINGWAY:  A man\'s got to take a lot of punishment to write a really funny book.';
theQuips[12] = 'ALBERT EINSTEN:  The gift of fantasy has meant more to me than my talent for absorbing positive knowledge.';
theQuips[13] = 'TERRY PRATCHETT:  Fantasy is an exercise bicycle for the mind. It might not take you anywhere, but it tones up the muscles that can.';
theQuips[14] = 'AGATHA CHRISTIE:  I\'ve always believed in writing without a collaborator, because where two people are writing the same book, each believes he gets all the worry and only half the royalties.';
theQuips[15] = 'STEPHEN KING:  Books are a uniquely portable magic.';
theQuips[16] = 'JOHANN WOLFGANG VON GOETHE:  Magic is believing in yourself; if you can do that, you can make anything happen.';
theQuips[17] = 'NORMAN VINCENT PEALE:  Imagination is the true magic carpet.';
theQuips[18] = 'ANATOLE FRANCE:  I would define a book as a work of magic whence escape all kinds of images to trouble the souls and change the hearts of men.';
theQuips[19] = 'ROBERT HEINLEIN:  One man\'s "magic" is another man\'s engineering. "Supernatural" is a null word.';
theQuips[20] = 'TOM ROBBINS:  Using words to describe magic is like using a screwdriver to cut roast beef.';
theQuips[21] = 'EDEN PHILLPOTTS:  The universe is full of magical things, patiently waiting for our wits to grow sharper.';
theQuips[22] = 'TOM ROBBINS:  Disbelief in magic can force a poor soul into believing in government and business.';
theQuips[23] = 'FRANCIS BACON: Many secrets of art and nature are thought by the unlearned to be magical.';
theQuips[24] = 'CHARLES DE LINT:  That\'s the thing with magic. You\'ve got to know it\'s still here, all around us, or it just stays invisible for you.';
theQuips[25] = 'EARVIN "MAGIC" JOHNSON:  You don\'t have to be magic to be special. You\'re already special; you\'re you.';
theQuips[26] = 'ORSON SCOTT CARD:  When magic comes back into the world, ... here\'s where it comes from, leaking from this drainpipe.';
theQuips[27] = 'MAYA ANGELOU:  If one is lucky, a solitary fantasy can totally transform one million realities.';
theQuips[28] = 'GOYA:  Fantasy, abandoned by reason, produces impossible monsters; united with it, she is the mother of the arts and the origin of marvels.';
theQuips[29] = 'IRIS MURDOCH:  We live in a fantasy world, a world of illusion. The great task in life is to find reality.';
//theQuips[99] = 'MARCIA WIEDER:  Every day use your magic to be of service to others.';

// half for MM; other half for sponsors
theAds = new Array;
theAds[0] = 'PIERS ANTHONY:  I have read Modern Magic, by Anne Cordwainer.  I love it!' + "\n\n" + 'ANNE CORDWAINER:  Wow.  Thanks!';
theAds[1] = 'CHERYL CLUNIE, of Fantasy Magazine:  I am very exited about Modern Magic.' + "\n\n" + 'ANNE CORDWAINER:  Thank you.  So am I.';
theAds[2] = 'DENNY UPKINS, of The Chronicle:  Modern Magic will no doubt be enjoyed by casual and hardcore fantasy fans alike.' + "\n\n" + 'ANNE CORDWAINER:  You\'re too kind, Denny.';
theAds[3] = 'LEAH CYPESS:  I literally found Modern Magic hard to put down.  And many, many lines made me laugh.' + "\n\n" + 'ANNE CORDWAINER: I\'m so glad you enjoyed it.  I love your work, too.';
theAds[4] = 'BROOKE BONETT, of the Bluestocking Guide:  If you are interested in leaving the unicorns, broomsticks, and potions behind, then Modern Magic is the book for you.' + "\n\n" + 'ANNE CORDWAINER: Thank you.  I love the Bluestocking Guide.';
theAds[5] = 'ANNE CORDWAINER:  Check out Six Red Carpets, under "Music," to the right.  Italy isn\'t known for its Indie scene, but they rock with the best bands out of Detroit.' + "\n\n" + 'CHRIS HOMER, of MuzikReviews:  Six Red Carpets\’ mastery of minimalist melodies is appealing, as is the band’s ability to show great balance in their songs.';
theAds[6] = 'ANNE CORDWAINER:  Give AutoVaughn\'s music a try.  They\'re underrated.  Which is quite a trick, since they\'re rated pretty highly by most listeners.' + "\n\n" + 'ANDY SCHEFFLER, of Cord Magazine:  It could have been made 20 years ago, or it could have been made last week with a throwback to 20 years ago. A sort of yummy organized chaos - mild freakouts. I mean - they get loud and quick but they don\'t cut loose with wild abandon. But it\'s lovely and groovable.';
theAds[7] = 'ANNE CORDWAINER:  Have you read <i>Snow Ball</i>?  The dialogue is hilarious.' + "\n\n" + 'LIBBY CONE, Amazon reviewer: Snow Ball is an amusing crime novel with plot, subplot, and sub-sub-plot elements that the author manages to keep track of without overburdening her prose.';
theAds[8] = 'ANNE CORDWAINER:  Have you read <i>RealmShift</i>?  It\'s an action-packed exploration of the supernatural clash of various religions and philosophies.' + "\n\n" + 'JAMES FROST, Amazon reviewer:  Realmshift is action packed and keeps you wanting more, with a plot that builds to an exciting crescendo. The characters are three dimensional, and you find yourself caring about what happens to the \`bad guys\' as well as the good.';
theAds[9] = 'ANNE CORDWAINER:  Have you read <i>The Vampire Shrink</i>?  A psychologist with a practical and realistic attitude finds her practice forcing her into accepting that the supernatural is part of the real.' + "\n\n" + 'KIMBERLY SWAN, of Darque Reviews:  <i>The Vampire Shrink</i> is the first book in the refreshing Kismet Knight, Vampire Psychologist series. Kismet lives her life blissfully unaware that vampires share her world until she meets Devereux, and now there\’s no going back. Ms. Hilburn pens a deliciously sexy and easily believable vampire tale. Vivid characterization, a touch of mystery, and a ton of passion, make this alternate Denver a place that readers will be looking forward to visiting again.';



function PartyLoad() {

//shuffle the number slide game
shuffle15(document.getElementById('numberslide'),150);

//pause, then rotate quotations
setTimeout("RotateConversation()", 20000);

}

function RotateConversation() {


// Will we put up a Quip or an Ad?

if (Math.floor(Math.random()*5) < 4) {
// random number 0-4 was less than 4
	var i = Math.floor(Math.random()*theQuips.length);
	document.getElementById("conversation").innerHTML = theQuips[i];
} else {
// the random number was 4, 20% of the time
	var i = Math.floor(Math.random()*theAds.length);
	document.getElementById("conversation").innerHTML = theAds[i];
}


// keep waiting & rotating
setTimeout("RotateConversation()", 15000);

}

function ChangeSong(newSongID) {

var songstring;

var newSongFile = theSongFiles[newSongID];

var newSongData = theSongData[newSongID];
if (newSongID == 0) {
// user has chosen silence
//songstring = '<embed height=125 width=160 id="SongFile" bgcolor="#b0c4de" src="Music/silence.mp3" autoplay=false></embed>'  + "\n\n<p>"  + newSongData + '</p>';
songstring = '<p class="Freebie">'  + newSongData + '</p>';


} else if (newSongID == 1) {
songstring = '<embed type="application/x-shockwave-flash" src="http://cache.reverbnation.com/widgets/swf/31/widgetPlayerMicro.swf?emailPlaylist=artist_244526&backgroundcolor=transparent&font_color=FFFFFF&shuffle=&autoPlay=false" height="125" width="160" wmode="transparent"/><br/><img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://www.reverbnation.com/widgets/trk/31/artist_244526//t.gif"><a href="http://www.quantcast.com/p-05---xoNhTXVc" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-05---xoNhTXVc.gif" style="display: none" border="0" height="1" width="1" alt="Quantcast"/></a><img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.11NXC/bT*xJmx*PTEyMzMzNjQ3MTc*OTUmcHQ9MTIzMzM2NDcyNDQ*NyZwPTI3MDgxJmQ9bWljcm8lNUZtdXNpYyU1RnBsYXllciU1RmZpcnN*JTVGZ2VuJmc9MSZ*PQ==.gif" />'  + "\n\n<p>"  + newSongData + '</p>';

} else if (newSongID == 2) { 

songstring = '<embed type="application/x-shockwave-flash" src="http://cache.reverbnation.com/widgets/swf/31/widgetPlayerMicro.swf?emailPlaylist=artist_203710&backgroundcolor=transparent&font_color=FFFFFF&shuffle=&autoPlay=false" height="125" width="160" wmode="transparent"/><br/><img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://www.reverbnation.com/widgets/trk/31/artist_203710//t.gif"><a href="http://www.quantcast.com/p-05---xoNhTXVc" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-05---xoNhTXVc.gif" style="display: none" border="0" height="1" width="1" alt="Quantcast"/></a><img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.11NXC/bT*xJmx*PTEyMzMzNjQ5NzEyODQmcHQ9MTIzMzM2NTA3NzczMCZwPTI3MDgxJmQ9bWljcm8lNUZtdXNpYyU1RnBsYXllciU1RmZpcnN*JTVGZ2VuJmc9MSZ*PQ==.gif" />'  + "\n\n<p>"  + newSongData + '</p>';

} else if (newSongID == 3) {

// special treatment for One Step Away,
// because they're psycho paranoid

songstring = '<embed type="application/x-shockwave-flash" src="http://cache.reverbnation.com/widgets/swf/31/widgetPlayerMicro.swf?emailPlaylist=artist_327788&backgroundcolor=transparent&font_color=FFFFFF&shuffle=&autoPlay=false" height="125" width="160" wmode="transparent"/><br/><img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://www.reverbnation.com/widgets/trk/31/artist_327788//t.gif"><a href="http://www.quantcast.com/p-05---xoNhTXVc" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-05---xoNhTXVc.gif" style="display: none" border="0" height="1" width="1" alt="Quantcast"/></a><img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.11NXC/bT*xJmx*PTEyMzMzNjQzMDAzMzYmcHQ9MTIzMzM2NDMxODUzNyZwPTI3MDgxJmQ9bWljcm8lNUZtdXNpYyU1RnBsYXllciU1RmZpcnN*JTVGZ2VuJmc9MSZ*PQ==.gif" />' + "\n\n<p>"  + newSongData + '</p>';


}
// else {

//songstring = '<embed height=200 width=200 bgcolor="#b0c4de" id="SongFile" src="' + newSongFile + '" autoplay=true>' + "\n" + '</embed>' + "\n\n" + '<p class=Freebie id=SongData>' + newSongData + '</p>';
//songstring = '<embed height=25 width=200 bgcolor="#b0c4de" id="SongFile" src="' + newSongFile + '" autoplay=true>' + "\n" + '</embed>' + "\n\n" + '<p class=Freebie id=SongData>' + newSongData + '</p>';
//}

document.getElementById("SongBox").innerHTML = songstring;

}

function ChangeBook(newBookID) {

document.getElementById('BookThumbnail').src = theBookThumbs[newBookID];

document.getElementById('BookPitch').innerHTML = theBookPitches[newBookID];

document.getElementById('BookData').innerHTML = theBookData[newBookID];

}

