function swapTab(which)
{
	clearAllBoxes();

	document.getElementById('tabs').className = which;
	document.getElementById(which + 'Box').style.display = 'block';
}

function clearAllBoxes()
{
	document.getElementById('basketryStartsBox').style.display = 'none';
	document.getElementById('imageGalleryBox').style.display = 'none';
	document.getElementById('materialsBox').style.display = 'none';
	document.getElementById('patternsBox').style.display = 'none';
}

function manageThumb(whichSection,whichThumb,whichImg,whichData)
{
	thumbChildren=document.getElementById('thumbsBox' + whichSection).getElementsByTagName('a');
	for(i=0;i<thumbChildren.length;i++)
	{
		thisChild=thumbChildren[i].className='thumb';
	}
	
	document.getElementById(whichThumb).className = 'thumb active';
	
	document.getElementById('bigImg' + whichSection).style.background = 'url(' + whichImg + ')';

	// To fix flickering in IE6, that sorry excuse for a browser
	document.getElementById('divBigImg' + whichSection).style.background = 'url(' + whichImg + ') 0 1px no-repeat';
	// end
	
	document.getElementById('bigImg' + whichSection).href = whichData[0];
	
	document.getElementById('imgCaption' + whichSection).innerHTML = whichData[1];
	document.getElementById('imgDescription' + whichSection).innerHTML = whichData[2];
}


// arrays
var imageGalleryOne =		new Array('img/basketry/images/A_bowl_pop.jpg','<em>Credit: Jamal Mubarek</em>','Basket Bowl, Luise&ntilde;o, mid-20th century');
var imageGalleryTwo =		new Array('img/basketry/images/A_cook_pop.jpg','<em>Credit: Jamal Mubarek</em>','<em>Left:</em> "Throwaway" Gathering Basket, Cahuilla or Mission, early 20th century. This quickly made, then discarded, basket is twined with whole, unsplit juncus. This is one of the few examples of twining in Southern California.<br /><em>Right:</em> Cooking Basket, Luise&ntilde;o, possibly from the Hemet area, 1800-1900. This basket has a northern Luise&ntilde;o design and shows scorch marks and stains from use.');
var imageGalleryThree =		new Array('img/basketry/images/A_date_pop.jpg','<em>Credit: Jamal Mubarek</em>','Date Basket, Diegue&ntilde;o or Cahuilla, Coachella Valley, mid-1930s. This type of basket was packed with dates and sold in the Valerie Jean area of the Coachella Valley, where the Torres-Martinez Indian reservation lies today.');
var imageGalleryFour =		new Array('img/basketry/images/A_food_pop.jpg','<em>Credit: Jamal Mubarek</em>','<em>Middle:</em> Food Basket, Serrano, Twenty-Nine Palms area, circa 1990. The red color used in this design is from the bark of the yucca or Joshua tree root.');
var imageGalleryFive =		new Array('img/basketry/images/A_gamble_pop.jpg','<em>Credit: Jamal Mubarek</em>','Gambling Tray, Diegue&ntilde;o, Mesa Grande, pre-1911. The wear visible in the juncus design band might be due to being scraped by gambling sticks.');
var imageGallerySix =		new Array('img/basketry/images/A_gift_pop.jpg','<em>Credit: Jamal Mubarek</em>','Gift or Small Storage Basket, Serrano, Cahuilla, or Diegue&ntilde;o, circa 1910-1930.');
var imageGallerySeven =		new Array('img/basketry/images/A_gift2_pop.jpg','<em>Credit: Jamal Mubarek</em>','<em>Bottom left:</em> Gift Baskets, Luise&ntilde;o, possibly Hemet area, circa 1910-1920s.');
var imageGalleryEight =		new Array('img/basketry/images/A_hat_pop.jpg','<em>Credit: Jamal Mubarek</em>','Basket Hat by Celia Silva, Kumeyaay, San José de la Zorra, Baja California, 1996. Evocative of the whirlwind design.');
var imageGalleryNine =		new Array('img/basketry/images/A_lid_pop.jpg','<em>Credit: Jamal Mubarek</em>','Basket with Lid and Handle by Mary Kintano, Desert Cahuilla, circa 1900-1930. This coiled basket is made of palm leaves and juncus.');
var imageGalleryTen =		new Array('img/basketry/images/A_oval_pop.jpg','<em>Credit: Jamal Mubarek</em>','Oval Basket, Cahuilla, early 20th century. Although this has a burned bottom, it is not a cooking basket. It may have been used for storage or possibly for trading.');
var imageGalleryEleven =	new Array('img/basketry/images/A_rattle_pop.jpg','<em>Credit: Jamal Mubarek</em>','Rattlesnake Basket Tray, Diegue&ntilde;o, possibly from the Santa Ysabel region, early 1900s.');
var imageGalleryTwelve =	new Array('img/basketry/images/A_star_pop.jpg','<em>Credit: Jamal Mubarek</em>','Basket Tray by Christina La Chappa, Diegue&ntilde;o, Volcan Reservation, pre-1968. The flat unadorned is a winnowing basket.');
var imageGalleryThirteen =	new Array('img/basketry/images/A_storage_pop.jpg','<em>Credit: Jamal Mubarek</em>','<em>Top right:</em> Small Storage Basket, Luise&ntilde;o, possibly Temecula or Hemet area, circa 1920s.');
var imageGalleryFourteen =	new Array('img/basketry/images/A_tray_pop.jpg','<em>Credit: Jamal Mubarek</em>','<em>Middle:</em> Basket Tray, Gabrieli&ntilde;o, late 1800s. This flat, unadorned basket could have been used for food preparation or for gambling.');
var imageGalleryFifteen =	new Array('img/basketry/images/A_utility_pop.jpg','<em>Credit: Jamal Mubarek</em>','Utility Basket, Luise&ntilde;o, 1900-1920. This type of basket had many uses.');

