// JavaScript Document


function changeImage (selectName) {

// function was passed the select object, the name of which is the image it refers to + "_type"
// parse the the select name and get the image name
		which = selectName.name;
		whichImage = which.substring(0, which.length - 5);

// use the image name to access the filename of the image and assign it to imageSrc
		imageToChange = document[whichImage];
		imageSrc = imageToChange.src;

// Find out the requested image by the user and give vOrC the proper value
		if (selectName.value == "v-shaped") vOrC = "v";
		else if (selectName.value == "curved") vOrC = "c";
		
// concatenate the new image file name and assign it to the object in the DOM
		newImageSrc = imageSrc.substring(0, imageSrc.length - 8)+vOrC+"_tn.jpg";
		document[whichImage].src = newImageSrc;
}

function popUp (imageName) {

// function was passed the id of the image

	newPage = window.open("", "", "height=300, width=718, left=20, top=20, scrolling=no");

	newPage.document.writeln("<HTML>");
	newPage.document.writeln("<HEAD>");
	newPage.document.writeln("<TITLE>");
	newPage.document.write("MagKnit -- The necklace clasp that turns knitting into fashion jewelry");
	newPage.document.writeln("</TITLE>");
	newPage.document.writeln("</HEAD>");

	newPage.document.writeln("<body marginwidth='0' marginheight='0' leftmargin='0' rightmargin='0' topmargin='0' bottommargin='0'>");
	newPage.document.writeln("<table border='0' cellspacing='0' cellpadding='0' width='100%' height='100%'>");
	newPage.document.writeln("<tr>");
	newPage.document.writeln("<td><img src='images/rtw_"+imageName+".jpg'></td>");
	newPage.document.writeln("</tr>");
	newPage.document.writeln("</table>");
	newPage.document.writeln("        <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-221095-11");
pageTracker._trackPageview();
} catch(err) {}</script>
      </body>");
	newPage.document.writeln("</html>");

	newPage.document.close();
}

