/*

***********************************************************

	whichLink()



	- function that opens links

***********************************************************

*/



	function whichLink(link, whichMail) {

		if(link == "email") {

			if(whichMail == "sundance" || whichMail == "sdmerc") {

				this.location.href = "mailto:" + whichMail + "@efn.org?subject=" + whichMail + " inquiry from contact page on web site";

			}

			else if(whichMail == "info") {

				this.location.href = "mailto:" + whichMail + "@orwines.com?subject=E-mail launched from the Sundance home page";

			}

			else if(whichMail == "turtle") {

				this.location.href = "mailto:divingturtle@hotmail.com?subject=sundancenaturalfoods.com - Comment or Problem";

			}

			else {

				this.location.href = "mailto:" + whichMail + "@sundancenaturalfoods.com?subject=" + whichMail + " inquiry from contact page on web site";

			}			

		}		

		else {

			if(link == "index") {

				this.location.href = link + ".html";

			}

			else if(link == "staff") {	// used only on Site Map page

				this.location.href = "http://www.sundancenaturalfoods.com/squirrelmail/src/login.php";

			}

			else {

				this.location.href = link + ".htm";

			}

		}

	}



/*

************************************************************

	end whichLink()

************************************************************

*/





/*

***********************************************************

	about(), quote(), author(), directions(), didYouKnow(),

	peruse(), quoteTitle(), proverb(), didYouKnowTitle(),

	boldLinksNext()



	- functions that display appropriate information

***********************************************************

*/



	function about(disabled) {

		var aboutUs = '<a href="index.htm" class="titleBar" onMouseOver="javascript:linkStatus(' + '\'' + 'About Us' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;">';

		var contact = '<a href="contact.htm" class="titleBar" onMouseOver="javascript:linkStatus(' + '\'' + 'Contact Sundance' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;">';

		

		if(disabled == "both") {

			document.write(aboutUs + 'About Us</a> | ' + contact + 'Contact</a>');

		}

		else if(disabled == "about") {

			document.write('<span class="yellow">About Us</span> | ' + contact + 'Contact</a>');

		}

		else {

			document.write(aboutUs + 'About Us</a> | ' + '<span class="yellow">Contact</span>');

		}

	}



	function quote() {

		document.write('Life is the dream that must be interpreted.');

	}



	function author() {

		document.write('- Rumi');

	}



	function directions() {

		map = '<a href="http://maps.yahoo.com/py/ddResults.py?Pyt=Tmap&doit=1&newname=&newdesc=&newaddr=&newcsz=&newtaddr=748+E.+24th+Avenue&newtcsz=Eugene,+OR+97405&Get+Directions=Get+Directions" class="left" onMouseOver="javascript:linkStatus(' + '\'' + 'Driving Directions w/Map' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;" target="_blank">';

		

		document.write('- ' + map + 'Driving Directions w/Map' + '</a>');		

	}



	function didYouKnow() {

		var facts = new Array();

		var whichFact;



		facts[0] = 'Sundance\'s Hot Foods Bar is open from 11 AM until 8:30 PM every day.';

		facts[1] = 'Sundance Deli features prepared and fresh green salads from 9 AM until 8:30 PM every day.';

		facts[2] = 'Sundance\'s Salad Bar features an extensive selection of olives.';

		facts[3] = 'Sundance has Eugene\'s only all organic self- serve deli.';

		facts[4] = 'Sundance Deli is all vegetarian and mostly vegan.';

		facts[5] = 'Sundance has an extensive collection of local cheeses.';

		facts[6] = 'Sundance Kitchen Bakery features many delicious all organic sweet treats, All are vegan, and  many are wheat-free!';

		facts[7] = 'Sundance features a selection of organic wines and beers from around the world.';

		facts[8] = 'Sundance carries mostly rennetless (vegetarian) cheeses.';

		facts[9] = 'Sundance\'s produce department buys as much locally grown fresh produce as possible.';

		facts[10] = 'Sundance\'s produce department is stocked 100% with organic fruits, vegetables, and organic and wildcrafted fungi!';

facts[11] = 'Sundance\'s Vitamin department features an extensive selection of homeopathic remedies.';

facts[12] = 'Sundance has a full service Health and Beauty Aids department with friendly and knowledgable staff members.';

facts[13] = 'Sundance features many local manufacturers and vendors in our packaged, refrigerated, and bulk foods departments.';

facts[14] = 'Sundance has a large selection of bulk, mostly organic, herbs, teas, and spices.';

facts[15] = 'Sundance Wine Cellars offers the region\'s largest selection of wines and specializes in Oregon Wines.';

facts[16] = 'Sundance features a comprehensive discount vitamin department.';



		

		whichFact = Math.floor(Math.random() * (facts.length));

		document.write(facts[whichFact]);

	}



	function peruse() {

		document.write('<span class="bold">Peruse Our Website</span>');

	}



	function boldLinks(onFact) {

		var span = '<span class="bold">';



		if(onFact == "facts") {

			document.write('- ' + span + '<span class="yellow">' + 'Natural Food Facts' + '</span></span><br>');

		}

		else {

			document.write('- ' + '<a href="facts.htm" class="left" onMouseOver="javascript:linkStatus(' + '\'' + 'Natural Food Facts' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;">' + span + 'Natural Food Facts' + '</span></a><br>');

		}		

		document.write('- ' + '<a href="http://organicconsumers.org/irradlink.html" class="left" onMouseOver="javascript:linkStatus(' + '\'' + 'Irradiation' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;" target="_blank">' + span + 'Irradiation' + '</span></a><br>');

		document.write('- ' + '<a href="http://organicconsumers.org/gelink.html" class="left" onMouseOver="javascript:linkStatus(' + '\'' + 'Genetically Modified Organisms' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;" target="_blank">' + span + 'GMO\'s' + '</span></a><br>');

		document.write('- ' + '<a href="http://organicconsumers.org/madcow.htm" class="left" onMouseOver="javascript:linkStatus(' + '\'' + 'Mad Cow Disease' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;" target="_blank">' + span + 'Mad Cow Disease' + '</span></a>');

	}



	function boldLinksNext(whichNext) {

		var shirtLink = '<a href="shirts.htm" class="titleBar" onMouseOver="javascript:linkStatus(' + '\'' + 'Sundance T-Shirts' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;">';

		var linkLink = '<a href="links.htm" class="titleBar" onMouseOver="javascript:linkStatus(' + '\'' + 'Links' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;">';

		var siteMap = '<a href="siteMap.htm" class="titleBar" onMouseOver="javascript:linkStatus(' + '\'' + 'Site Map' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;">';



		if(whichNext == "all") {

			document.write('- ' + shirtLink + '<b>Sundance T-Shirts</b>' + '</a><br>');

			document.write('- ' + linkLink + '<b>Links</b>' + '</a><br>');

			document.write('- ' + siteMap + '<b>Site Map</b>' + '</a>');

		}

		else if(whichNext == "shirts") {

			document.write('- <span class="yellow">' + '<b>Sundance T-Shirts</b></span><br>');

			document.write('- ' + linkLink + '<b>Links</b>' + '</a><br>');

			document.write('- ' + siteMap + '<b>Site Map</b>' + '</a>');

		}

		else if(whichNext == "siteMap") {

			document.write('- ' + shirtLink + '<b>Sundance T-Shirts</b>' + '</a><br>');

			document.write('- ' + linkLink + '<b>Links</b>' + '</a><br>');

			document.write('- <span class="yellow">' + '<b>Site Map</b></span>');

		}

		else {

			document.write('- ' + shirtLink + '<b>Sundance T-Shirts</b>' + '</a><br>');

			document.write('- <span class="yellow">' + '<b>Links</b></span><br>');

			document.write('- ' + siteMap + '<b>Site Map</b>' + '</a>');

		}		

	}



	function quoteTitle() {

		document.write('<span class="bold">Quote of The Week</span>');

	}



	function proverb() {

		document.write('Individuals Nourishing Community since 1971');

	}



	function didYouKnowTitle() {

		document.write('<span class="bold">Did you know...</span>');

	}



	function leftSideEmail() {

		document.write('- E-mail: <a href="mailto:sundance@efn.org?subject=a contact from Sundance\'s web site" class="left" onMouseOver="javascript:linkStatus(' + '\'' + 'Send E-mail to Sundance' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;">sundance@efn.org</a>');

	}



	function dispImage(whichImg) {

		var width = 570;

		var height = 450;

		var leftPos = (screen.width) ? (screen.width - width) / 2 : 0;

//		var topPos = (screen.height) ? (screen.height - height) / 2 : 0;



		window.open(whichImg + '.htm', 'Shirts', 'width=' + width + ',height=' + height + ',top=0,left=' + leftPos + ',scrollbars=no,toolbar=no,menubar=no,location=no,resizable=no');

	}



/*

************************************************************

	end about(), quote(), author(), directions(),

	didYouKnow(), peruse(), quoteTitle, proverb(),

	didYouKnowTitle(), boldLinksNext()

************************************************************

*/



/*

***********************************************************

	dispTurtle(), dispCopyright



	- function that displays diving turtle info

	- function that displays copyright info

***********************************************************

*/



	function dispTurtle() {

		var email = '<a href="http://www.sundancenaturalfoods.com/new" class="titleBar" onMouseOver="javascript:linkStatus(' + '\'' + 'd i v i n g t u r t l e d e s i g n . c o m' + '\'' + ');return true;" onMouseOut="javascript:linkStatus(0);return true;">';

		var bold = '<span class="bold">';



		var endAnchor = '</a>';

		var endSpan = '</span>';



		document.write('Blog ' + email + bold + 'Site' + endSpan + endAnchor);

	}



	function dispCopyright() {

		document.write('Copyright © 2009 Sundance Natural Foods');

	}



/*

************************************************************

	end dispTurtle(), dispCopyright

************************************************************

*/



/*

***********************************************************

	OpenWin()



	- function for opening new window

	- size is determined at function call

	- centers window

***********************************************************

*/



	function OpenWin(whatPage, whatName, width, height, scroll, toolbar, menubar, location, resize) {

		var newWin = null;



		leftPos = (screen.width) ? (screen.width - width) / 2 : 0;

//		topPos = (screen.height) ? (screen.height - height) / 2 : 0;



		settings = 'height=' + height + ',width=' + width + ',top=0,left=' + leftPos + ',scrollbars=' + scroll + ',toolbar=' + toolbar + ',menubar=' + menubar + ',location=' + location + ',resizeable=' + resize;



		newWin = window.open(whatPage, whatName, settings);

	}



/*

************************************************************

	end OpenWin()

************************************************************

*/