var materialsOne =			new Array('img/basketry/images/C_intro_pop.jpg','Intro. <em>Credit: Jamal Mubarek</em>','Basketry is more than just weaving. It represents a balance with the environment, seasonal collecting, material preparation, aging and dying. Today, the weaver is in constant search for the best material, which may be the result of a prime location. More often it is the outcome of special care given by the weaver. This includes annual harvesting or pruning, burning when possible, and polite conversation: a good weaver will always talk to the plants and share the news of the day. Some of these plants are hundreds of years old and have been visited by several generations of weavers so they know us well.');
var materialsTwo =			new Array('img/basketry/images/C_deergrass_pop.jpg','Deergrass. <em>Credit: Jamal Mubarek</em>','Preparation of weaving materials can be very tedious. The deergrass flower stalks need to be stripped of their seeds and chaff. This requires slow and patient passing of the flower stalk through a cloth or leather strip. (A weaver will often suffer several fine splinters piercing fingers and hands as the work progresses. The splinters usually resist being removed by simply breaking up beneath the skin and refusing the grip of tweezers.)');
var materialsThree =		new Array('img/basketry/images/C_sumac_pop.jpg','Sumac. <em>Credit: Jamal Mubarek</em>','Sumac, which is also called skunk bush or sour berry, must be collected when the sap is down and preferably in late winter. The long leafless stalks are collected and split into two or three laces. Each weaver will develop a personal preference on preparing sumac. Sometimes it is easier to split and size the material immediately after harvest. Some weavers prefer to split the material and then dry it for up to two years before sizing the laces. The laces are usually white in color and are usually used as the white utilized in designs. The laces do accept dye made from desert dye weed. This produces a yellow lace. Sumac resists black dyes and will often turn brown instead.<br /><br />The major challenge to the weaver utilizing sumac as the primary lace in weaving is overcoming what some consider a very pungent and repulsive odor given off by the plant when it is cut and split. The term "Skunk Bush" is a well-earned common name for this species of sumac. Some people like the smell of sumac but preparing the material goes well beyond just simple odor. Producing three laces from a single stalk requires that the weaver put the end of one lace in the mouth while the other two laces are held by the hands. Not only does the weaver have to endure the smell of the plant &mdash; but the taste, too.');
var materialsFour =			new Array('img/basketry/images/C_juncus_pop.jpg','Juncus. <em>Credit: Jamal Mubarek</em>','The next common plant utilized in the making of the laces is called juncus, also known as wire grass. The stalks of the wire grass were gathered and split into three laces just like sumac. In some cases, the three laces could be split again into six laces depending upon the size of the juncus stalk. Like Sumac, preparation of Juncus was dependent upon the preferences of the weaver. Juncus produces a green stalk and will retain its color until exposed to sunlight. Also, at the base of the stalk, juncus will produce a length of reddish brown material varying in length from a few inches up to eighteen inches before transcending into green. This length of brown color is one of the common colors used in making the designs in the baskets.');
var materialsFive =			new Array('img/basketry/images/C_juncus2_pop.jpg','Juncus 2. <em>Credit: Jamal Mubarek</em>','Once Juncus is split into laces and sized, it is placed in the sun so that the green color can be bleached out. Once this is done the laces are ready to accept dye. The most common dye is rust or iron oxide. The laces are placed in a metal vat of water and rust and allowed to soak for one or two weeks. The resulting color is black. The external surface of Juncus has a natural sheen and when dyed black the sheen is very obvious. Yellow dye from the desert dye weed was also used to dye Juncus but was not as common with Juncus as with Sumac.');
var materialsSix =			new Array('img/basketry/images/C_willow_pop.jpg','Willow. <em>Credit: Jamal Mubarek</em>','Willow, a traditional material, has almost lost its place in the current world of Pechanga basket weaving. This is not due to a lack of interest in using the willow but the fact that the particular species utilized for weaving has all but disappeared. This loss is caused by the reduction in willow habitat due to water tables subsiding as a result of pumping groundwater, a practice not known to the Pechanga Tribe and the plants themselves prior to contact. Willow produces a white lace and is often mistaken for Sumac in the older baskets.');
var materialsSeven =		new Array('img/basketry/images/C_yucca_pop.jpg','Yucca. <em>Credit: Jamal Mubarek</em>','Yucca Fiber with leaf stalk, Yucca mojaviensis. Shredded fibers can be used as the foundation for a basket\'s start.');

