	//global variables
	var currentgallery = "ettinger";
	var currentpic = "images/august_rain_cover.jpg";
	var counter = 0;
	var x = 0;
	var i = 0;
	var color_counter = 0;
	var place = 0;
	var arrlength = 0;
	var range = 0;
	var hold_over = "";
	var show_toggle = 1;
	var fade_toggle = 0;
	var stop_change = 0;
	var emptyVar;
		
	// set the arrays 
	// home page quotes
	var quote_array=[["Publisher&#8217;s Top Picks for 2006", "http://www.allaboutjazz.com/php/article.php?id=24269", " - Michael Ricci, Publisher, All About Jazz"],["Recommended.", "press.htm#quote1", " - Scott Yanow, All Music Guide"],["...a new benchmark for creative jazz violin.", "press.htm#quote3", " - Chris May, All About Jazz"],["By turns joyous and autumnal, pensive and funked up...all sometimes within the course of the same tune, Ettinger&#8217;s music blends precisely arranged...unfettered collective improvisation.", "press.htm#quote3", " - Chris May, All About Jazz"],["...the rock and roll thrash of the title cut turns into a mysterious plunge into the cosmos.", "press.htm#quote2", " - Nate Dorward, Signal to Noise Magazine"],["the ... lyricism of &quot;Harper Lee&quot; twists between dark and light, eliciting some of Ettinger&#8217;s most rapt, flowing violin...", "press.htm#quote2", " - Nate Dorward, Signal to Noise Magazine"],["...he mixes together lyrical melodies with free playing while emphasizing catchy yet unpredictable rhythms...", "press.htm#quote1", " - Scott Yanow, All Music Guide"],["Best of 2006","http://www.allaboutjazz.com/php/article.php?id=24257", " - Paul Olson, All About Jazz"],["Best of 2006","http://www.allaboutjazz.com/php/article.php?id=24118", " - Nils Jacobson, All About Jazz"],["Utterly distinctive stuff...An auspicious release.","press.htm#quote3", " - Chris May, All About Jazz"],["Best of 2006","http://www.allaboutjazz.com/php/article.php?id=24164", " - Chris May, All About Jazz"],["this diverse and colorful music ... follows its own intriguing logic.","press.htm#quote1", " - Scott Yanow, All Music Guide"]];
	
	var color_array = new Array("#ffffff", "#eeeeee", "#ededed", "#dddddd", "#dcdcdc", "#cccccc", "#cacaca", "#bbbbbb", "#aaaaaa", "#a9a9a9", "#a8a8a8", "#999999", "#888888", "#878787", "#777777", "#666666", "#555555", "#444444", "#434343", "#333333", "#323232", "#222222", "#212121", "#111111", "#101010", "#000000");

	function get_val() {
		arrlength = quote_array.length;
		var quoteVal = rand(arrlength);
		return quoteVal;
	}
		
	function get_quote(quoteVal) {
		var quoteText = quote_array[quoteVal][0];
		return quoteText;
	}
	
	function get_link(quoteVal) {
		var quoteLink = quote_array[quoteVal][1];
		return quoteLink;
	}
	
	function rand(range) {
		var randomNumber = Math.floor(Math.random()*range);
		return randomNumber;
	}
	
	function get_gallery(galname,state){
		switch (galname) { 
			case "ettinger" :
				if (state==0) {
					place = 0;
					currentgallery = "ettinger";
					arrlength = home_array.length - 1;	
				}				
				document.gallerypic.src = gallery_array[place][0];
				document.gallerypic.alt = gallery_array[place][1];
				break;
			case "quote" :
				if (state==0) {
					place = 0;
					currentgallery = "quote";
					arrlength = quote_array.length - 1;	
					for (i=0;i<document.links.length;i++) {
						if (document.links[i].name=="linky") {
							counter=i;
						}
					}							
				}				
				document.getElementById('quotebox').innerHTML = "&quot;" + quote_array[place][0] + "&quot;";
				document.getElementById('author').innerHTML = quote_array[place][2];
				document.links[counter].href = quote_array[place][1];
				break;
		  default:  alert("Unexpected value encountered.");
		}		
	}

	function get_next_pic() {				
		place = place + 1;		
		if (place <= arrlength) {
			get_gallery(currentgallery,1);
			
		} else {
			place=0;
			get_gallery(currentgallery,1);
		}
	}
	
	function get_pic(planno) {
		place = planno;
		if (planno<=arrlength && planno>=0) {
			get_gallery(currentgallery,1);
		}
	}

	function put_pic(what,who) {
		document.gallerypic.src = what;
		document.gallerypic.alt = who;
	}

	function openFixedWindow(where,big) {
		var theUrl;
		var theSize;
		theUrl = where;
		theSize = big;		
		window.open(theUrl,'new_window',theSize);
	}
	function get_prev_pic() {
		place = place - 1;		
		if (place >= 0) {
			get_gallery(currentgallery,1);
		} else {
			place=arrlength;
			get_gallery(currentgallery,1);
		}		
	}

	function toggle_show() {
		if (show_toggle==0) {
			show_toggle=1;
		} else {
			show_toggle=0;
		}
		run_show();
	}

	function run_show() {		
		if (show_toggle==1) {
			place = place + 1;		
			if (place <= arrlength) {
				get_gallery(currentgallery,1);	
			} else {
				place=0;
				get_gallery(currentgallery,1);
			}			
		}

		color_painter();
	}
		
	function color_painter() {
		stop_change = 0;
		if (color_counter<25 && fade_toggle==0)	
	 		{ color_counter++; } 
		else if (color_counter == 25 && fade_toggle==0)
			{ 
				fade_toggle=1;
			} 	
		else if (color_counter > 0 && fade_toggle==1)
			{ color_counter--; } 			
	 	else 
	 		{
	 		 color_counter = 0;
	 		 stop_change = 1;
	 		}
	 	if (stop_change==0)
			{ 
			 color_changer();
			 setTimeout("color_painter()",120);
			}
		else if (color_counter==25 && fade_toggle==1)
			{
			setTimeout("color_painter()",3200);
			}
		else
			{
			 fade_toggle = 0;			
			 setTimeout("run_show()",300);
			}
	}	

		
	function color_changer() {
		var newColor = color_array[color_counter];
				//document.getElementById('quotebox').innerHTML = "<font color='" + newColor + "'>&quot;" + quote_array[place][0] + "&quot;</font>";
				document.getElementById('quotebox').style.color = newColor;
				//document.getElementById('author').innerHTML = "<font color='" + newColor + "'>" + quote_array[place][2] + "</font>";
				document.getElementById('author').style.color = newColor;
	}
	

	function nav_swap_over(navname,imgroot,imgswap) {
		hold_over=imgroot;
		document.images[navname].src=imgswap;				
	}
	function nav_swap_out(navname) {
		document.images[navname].src=hold_over;
	}
