	imgGallery = new Array("images/1nails.jpg", "images/2nails.jpg", "images/3nails.jpg", "images/4nails.jpg", "images/5nails.jpg", "images/6nails.jpg", "images/7nails.jpg", "images/8nails.jpg", "images/9nails.jpg", "images/12nails.jpg", "images/14nails.jpg", "images/15nails.jpg", "images/16nails.jpg", "images/17nails.jpg", "images/18nails.jpg", "images/20nails.jpg", "images/21nails.jpg", "images/22nails.jpg", "images/24nails.jpg", "images/25nails.jpg", "images/26nails.jpg", "images/27nails.jpg", "images/28nails.jpg");
	thisPic = 0;
	imgCt = imgGallery.length - 1;	
	varShowPlate = 0;
	
	function winHeight() 
	{
		winHeight = 0; 
		if (screen) 
		{
			winHeight = screen.height - 60;
		} 
		else 
		{
			winHeight = 400;
		}
		return winHeight;
	}

	
	function showPlate(intPlate)
	{
		clearTimeout(varShowPlate);
		parent.slideshow.document.plate.src = "images/" + intPlate + "nails.jpg";
		parent.slideshow.document.slides.label.value = "M" + intPlate;		
	}
	
	function platePage(intPlate)
	{
		myWindow = open("", "", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=450, height=" + winHeight());
		myWindow.document.write("<html><head><title>Plate M" + intPlate + "</title><script language='JavaScript' src='script.js'></script><link href='styles.css' rel='stylesheet' type='text/css'/></head><body><div><img src='images/"+ intPlate + "plate.jpeg' height='800' width='400'/><br/><a href='javascript:window.close()'>Close</a></div></body></html>");	
		return true;
	}
	
	function template()
	{
		/*if (parent.slideshow.document.plate && document.images)
		{
			if (parent.slideshow.document.plate.complete)
			{
				thisPic++;
				if (thisPic > imgCt) thisPic = 0;
				parent.slideshow.document.plate.src = imgGallery[thisPic];
				parent.slideshow.document.slides.label.value = "M" + parseInt(imgGallery[thisPic].substring(7,10));
			}
			varShowPlate = self.setTimeout('template()', 3*1000);
		}*/
	}
	
	function GetTotal()
	{
		$intTotal = 0;
		$intCount = 0;
		$message = "";
		for (i = 0; i < parent.templates.document.plates.elements.length; i++)
		{
			if (parent.templates.document.plates.elements[i].name.substring(0,2) == "p[")
			{
				$intCount = parent.templates.document.plates.elements[i].selectedIndex;
				$intTotal += $intCount;	
			}
		}
		parent.slideshow.document.slides.numberPlates.value = $intTotal;
		$nPlates = parent.templates.document.plates.nPlates.value;
		if ($intTotal < $nPlates) 
		{
			$t = $nPlates - $intTotal;
			$message = "You need to choose " + $t + " more plate";
			if ($t > 1) $message += "s";
			$message += ". ";
			$intTotal = 0;
		}
		else 
		{
			$intTotal -= $nPlates;
			if ($nPlates > 0) $message = "Extra ";
			$message += "Plates are $A12.00 each.";
		}
		$intTotal = $intTotal * 12;
		parent.slideshow.document.slides.message.value = $message;
		parent.slideshow.document.slides.totalCharge.value = "$" + $intTotal + ".00";
	}
	
	function GetPolish()
	{
		$intSTotal = 0;
		$intLTotal = 0;
		$intCount = 0;
		$message = "";
		for (i = 0; i < parent.main.document.polish.elements.length; i++)
		{
			if (parent.main.document.polish.elements[i].name.substring(0,2) == "p[")
			{
				$intCount = parent.main.document.polish.elements[i].selectedIndex;
				$name = parent.main.document.polish.elements[i].name;
				if ($name.substring(2, ($name.length - 1)) <= 70) $intSTotal += $intCount;	
				else $intLTotal += $intCount;
			}
		}
		parent.slideshow.document.slides.numberSmall.value = $intSTotal;
		//parent.slideshow.document.slides.numberLarge.value = $intLTotal;
		$nPolishS = parent.main.document.polish.nPolishS.value;
		//$nPolishL = parent.main.document.polish.nPolishL.value;
		if ($intSTotal < $nPolishS) 
		{
			$t = $nPolishS - $intSTotal;
			$message += "You need to choose " + $t + " more small nail polish";
			if ($t > 1) $message += "es";
			$message += ". ";
			$intSTotal = 0;
		}
		else 
		{
			$intSTotal -= $nPolishS;
			if ($nPolishS > 0) $message = "Extra ";
			$message += "Small Nail Polish are $A4.50 each. ";
		}
		$intSTotal = $intSTotal * 4.5;
		parent.slideshow.document.slides.totalSmall.value = "$" + currency($intSTotal);
		
		/*if ($intLTotal < $nPolishL) 
		{
			$t = $nPolishL - $intLTotal;
			$message += "You need to choose " + $t + " more large nail polish";
			if ($t > 1) $message += "es";
			$message += ". ";
			$intLTotal = 0;
		}
		else 
		{
			$intLTotal -= $nPolishL;
			if ($nPolishL > 0) $message = "Extra ";
			$message += "Large Nail Polish are $A8.00 each.";
		}
		$intLTotal = $intLTotal * 8;*/
		parent.slideshow.document.slides.message.value = $message;
		//parent.slideshow.document.slides.totalLarge.value = "$" + currency($intLTotal);
		parent.slideshow.document.slides.totalCharge.value = "$" + currency(eval($intSTotal));
	}
	
	function currency(dollar)
	{
		myString = new String(dollar)

		if (myString.charAt(myString.length-2) == ".") myString = myString + "0";
		else myString = myString + ".00";
		return myString;
	}