var patternsOne =			new Array('img/basketry/images/D_ab1_pop.jpg','Abstract design. <em>Credit: Jamal Mubarek</em>','The diamond-backed rattlesnake is the design used. The diamonds are often staggered in size just as they would appear on a live snake. In some cases, two snakes are woven into the basket. This basket also evokes the whirlwind design, an important spiritual element.');
var patternsTwo =			new Array('img/basketry/images/D_ab2_pop.jpg','Abstract design. <em>Credit: Jamal Mubarek</em>','Many traditional designs were geometrical &mdash; reflecting the importance of a sense of harmony &mdash; and often solely the weaver knew what the design represented or meant. Some included starting the design with the forked tongue of the snake or with the rattles.');
var patternsThree =			new Array('img/basketry/images/D_ab3_pop.jpg','Abstract design. <em>Credit: Jamal Mubarek</em>','It is one thing to weave these designs on a flat tray surface but it is even more difficult to continue these designs through the curvature on a bowl or orb basket. Before the rattlesnake design emerged as one of the more popular designs, the traditional representation was probably that of a serpent that protected waters or springs, and the water dog or salamander. These could be depicted in intricate photo-like representations, or simple stick figure designs.');
var patternsFour =			new Array('img/basketry/images/D_butterfly_pop.jpg','Butterfly. <em>Credit: Jamal Mubarek</em>','Design: Butterfly. This design also evokes a complimentary flower design.');
var patternsFive =			new Array('img/basketry/images/D_corn_pop.jpg','Corn pattern. <em>Credit: Jamal Mubarek</em>','The corn design, a "tourist" or non-traditional design, also changed from a simple two-dimensional stacking of right and left leaves forming the corn stalk, to the more contemporary display of exposed corn cobs along the stalk detailing corn kernels. Some baskets just simply had the corn cob with detailed multi-colored corn kernels.');
var patternsSix =			new Array('img/basketry/images/D_eagle_pop.jpg','Eagle. <em>Credit: Jamal Mubarek</em>','Design: Eagle. This is a key element of our Creation story and in our religion.');
var patternsSeven =			new Array('img/basketry/images/D_flower_pop.jpg','Flower. <em>Credit: Jamal Mubarek</em>','Four point designs are very simple, but introducing a fifth makes it almost impossible to keep the flower petals equal in size as well as equally distanced from each other. (It must be noted that in weaving, the basket is continuously expanding, and the design never meets its beginning and so designs are never equal in proportion. A good weaver can create the illusion that the designs are equal and that the elements are proportionate to each other).');
var patternsEight =			new Array('img/basketry/images/D_rattle_pop.jpg','Rattlesnake basket tray. <em>Credit: Jamal Mubarek</em>','Diamond patterns in basketry reference diamond patterns used in ceremonies and rock paintings &mdash; connoting fertility. The clockwise direction of the diamonds references how people move in ceremonies. This type of basket &mdash; a tray basket &mdash; was used to make an offering of goods in ceremonies.');
var patternsNine =			new Array('img/basketry/images/D_star_pop.jpg','Star pattern basket tray. <em>Credit: Jamal Mubarek</em>','One of the most common basket designs is the flower or star pattern. Most observers perceive this as one of the simplest weaving designs. In fact, it is one of the most difficult because it requires a five point proportionate pattern.');

