function whichPopup() {
	var pageLoc = document.location.href;
	var pageUrl = pageLoc.substring(pageLoc.lastIndexOf("/",pageLoc.length-1)+1,pageLoc.length);
	var pageName = pageUrl.substring(0,pageUrl.indexOf(".html"));
	//
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0' width='490' height='372'>");
	document.write("<param name='movie' value='loadImage.swf?name=" + pageName + "' />"); 
	document.write("<!--[if !IE]> <-->");
	document.write("<object data='loadImage.swf?name=" + pageName + "' width='490' height='372' type='application/x-shockwave-flash'> ");
	document.write("<param name='pluginurl' value='http://www.macromedia.com/go/getflashplayer' />");
	document.write("<img src='images/" + pageName + ".jpg' alt='' />");
	document.write("</object>");
	document.write("<!--> <![endif]-->");
	document.write("</object>");
}

function showLinks(pLink,pText,numImages) {
	var pLink_arr = new Array();
	var pText_arr = new Array();
	for (var x=0; x<numImages; x++) {
		if (numImages - x != 1) {
			pLink_arr[x] = pLink.substring(0,pLink.indexOf(","));
			pText_arr[x] = pText.substring(0,pText.indexOf(","));
			pLink = pLink.substring(pLink.indexOf(",")+1,pLink.length);
			pText = pText.substring(pText.indexOf(",")+1,pText.length);
		}
		else {
			pLink_arr[x] = pLink;
			pText_arr[x] = pText;
		}
	}
	//
	for (var y=0; y<pLink_arr.length; y++) {
		document.getElementById('links').innerHTML += "<a href=\'javascript:changeImage(\"" + pLink_arr[y] + "\")" + "\'>" + pText_arr[y] + "</a>";
	}
}


function changeImage(pLink) {
	document.imgMovie.SetVariable("newImage",pLink);
	document.imgMovie.Play();
	//alert("running...");
	//window.document.imgMovie.Play();
}
