currently_persisted = new Array();

function persist(which_item) {
	
	/*

	if(document.images) {
		
		for(imageObject in document.images) {

			if(document.images[imageObject].name == which_item) {
	
				currently_persisted.push(document.images[imageObject].name);
	
				break;
	
			}
		
		}

	} else if(document.all) {
		
		for(imageObject in document.all) {

			if(document.all[imageObject].name == which_item) {
	
				currently_persisted.push(document.all[imageObject].name);
	
				break;
	
			}
		
		}
		
	}
	
	*/
	
	currently_persisted.push(which_item);

}

function swapImage(which_item, image_url) {

	if(!in_array(which_item, currently_persisted)) {
/*		
		if(document.images) {
			
			for(imageObject in document.images) {
	
				if(document.images[imageObject].name == which_item) {
		
					document.images[imageObject].src=image_url;
		
					break;
		
				}
			
			}
	
		} else if(document.all) {
			
			for(imageObject in document.all) {
	
				if(document.all[imageObject].name == which_item) {
		
					document.all[imageObject].src=image_url;
		
					break;
		
				}
			
			}
			
		}	
*/	

	document.images[which_item].src=image_url
	
	}

}

function getCurrentPage() {

	return parent.main.location;

}

function in_array(needle, haystack) {

	for (var i = 0; i < haystack.length; i++) if (haystack[i] == needle) return true;

	return false;

}