// functions
function MM_preloadImages() { //v2.0
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}

function FindGroup(grp, imageName) {
	var img = FWFindImage(document, imageName, 0);
	if (!img) return(false);
	var docGroup = eval("document.FWG_"+grp);
	if (!docGroup) {
		docGroup = new Object;
		eval("document.FWG_"+grp+" = docGroup");
		docGroup.theImages = new Array;
	}
	if (img) {
		var i;
		for (i=0; i<docGroup.theImages.length; i++) {
			if (docGroup.theImages[i] == img) break;
		}
		docGroup.theImages[i] = img; 
		if (!img.atRestSrc) {
			img.atRestSrc = img.src;
			img.initialSrc = img.src;
		}
	}
	return(docGroup);
}

function FWFindImage(doc, name, j)
{
	var theImage=false;
	if (doc.images) {
		theImage = doc.images[name];
	}
	if (theImage) return theImage;
	if (doc.layers) {
		for (j=0; j<doc.layers.length; j++) {
			theImage = FWFindImage(doc.layers[j].document, name, 0);
			if (theImage) return(theImage);
		}
	}
	return(false);
}

function GrpRestore(grp){
	var docGroup = eval("document.FWG_"+grp);if (!docGroup) return;
	theImages = docGroup.theImages;
	if (theImages) {
		for (i=0; i<theImages.length; i++) {
			var curImg = theImages[i];
			if (curImg.atRestSrc) {
				curImg.src = curImg.atRestSrc;
			}
		}
	}
}

function GrpSwap(grp){
	var i,j=0,newSrc,objName;
	var docGroup = false;
	for (i=1; i < (GrpSwap.arguments.length-1); i+=2) {
		objName = GrpSwap.arguments[i];
		newSrc = GrpSwap.arguments[i+1];
		docGroup = FindGroup(grp, objName);
		if (!docGroup) continue;
		obj = FWFindImage(document,objName,0);
		if (!obj) continue;
		if (obj.isDown) {
			if (obj.downOver) { 
				obj.src = obj.downOver;
			}
		} else {
			obj.src = newSrc;
			obj.atRestSrc = obj.initialSrc;
		}
		obj.skipMe = true;
		j++;
	}
	if (!docGroup) return;
	theImages = docGroup.theImages;
	if (theImages) {
		for (i=0; i<theImages.length; i++) {
			var curImg = theImages[i];
			if (curImg.atRestSrc && !curImg.skipMe) {
				curImg.src = curImg.atRestSrc;
			}
			curImg.skipMe = false;
		}
	}
}

function teloover() { 
 GrpSwap('telo','telotext','i/t-t-tx.gif','t1','i/t1t.gif','t2','i/t2t.gif','t3','i/t3t.gif','t4','i/t4t.gif','t5','i/t5t.gif','t6','i/t6t.gif','t7','i/t7t.gif','t8','i/t8t.gif','t9','i/t9t.gif');
 document.getElementById('bodydiv').style.display='';
 document.getElementById('cleandiv').style.display='none';
 document.getElementById('facediv').style.display='none';
 document.getElementById('sundiv').style.display='none';
}

function licoover() {
 GrpSwap('lico','licotext','i/l-t-tx.gif','t1','i/t1l.gif','t2','i/t2l.gif','t3','i/t3l.gif','t4','i/t4l.gif','t5','i/t5l.gif','t6','i/t6l.gif','t7','i/t7l.gif','t8','i/t8l.gif','t9','i/t9l.gif');
 document.getElementById('facediv').style.display='';
 document.getElementById('cleandiv').style.display='none';
 document.getElementById('bodydiv').style.display='none';
 document.getElementById('sundiv').style.display='none';
}

function sunover() {
 GrpSwap('sun','suntext','i/s-t-tx.gif','t1','i/t1s.gif','t2','i/t2s.gif','t3','i/t3s.gif','t4','i/t4s.gif','t5','i/t5s.gif','t6','i/t6s.gif','t7','i/t7s.gif','t8','i/t8s.gif','t9','i/t9s.gif');
 document.getElementById('sundiv').style.display='';
 document.getElementById('cleandiv').style.display='none';
 document.getElementById('bodydiv').style.display='none';
 document.getElementById('facediv').style.display='none';
}

function cleanover() {
// GrpSwap('clean','cleantext','i/c-t-tx.gif','t1','i/t1c.gif','t2','i/t2c.gif','t3','i/t3c.gif','t4','i/t4c.gif','t5','i/t5c.gif','t6','i/t6c.gif','t7','i/t7c.gif','t8','i/t8c.gif','t9','i/t9c.gif');
 document.getElementById('cleandiv').style.display='';
 document.getElementById('sundiv').style.display='none';
 document.getElementById('bodydiv').style.display='none';
 document.getElementById('facediv').style.display='none';
}
// out
function teloout() { 
 GrpRestore('telo'); 
}

function licoout() {
GrpRestore('lico'); 
}

function sunout() {
 GrpRestore('sun'); 
}

function cleanout() {
 GrpRestore('clean'); 
}

