// Javascript to go with estieg site portfolio. manages changing of main window and descriptive text// when new Image is selected from thumbnail or portfolio is browsed via the arrow images. if (document.images) {		illusText = new Image		designText = new Image		photoText = new Image		resumeText = new Image		contactText = new Image		blankText = new Image				illusText.src = "Images/label_illustration.gif"		designText.src = "Images/label_design.gif"		photoText.src = "Images/label_photo.gif"		resumeText.src = "Images/label_resume.gif"		contactText.src = "Images/label_contact.gif"		blankText.src = "Images/label_blank.gif"}var thisPic = 0;				//Keeps track of the currently displayed picture.								//array of all of the main imagesmyPix = new Array("Images/des_1.gif","Images/des_2.gif","Images/des_3.gif","Images/des_4.gif","Images/des_5.gif","Images/des_6.gif","Images/des_7.gif","Images/des_8.gif");	var imgCt = myPix.length-1;		//the total number of images on the page, as determined from the arrayvar page = ""					//set on page loading to allow for generic use on different portfolio pages. 	function setPage(input) {		//run on load to set the current page being displayed.	page = input;	}	function selectNewText (index, line) {		//nested switch functions to select the page, the index/picture, and the line text for replacing the text to the left of the images.	switch(page) {							//changes the text of one line; called from replaceLine			case 'designs':												//DESIGNS			switch(index) {				case 1:											//INDEX #1					switch(line) {						case 1:							return 'Screenshot from Connected University website';	// LINE #1						case 2:							return 'Online professional development for educators';	// LINE #2						case 3:							return 'Catalog page';	// LINE #3					}											case 2:											//INDEX #2					switch(line) {						case 1:							return 'Screenshot from Connected University website';	// LINE #1						case 2:							return 'Design of top level';	// LINE #2						case 3:							return 'Campus Union page';	// LINE #3					}													case 3:											//INDEX #3					switch(line) {						case 1:							return 'Screenshot from online orientation for Connected University';	// LINE #1						case 2:							return 'Designed to introduce site navigation and key features';	// LINE #2						case 3:							return 'to new users.';	// LINE #3					}													case 4:											//INDEX #4					switch(line) {						case 1:							return 'Screenshot from Connected University web tour';	// LINE #1						case 2:							return '10 page walkthrough of site highlighting key features;';	// LINE #2						case 3:							return 'Developed for prospective users.';	// LINE #3					}													case 5:											//INDEX #5					switch(line) {						case 1:							return 'Design of html email template for marketing department';	// LINE #1						case 2:							return 'Design coordinated with the Classroom Connect online store';	// LINE #2						case 3:							return 'for multi-purpose use';	// LINE #3					}													case 6:											//INDEX #6					switch(line) {						case 1:							return 'State of Arizona (ASSET) Portal';	// LINE #1						case 2:							return 'Custom Professional Development & Curricular Resources for AZ Educators';	// LINE #2						case 3:							return 'Finalist for a 2003 SIIA Codie Award';	// LINE #3					}													case 7:											//INDEX #7					switch(line) {						case 1:							return 'NYC Portal';	// LINE #1						case 2:							return 'Custom Professional Development Resources for NYC Educators';	// LINE #2						case 3:							return 'Modification and simplification of portal design.';	// LINE #3					}													case 8:											//INDEX #8					switch(line) {						case 1:							return 'Collaborative Redesign of Basic Custom Portal';	// LINE #1						case 2:							return 'Design coordinated with Connected University site;';	// LINE #2						case 3:							return 'Customizable elements to be determined by client.';	// LINE #3					}				default:					return 'defaulted at index';				}		default:			return 'defaulted at page';		}	}													function replaceLine(n, index, line) {				// THERE WILL BE PROBLEMS IS TEXT IS SEPARATED WITH ANY OTHER TAGS.													//finds the text node and then replaces it with the new text returned from selectNewText	if (n.nodeType == 3 /*Node.TEXT_NODE*/) {		var newNode = document.createTextNode(n);			var parent = n.parentNode;		newNode.data = selectNewText(index, line);	//set the data for the new node to that looked up in selectNewText based on the picture index value and the line value.						parent.replaceChild(newNode, n);			//replace the old node with this new one.	}	else {		var kids = n.childNodes;					//necessary to iterate through to get to the text node.		for (var i = 0; i< kids.length; i++) replaceLine(kids[i], index, line);	}}function replaceText(index) {						//Given the new picture index, calls replaceLine to find new text and replace old text													//currently hardcoded for 3 lines of text.	for (var line = 1; line < 4; line++) replaceLine(document.getElementById('l' + line), index, line);		}function chgImg(imgField,newImg) {					//rollovers for menu items at top of page	if (document.images) {		document[imgField].src= eval(newImg + ".src");	}}function chgMainImg(imgField,index) {				//changes main image and text when thumbnail is selected	if (document.images) {		thisPic = index - 1;						//updates thisPic value to newly selected picture		document[imgField].src= myPix[thisPic];		//selects new image source from myPix array based on thisPic index		replaceText(index);							//updates text for newly selected pic	}}	function chgSlide(direction) {						//iterates through pics in main window starting from currently shown pic	if (document.images) {		thisPic = thisPic + direction				//new pic is either one up or one down in the array		if (thisPic > imgCt) {						//go to beginning if trying to go past the end			thisPic = 0		}		if (thisPic < 0) {							//go to end if trying to go back from the beginning			thisPic = imgCt		}		document.myPicture.src=myPix[thisPic]		//show this new pic in main window		replaceText(thisPic + 1);					//update text to go with this new picture	}}
