// This source code is copyrighted 2005
// by The Sea-Monkey Uncle giovanni@cardona.com
//
// Setting global variables
	var nCurrentPage = 0;
	var nMaxItemsPerPage = 3;
	var nProductIndex = 1;
	var bIsPostBack = false;  //detect first time, default false
	var oAmazon = new Object();
	
	oAmazon.sPrdASIN = new Array();

	// Products Initialization... minimum 3
	oAmazon.sPrdASIN[0] = "B0002E7MP0";
	oAmazon.sPrdASIN[1] = "B00005YWOB";
	oAmazon.sPrdASIN[2] = "B00000ISKD";
	oAmazon.sPrdASIN[3] = "B00000ISQ6";
	oAmazon.sPrdASIN[4] = "1931090688";
	oAmazon.sPrdASIN[5] = "B00004UDP6";
	oAmazon.sPrdASIN[6] = "0689808151";
	oAmazon.sPrdASIN[7] = "0070185778";
	oAmazon.sPrdASIN[8] = "B00004Y5U1";
	oAmazon.sPrdASIN[9] = "B00005JM02";		
	
	// Languages definitions for this page
	oLanguage[nENGLISH].kitComments[0] = "This is so cool! At last, Sea-Monkey action figures!";
	oLanguage[nENGLISH].kitComments[1] = "Great for a gift. The 'classic' Sea-Monkey basic kit. Includes everything for a perfect start.";
	oLanguage[nENGLISH].kitComments[2] = "Complete kit that also includes 'Light Up / Aquarium Cover' (2 triple A battery not included) also includes the 'Plasma' packet.";
	oLanguage[nENGLISH].kitComments[3] = "Different from the classic Sea-Monkey tanks with a cool castle inside. Includes the packet of 'Plasma' and an 'Aqua-Leash'. ";
	oLanguage[nENGLISH].kitComments[4] = "The Sea-Monkey Lady tells everything you wanted to know, but were afraid to ask.";	
	oLanguage[nENGLISH].kitComments[5] = "'Space Shuttle' tank with integrated toy, light & areation pump. Looks great in any room!.";	
	oLanguage[nENGLISH].kitComments[6] = "Basic kit with a cool Nickelodeon book... perfect for the little 'scientist'.";	
	oLanguage[nENGLISH].kitComments[7] = "The name says it all!";
	oLanguage[nENGLISH].kitComments[8] = "This tank can help them to enjoy more any light source. Also those sparkling Sea-Diamonds drive them nuts!.";	
	oLanguage[nENGLISH].kitComments[9] = "This is a great animated movie. Don't miss this... Dory also makes a Sea-Monkey joke :)";
