var categories = new Array('home','promotional','packaging','identity','publication','contact')var promotionalImages = new Array('promotional_1.gif','promotional_2.jpg','promotional_3.gif')var packagingImages = new Array('packaging_1.jpg','packaging_2.jpg','packaging_3.gif')var identityImages = new Array('identity_1.gif','identity_2.gif','identity_3.jpg')var publicationImages = new Array('publication_1.jpg','publication_2.jpg','publication_3.gif','publication_4.gif','publication_5.jpg')var homeCopy = new Array(  '')var promotionalCopy = new Array(  'Opera poster for &ldquo;Carmen&rdquo; (student project) &mdash; <strong><a href="http://www.cccewd.net/mediaarts/2006/" style="color: #2B2B2B;">Media Arts Award Winner</a></strong>.',  'Opera poster for &ldquo;Madama Butterfly&rdquo; (student project) &mdash; <strong><a href="http://www.cccewd.net/mediaarts/2006/" style="color: #2B2B2B;">Media Arts Award Winner</a></strong>.',  'Stained Glass exhibition advertisement (student project).')var packagingCopy = new Array(  'CD cover and disc art (student project).',  'Product packaging for &ldquo;HIM,&rdquo; a men&rsquo;s clothing store (student project) &mdash; <strong><a href="http://www.cccewd.net/mediaarts/2006/" style="color: #2B2B2B;">Media Arts Award Winner</a></strong>.',  'Product packaging for &ldquo;Decadent Delights Gourmet Truffles&rdquo; (student project).')var identityCopy = new Array(  'Various logos (student project).',  'Various logos, including <a href="http://www.sortingthingsout.com" style="color: #2B2B2B;" target="_blank">web site design</a> for &ldquo;SortingThings Out,&rdquo; personal organizing consultant',  'Stationery, business card and logo for &ldquo;Stillwaters,&rdquo; a retirement community (student project).')var publicationCopy = new Array(  '&ldquo;Stinger,&rdquo; book cover and <a href="http://www.silkroad.org" style="color: #2B2B2B;" target="_blank">web site design</a>.',  '2-page magazine spread (student project).',  '2-page magazine spread (student project).',  '&ldquo;Rise of Russia,&rdquo; book cover design (student project).',  'Puppet show brochure (student project).')var contactCopy = new Array(  'Phone: 650-728-0727&#160;&#160;&#160;&#160;&#160;&#160;Email: jsj@new-worlds.org<br/><br/><a style="color:#a6a6a6;" href="Resume_SV.pdf">Download resume (PDF)</a>')  if (document.images){  background1= new Image(800,626);   background1.src="images/common/page_a.gif";   background2= new Image(800,626);  background2.src="images/common/page_b.gif";  promotional1= new Image(402,574);   promotional1.src="images/promotional/promotional_1.gif";   promotional2= new Image(402,574);   promotional2.src="images/promotional/promotional_2.jpg";   	packaging1= new Image(666,574);   packaging1.src="images/packaging/packaging_1.jpg";   packaging2= new Image(666,574);   packaging2.src="images/packaging/packaging_2.jpg";   packaging3= new Image(666,574);   packaging3.src="images/packaging/packaging_3.gif";   	identity1= new Image(666,574);   identity1.src="images/identity/identity_1.gif";   identity2= new Image(320,440);   identity2.src="images/identity/identity_2.gif";   identity3= new Image(666,574);   identity3.src="images/identity/identity_3.jpg";   	publication1= new Image(666,574);   publication1.src="images/publication/publication_1.jpg";   publication2= new Image(668,575);   publication2.src="images/publication/publication_2.jpg";   publication3= new Image(666,574);   publication3.src="images/publication/publication_3.gif";   publication4= new Image(358,574);   publication4.src="images/publication/publication_4.gif";   publication5= new Image(358,574);   publication5.src="images/publication/publication_5.jpg"; }function swapMenuItems(id) {	  var featuredImageName = '';  if (id == 'promotional') featuredImageName = promotional1;  if (id == 'packaging') featuredImageName = packaging1;  if (id == 'identity') featuredImageName = identity1;  if (id == 'publication') featuredImageName = publication1;  if (id == 'home' || id == 'contact') {  	document.getElementById('background').src = background1.src;  }   else {    document.getElementById('background').src = background2.src;  }  document.getElementById(id).className = 'menu_item_selected';  document.getElementById('pagination_' + id).className = 'pagination_visible';  document.getElementById(id + 'Copy').className = 'copy_visible';  if (id == 'home' || id == 'contact') {    document.getElementById('featured_image').src = 'images/common/spacer.gif';	  }  else {    document.getElementById('featured_image').src = featuredImageName.src;	opacity('featured_image', 0, 100, 0);  }			    for (i = 0; i < categories.length; i++)  {    if (id != categories[i]) {      document.getElementById(categories[i]).className = 'menu_item_unselected';  	  document.getElementById('pagination_' + categories[i]).className = 'pagination_hidden';  	  document.getElementById(categories[i] + 'Copy').className = 'copy_hidden';    }  }}function paginate(id) {	alert(id);  var category=id.substr(0,id.indexOf('_'));			    var imageNumber=id.substr((id.indexOf('_') + 1),id.length);  var imageArray;  if (category == 'promotional') imageArray = promotionalImages;  if (category == 'packaging') imageArray = packagingImages;  if (category == 'identity') imageArray = identityImages;  if (category == 'publication') imageArray = publicationImages;  var copyArray;  if (category == 'promotional') copyArray = promotionalCopy;  if (category == 'packaging') copyArray = packagingCopy;  if (category == 'identity') copyArray = identityCopy;  if (category == 'publication') copyArray = publicationCopy;    var featuredImageName = '';  if (id == 'promotional') featuredImageName = promotional1;  if (id == 'packaging') featuredImageName = packaging1;  if (id == 'identity') featuredImageName = identity1;  if (id == 'publication') featuredImageName = publication1;  if (category == 'home' || category == 'contact') {  	document.getElementById('background').src = background1.src;    document.getElementById('featured_image').src = 'images/common/spacer.gif';	  }   else {    document.getElementById('background').src = background2.src;    document.getElementById('featured_image').src = featuredImageName.src;	opacity('featured_image', 0, 100, 0);  }  document.getElementById(category).className = 'menu_item_selected';  document.getElementById('pagination_' + category).className = 'pagination_visible';  document.getElementById(category + 'Copy').className = 'copy_visible';  for (i = 0; i < categories.length; i++)  {    if (category != categories[i]) {      document.getElementById(categories[i]).className = 'menu_item_unselected';  	  document.getElementById('pagination_' + categories[i]).className = 'pagination_hidden';  	  document.getElementById(categories[i] + 'Copy').className = 'copy_hidden';    }  }  document.getElementById(id).className = 'page_number_selected';  for (i = 0; i < imageArray.length; i++)  {    if (imageNumber != i) {      document.getElementById(category + '_' + i).className = 'page_number_unselected';			var imgName = category + (parseInt(imageNumber) + 1);			var imgSrc = "";			switch (imgName) {				case 'promotional1':				 imgName = promotional1;				 break;				case 'promotional2':				 imgName = promotional2;				 break;				case 'promotional3':				 imgName = promotional3;				 break;			}  	  document.getElementById(category + 'Copy').innerHTML = copyArray[imageNumber];	    opacity('featured_image', 0, 100, 0);    }  }}function getPage() {	var args = new Object();	var query = location.search.substring(6);	return query;}function setPage() {	var pageId=getPage(); 	if (pageId == '') { 		pageId='home'; 	}   	var category;  	var imageNumber;  	if (pageId.indexOf('_') == -1) {    	category=pageId;    	swapMenuItems(category);  	}  	else {    	paginate(pageId);  	}			  }function resetLocation(id) {	var temp = location + "";	if (temp.indexOf('?page=') != -1) {		temp = temp.substr(0,temp.indexOf('?page='));		location.href = temp +  '?page=' + id;	}	else {	  	location.href = location + '?page=' + id;	}}function getCopy(id) {    var copy = '';    if (id == 'homeCopy') copy = homeCopy[0];    if (id == 'promotionalCopy') copy = promotionalCopy[0];    if (id == 'packagingCopy') copy = packagingCopy[0];    if (id == 'identityCopy') copy = identityCopy[0];    if (id == 'publicationCopy') copy = publicationCopy[0];    if (id == 'contactCopy') copy = contactCopy[0];    document.write(copy);}function opacity(id, opacStart, opacEnd, millisec) {    //speed for each frame    var speed = Math.round(millisec / 100);    var timer = 0;    			    //determine the direction for the blending, if start and end are the same nothing happens    if(opacStart > opacEnd) {        for(i = opacStart; i >= opacEnd; i--) {            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));            timer++;        }    } else if(opacStart < opacEnd) {        for(i = opacStart; i <= opacEnd; i++)            {            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));            timer++;        }    }}//change the opacity for different browsersfunction changeOpac(opacity, id) {    var object = document.getElementById(id).style;    object.opacity = (opacity / 100);    object.MozOpacity = (opacity / 100);    object.KhtmlOpacity = (opacity / 100);    object.filter = "alpha(opacity=" + opacity + ")";} 		/*function slideshow() {	document.getElementById('slideshow_btn').style.visibility= 'hidden';	document.getElementById('slideshow_btn2').style.visibility= 'visible';	document.getElementById('background').src = background2.src;		var rate = 250;		setTimeout("document.getElementById('featured_image').src = promotional1.src",0);		setTimeout("opacity('featured_image', 0, 100, 500)",0);	setTimeout("document.getElementById('promotionalCopy').className = 'copy_visible'",rate);  for (i = 0; i < promotionalImages.length; i++)		setTimeout("document.getElementById('pagination_promotional').className = 'pagination_visible'",rate);		setTimeout("document.getElementById('home').className = 'menu_item_unselected'",rate);		setTimeout("document.getElementById('promotional').className = 'menu_item_selected'",rate);		setTimeout("opacity('featured_image', 100, 0, 500)",rate * 12);		setTimeout("document.getElementById('featured_image2').src = promotional2.src",rate * 12);		setTimeout("opacity('featured_image2', 0, 100, 500)",rate * 12);			setTimeout("document.getElementById('promotionalCopy').innerHTML = promotionalCopy[1]",(rate * 12) + rate);		setTimeout("document.getElementById('promotional_0').className = 'page_number_unselected'",(rate * 12) + rate);		setTimeout("document.getElementById('promotional_1').className = 'page_number_selected'",(rate * 12) + rate);			setTimeout("opacity('featured_image2', 100, 0, 500)",rate * 24);		setTimeout("document.getElementById('featured_image').src = packaging1.src",rate * 24);		setTimeout("opacity('featured_image', 0, 100, 500)",rate * 24);	setTimeout("document.getElementById('pagination_promotional').className = 'pagination_hidden'",6250);	setTimeout("document.getElementById('promotional').className = 'menu_item_unselected'",6250);	setTimeout("document.getElementById('promotionalCopy').className = 'copy_hidden'",6250);	setTimeout("document.getElementById('packaging').className = 'menu_item_selected'",6250);	setTimeout("document.getElementById('pagination_packaging').className = 'pagination_visible'",6250);	setTimeout("document.getElementById('packagingCopy').className = 'copy_visible'",6250);	setTimeout("document.getElementById('packagingCopy').innerHTML = packagingCopy[0]",6250);	setTimeout("opacity('featured_image', 100, 0, 500)",9000);	setTimeout("document.getElementById('featured_image2').src = packaging2.src",9000);	setTimeout("opacity('featured_image2', 0, 100, 500)",9000);	setTimeout("document.getElementById('packagingCopy').innerHTML = packagingCopy[1]",9250);	setTimeout("document.getElementById('packaging_0').className = 'page_number_unselected'",9250);	setTimeout("document.getElementById('packaging_1').className = 'page_number_selected'",9250);		setTimeout("opacity('featured_image2', 100, 0, 500)",12000);	setTimeout("document.getElementById('featured_image').src = packaging3.src",12000);	setTimeout("opacity('featured_image', 0, 100, 500)",12000);	setTimeout("document.getElementById('packagingCopy').innerHTML = packagingCopy[2]",12250);	setTimeout("document.getElementById('packaging_1').className = 'page_number_unselected'",12250);	setTimeout("document.getElementById('packaging_2').className = 'page_number_selected'",12250);		setTimeout("opacity('featured_image', 100, 0, 500)",15000);	setTimeout("document.getElementById('featured_image2').src = identity1.src",15000);	setTimeout("opacity('featured_image2', 0, 100, 500)",15000);	setTimeout("document.getElementById('pagination_packaging').className = 'pagination_hidden'",15250);	setTimeout("document.getElementById('packaging').className = 'menu_item_unselected'",15250);	setTimeout("document.getElementById('identity').className = 'menu_item_selected'",15250);	setTimeout("document.getElementById('packagingCopy').className = 'copy_hidden'",15250);	setTimeout("document.getElementById('pagination_identity').className = 'pagination_visible'",15250);	setTimeout("document.getElementById('identityCopy').className = 'copy_visible'",15250);	setTimeout("document.getElementById('identityCopy').innerHTML = identityCopy[0]",15250);		setTimeout("opacity('featured_image2', 100, 0, 500)",18000);	setTimeout("document.getElementById('featured_image').src = identity2.src",18000);	setTimeout("opacity('featured_image', 0, 100, 500)",18000);	setTimeout("document.getElementById('identityCopy').innerHTML = identityCopy[1]",18250);	setTimeout("document.getElementById('identity_0').className = 'page_number_unselected'",18250);	setTimeout("document.getElementById('identity_1').className = 'page_number_selected'",18250);		setTimeout("opacity('featured_image', 100, 0, 500)",21000);	setTimeout("document.getElementById('featured_image2').src = identity3.src",21000);	setTimeout("opacity('featured_image2', 0, 100, 500)",21000);	setTimeout("document.getElementById('identityCopy').innerHTML = identityCopy[2]",21250);	setTimeout("document.getElementById('identity_1').className = 'page_number_unselected'",21250);	setTimeout("document.getElementById('identity_2').className = 'page_number_selected'",21250);		setTimeout("opacity('featured_image2', 100, 0, 500)",24000);	setTimeout("document.getElementById('featured_image').src = identity4.src",24000);	setTimeout("opacity('featured_image', 0, 100, 500)",24000);	setTimeout("document.getElementById('identityCopy').innerHTML = identityCopy[3]",24250);	setTimeout("document.getElementById('identity_2').className = 'page_number_unselected'",24250);	setTimeout("document.getElementById('identity_3').className = 'page_number_selected'",24250);		setTimeout("opacity('featured_image', 100, 0, 500)",27000);	setTimeout("document.getElementById('featured_image2').src = publication1.src",27000);	setTimeout("opacity('featured_image2', 0, 100, 500)",27000);	setTimeout("document.getElementById('pagination_identity').className = 'pagination_hidden'",27250);	setTimeout("document.getElementById('identity').className = 'menu_item_unselected'",27250);	setTimeout("document.getElementById('publication').className = 'menu_item_selected'",27250);	setTimeout("document.getElementById('identityCopy').className = 'copy_hidden'",27250);	setTimeout("document.getElementById('pagination_publication').className = 'pagination_visible'",27250);	setTimeout("document.getElementById('publicationCopy').className = 'copy_visible'",27250);	setTimeout("document.getElementById('publicationCopy').innerHTML = publicationCopy[0]",27250);		setTimeout("opacity('featured_image2', 100, 0, 500)",30000);	setTimeout("document.getElementById('featured_image').src = publication2.src",30000);	setTimeout("opacity('featured_image', 0, 100, 500)",30000);	setTimeout("document.getElementById('publicationCopy').innerHTML = publicationCopy[1]",30250);	setTimeout("document.getElementById('publication_0').className = 'page_number_unselected'",30250);	setTimeout("document.getElementById('publication_1').className = 'page_number_selected'",30250);		setTimeout("opacity('featured_image', 100, 0, 500)",33000);	setTimeout("document.getElementById('featured_image2').src = publication3.src",33000);	setTimeout("opacity('featured_image2', 0, 100, 500)",33000);	setTimeout("document.getElementById('publicationCopy').innerHTML = publicationCopy[1]",33250);	setTimeout("document.getElementById('publication_1').className = 'page_number_unselected'",33250);	setTimeout("document.getElementById('publication_2').className = 'page_number_selected'",33250);		setTimeout("opacity('featured_image2', 100, 0, 500)",36000);	setTimeout("document.getElementById('featured_image').src = publication4.src",36000);	setTimeout("opacity('featured_image', 0, 100, 500)",36000);	setTimeout("document.getElementById('publicationCopy').innerHTML = publicationCopy[3]",36250);	setTimeout("document.getElementById('publication_2').className = 'page_number_unselected'",36250);	setTimeout("document.getElementById('publication_3').className = 'page_number_selected'",36250);	setTimeout("opacity('featured_image', 100, 0, 500)",39000);	setTimeout("document.getElementById('pagination_publication').className = 'pagination_hidden'",39500);	setTimeout("document.getElementById('publicationCopy').className = 'copy_hidden'",39500);	setTimeout("document.getElementById('publication').className = 'menu_item_unselected'",39500);	setTimeout("document.getElementById('contact').className = 'menu_item_selected'",39500);	//setTimeout("document.getElementById('background').src = background1.src;",39500);	//setTimeout("document.getElementById('contactCopy').className = 'copy_visible'",39500);	setTimeout("window.location.reload()",39500);}*/