var basketryStartsExtra =		new Array('img/basketry/images/B_start2_pop.jpg','Basket start. <em>Credit: Jamal Mubarek</em>','Traditional Pechanga Luise&ntilde;o weaving techniques share many similarities with other Tribes of California. Construction is usually coil or a grass bundle wrapped with a lace made from various plants. Weaving laces are usually made from Juncus or Sumac. The grass bundles are made from deergrass.');
var basketryStartsTwo =		new Array('img/basketry/images/B_yucca_pop.jpg','Yucca fiber. <em>Credit: Jamal Mubarek</em>','Starting a basket is considered to be one of the most difficult parts of weaving. Most baskets are started by forming a bundle with yucca fiber, and then wrapping it with the selected lace.');
var basketryStartsOne =		new
Array('img/basketry/images/B_start_pop.jpg','Basket start. <em>Credit: Jamal Mubarek</em>','After completing two or three rounds, the weaver begins to insert flower stalks from the Deer Grass until the yucca fiber is spent and the stalks make up the main foundation of the basket. Starting a basket can be very difficult and even some of the best weavers will buy basket starts from other weavers.');
var basketryStartsThree =		new Array('img/basketry/images/B_awl_pop.jpg','Awl. <em>Credit: Jamal Mubarek</em>','An awl of varying materials is used to pierce the top edge of the bundle so that the lace can be passed through and wrapped around the successive bundle. Awls are made of bone, metal, or cactus thorn. A Deer bone awl was preferred prior to European contact but was quickly replaced with metal needles during the post-contact period. Most weavers will now utilize both bone and metal awls depending upon the material and the style of the weave. Metal has a tendency to grab the material and cause tearing in the lace. Bone awls have much less drag and lessen the chance of breaking a lace when piercing the bundle.');