//
function WriteAmazonProduct(sProductID, sBGColor, sFGColor, sLKColor)
{
	if (sProductID == null)
		sProductID = "B00005YWOB";
		
	if (sBGColor == null)
		sBGColor = "0040a0";

	if (sFGColor == null)
		sFGColor = "ffffff";

	if (sLKColor == null)
		sLKColor = "ccff66";				
		
		
	// this will write Amazon's individual product search
	sIFrameString = "<iframe marginwidth = '0' marginheight = '0' width = '120' height = '240' scrolling = 'no' frameborder = '0' src = 'http://rcm.amazon.com/e/cm?o=1&l=as1&f=ifr&t=theseamonkeypage&p=8&asins="+sProductID+"&IS2=1&bg1="+sBGColor+"&fc1="+sFGColor+"&lc1="+sLKColor+"&bc1="+sBGColor+"&IS2=1&lt1=_blank'><MAP NAME = 'boxmap-p8'><AREA SHAPE= 'RECT' COORDS = '14, 200, 103, 207' HREF = 'http://rcm.amazon.com/e/cm/privacy-policy.html?o=1'><AREA COORDS = '0,0,10000,10000' HREF = 'http://www.amazon.com/exec/obidos/redirect-home/theseamonkeypage'></MAP><img src = 'http://rcm-images.amazon.com/images/G/01/rcm/120x240.gif' width = '120' height = '240' border = '0' usemap = '#boxmap-p8' alt = 'Shop at Amazon.com'></iframe>";
	return sIFrameString;
}
//
function DrawNavigation()
{
	// working around browsers issues... damn
	if (isIE6CSS || isIE4)
	{
		document.write("<p align='center' style='font-size:14pt;'>");
		document.write("<span id = 'BackLink' onclick = 'RotateAmazonProducts(false);' style = 'cursor:hand; color:yellow; font-weight: bold;'>");
		document.write("&lt;&lt;&lt;&nbsp;<span style='font-size:8pt;'>(back)</span></span>");
		document.write("&nbsp;");
		document.write("Navigate");
		document.write("&nbsp;");
		document.write("<span id = 'ForwardLink' onclick = 'RotateAmazonProducts(true);' style = 'cursor:hand; color:yellow; font-weight: bold;'>");
		document.write("<span style='font-size:8pt;'>(forward)</span>&nbsp;&gt;&gt;&gt;</span>");
		document.write("</p>");
	
		RotateAmazonProducts(true);
	}
	else
	{
		BigAmazonDisplay();
	}
}
function RotateAmazonProducts(bNavigate)
{
	var oNext = getObject("ForwardLink");
	var oPrev = getObject("BackLink");

	//do not check first time...
	if (bIsPostBack)
	{
		//default navigation is forward
		if (bNavigate == null)
			bNavigate = true;
	
		//avoid invalid navigation
		if (bNavigate)
		{
			if ((nProductIndex+(nMaxItemsPerPage-1)) >=  oAmazon.sPrdASIN.length)
			{
				//do not allow to browse beyond the available products
				oNext.cursor = "";	
				oNext.color = "gray";						
				return true;
			}
		
			nProductIndex++;
			oPrev.cursor = "hand";
			oPrev.color = "yellow";							
		}
		else
		{
			nProductIndex--;
			oNext.cursor = "hand";
			oNext.color = "yellow";
				
			if (nProductIndex < 1)
			{
				nProductIndex = 1;
				oPrev.cursor = "";
				oPrev.color = "gray";						
				return true;
			}
		}
	}
	else
	{
		bIsPostBack = true;
	}		
	// rotate
	for (nCounter = 1; nCounter <= nMaxItemsPerPage; nCounter++)
	{
		nDisplayKit = ((nProductIndex-1)+(nCounter-1));

		eval("oItem = getRawObject(\"ITEM" + nCounter + "\");");
		eval("oComments = getRawObject(\"COMMENTS" + nCounter + "\");");
		eval("oItem.innerHTML = WriteAmazonProduct('" + oAmazon.sPrdASIN[nDisplayKit] + "');");
		eval("oComments.innerText = \"" + oLanguage[nSelectedLanguage].kitComments[nDisplayKit] + "\";");			

	}
}
function BigAmazonDisplay()
{
	document.write("<iframe marginwidth='0' marginheight='0' width='468' height='336' scrolling='no' frameborder='0' src='http://rcm.amazon.com/e/cm?t=theseamonkeypage&l=st1&search=sea-monkey&mode=toys&p=16&o=1&bg1=0040a0&fc1=eeeeee&lc1=ccff66&lt1=_blank&f=ifr'>");
	document.write("<MAP NAME='boxmap-p16'><AREA SHAPE='RECT' COORDS='10, 322, 100, 329' HREF='http://rcm.amazon.com/e/cm/privacy-policy.html?o=1' target=main>");
	document.write("<AREA COORDS='0,0,10000,10000' HREF='http://www.amazon.com/exec/obidos/redirect-home/theseamonkeypage' target=main></MAP>");
	document.write("<img src='http://rcm-images.amazon.com/images/G/01/rcm/468x336.gif' width='468' height='336' border='0' usemap='#boxmap-p16' alt='Shop at Amazon.com'>");
	document.write("</iframe>");
}

function WriteSmallScienceStoreBanner()
{
	return true;
}

function WriteBigeBayDisplay()
{
	document.write("<p align='center'><script language='JavaScript' src='http:\/\/lapi.ebay.com\/ws\/eBayISAPI.dll?EKServer&ai=mv%7eqva%21t*%26+&bdrcolor=666666&cid=0&eksize=1&encode=ISO-8859-1&endcolor=FF7777&endtime=y&fbgcolor=000055&fntcolor=ffffff&fs=0&hdrcolor=0040a0&hdrimage=4&hdrsrch=y&height=120&img=y&lnkcolor=ccff66&logo=6&num=3&numbid=n&paypal=y&popup=y&prvd=1&query=%22sea+monke*%22&r0=3&shipcost=n&siteid=0&sort=MetaEndSort&sortby=endtime&sortdir=asc&srchdesc=n&tbgcolor=0040a0&title=SEARCH+FOR+SEA+MONKEYS&reg;+ON+eBAY&tlecolor=4E4EC6&tlefs=1&tlfcolor=FFFFFF&track=1764569&width=468'><\/script><\/p>");
}

function WriteeBayVBanner(keyw)
{
	if (keyw == null) keyw = "%22sea+monke*%22";
	document.write("<p align='center'><script language='JavaScript' src='http:\/\/lapi.ebay.com\/ws\/eBayISAPI.dll?EKServer&ai=mv%7eqva%21t*%26+&bdrcolor=666666&cid=0&eksize=11&encode=ISO-8859-1&endcolor=FF7777&endtime=y&fbgcolor=000055&fntcolor=ffffff&fs=0&gallery=y&hdrcolor=0040a0&hdrimage=4&hdrsrch=y&height=&img=y&lnkcolor=ccff66&logo=6&num=3&numbid=n&paypal=n&popup=y&prvd=1&query="+keyw+"&r0=4&shipcost=n&siteid=0&sort=MetaEndSort&sortby=endtime&sortdir=asc&srchdesc=n&tbgcolor=0040a0&title=&tlecolor=4E4EC6&tlefs=1&tlfcolor=FFFFFF&track=1764569&width='><\/script><\/p>");
}