// Associative array - marries an image URL to its caption HTML.
// Not as clean as looking up the caption-URL correspondence 
// in the other arrays, but simpler to execute.
var urlToCaption = new Array();
urlToCaption['A_bowl_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_cook_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_date_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_food_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_gamble_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_gift_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_gift2_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_hat_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_lid_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_oval_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_rattle_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_star_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_storage_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_tray_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';
urlToCaption['A_utility_pop.jpg'] = '<em>Credit: Jamal Mubarek</em>';

urlToCaption['C_intro_pop.jpg'] = 'Intro. <em>Credit: Jamal Mubarek</em>';
urlToCaption['C_deergrass_pop.jpg'] = 'Deergrass. <em>Credit: Jamal Mubarek</em>';
urlToCaption['C_sumac_pop.jpg'] = 'Sumac. <em>Credit: Jamal Mubarek</em>';
urlToCaption['C_juncus_pop.jpg'] = 'Juncus. <em>Credit: Jamal Mubarek</em>';
urlToCaption['C_juncus2_pop.jpg'] = 'Juncus 2. <em>Credit: Jamal Mubarek</em>';
urlToCaption['C_willow_pop.jpg'] = 'Willow. <em>Credit: Jamal Mubarek</em>';
urlToCaption['C_yucca_pop.jpg'] = 'Yucca. <em>Credit: Jamal Mubarek</em>';

urlToCaption['D_ab1_pop.jpg'] = 'Abstract design. <em>Credit: Jamal Mubarek</em>';
urlToCaption['D_ab2_pop.jpg'] = 'Abstract design. <em>Credit: Jamal Mubarek</em>';
urlToCaption['D_ab3_pop.jpg'] = 'Abstract design. <em>Credit: Jamal Mubarek</em>';
urlToCaption['D_butterfly_pop.jpg'] = 'Butterfly. <em>Credit: Jamal Mubarek</em>';
urlToCaption['D_corn_pop.jpg'] = 'Corn pattern. <em>Credit: Jamal Mubarek</em>';
urlToCaption['D_eagle_pop.jpg'] = 'Eagle. <em>Credit: Jamal Mubarek</em>';
urlToCaption['D_flower_pop.jpg'] = 'Flower. <em>Credit: Jamal Mubarek</em>';
urlToCaption['D_rattle_pop.jpg'] = 'Rattlesnake basket tray. <em>Credit: Jamal Mubarek</em>';
urlToCaption['D_star_pop.jpg'] = 'Star pattern basket tray. <em>Credit: Jamal Mubarek</em>';

urlToCaption['B_start2_pop.jpg'] = 'Basket start. <em>Credit: Jamal Mubarek</em>';
urlToCaption['B_yucca_pop.jpg'] = 'Yucca fiber. <em>Credit: Jamal Mubarek</em>';
urlToCaption['B_start_pop.jpg'] = 'Basket start. <em>Credit: Jamal Mubarek</em>';
urlToCaption['B_awl_pop.jpg'] = 'Awl. <em>Credit: Jamal Mubarek</em>';



function enlargeImg(whichImg)
{
	if (document.getElementById)
	{
		var writePop = window.open('','_blank','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=50,height=50');
		
		var popTop = '';
		popTop += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n';
		popTop += '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n';
		popTop += '\n';
		popTop += '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">\n';
		popTop += '<head>\<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\n<meta http-equiv="imagetoolbar" content="false" />\n<\script>\n';
		popTop += 'function resizeZoomer(){\n';
		popTop += 'document.getElementById(\'loading\').style.display=\'none\';\n';
		popTop += 'document.getElementById(\'image\').style.visibility=\'visible\';\n';
		popTop += 'document.getElementById(\'body\').style.background=\'#FFF\';\n';
		popTop += 'var sizeX = document.getElementById(\'image\').offsetWidth+10;\n';
		popTop += 'var sizeY = document.getElementById(\'image\').offsetHeight+95;\n';
		popTop += 'self.resizeTo(sizeX,sizeY);\n';
		popTop += '}\n';
		popTop += '\<\/script>\n';
		popTop += '<title>Image Zoom</title>\n';
		popTop += '<style type="text/css" media="all">a {font:normal 9px verdana; text-decoration:underline; color: #4E3423; display:block;float:right;height:12px;} a:hover {color:#C76007;}</style>';
		popTop += '</head>\n';
		popTop += '<body id="body" onload="resizeZoomer();" style="margin:0;padding:0;background:#815527;">\n';
		
		popTop += '<div style="float:left;height:30px;width:400px;padding:15px 0 0 15px;"><p style="color: #75532D; font: normal 9px verdana;">';
		popTop += urlToCaption[whichImg.substring(whichImg.lastIndexOf('/')+1)];
		popTop += '</p></div>';
		popTop += '<div style="float:right;padding: 15px 15px 0 0"><a href="#" onclick="self.close();" style="width: 91px; margin-left: 15px; background: url(../img/icon_close-noText.gif) no-repeat;padding-left: 15px;">Close Window</a><a href="#" onclick="self.print();" style="width: 44px; background: url(../img/icon_print-noText.gif) no-repeat;padding-left:17px;">Print</a></div>';
		popTop += '<div style="clear:both;height:0.1em;"></div>';

		popTop += '<img id="loading" style="display: block;" src="img/loading.gif" width="43" height="5" alt="loading" />\n';
		popTop += '<img id="image" style="visibility: hidden;" src="' + whichImg + '" alt="click to close" border="0" />\n';
		popTop += '<\script>\n';
		popTop += 'document.getElementById(\'image\').onload = resizeZoomer;\n';
		popTop += '<\/script>\n';
		popTop += '</body>\n';
		popTop += '</html>\n';
		
		popRocks = writePop.document;
		popRocks.open();
		popRocks.write(popTop);
		popRocks.close();
	}
	else return true;
}
