//auto generates by VisitVancouver.bc.ca
var storeName='E-Store is administered by VisitVancouver.bc.ca';
var mainPage='intro.html';
var totalItems=37;
var ir = new Array(totalItems);
var mAlignStr='<Center>';
A(0, '4', 'A Bear Claw Pendant Kit', 25.99, 'NATIVE INDIAN JEWELLERY KITSBead ColorBlueRed');
A(1, '6', 'A Dreamcatcher Keychain Kit', 21.99, 'NATIVE INDIAN JEWELLERY KITS');
A(2, '7', 'A Dreamcatcher Kit', 29.99, 'NATIVE INDIAN JEWELLERY KITS');
A(3, '8', 'A Killer Whale Art Cloth ', 25.99, 'NATIVE ART CLOTHS');
A(4, '31', 'A Native Indian designed mask', 44.00, 'TOTEM POLES, MASKS AND TRINKET BOXES');
A(5, '9', 'A Raven Art Cloth', 25.99, 'NATIVE ART CLOTHS');
A(6, '12', 'A Salmon Art Cloth', 25.99, 'NATIVE ART CLOTHS');
A(7, '10', 'A Seal Art Cloth', 25.99, 'NATIVE ART CLOTHS');
A(8, '16', 'A Special Collector spoon (Bear Head Top and Beaver Tail bowl)', 29.99, 'NATIVE SPOONS AND CERAMIC TRIVETS');
A(9, '17', 'A Special Collector spoon (Thunderbird top with scultured bowl)', 29.99, 'NATIVE SPOONS AND CERAMIC TRIVETS');
A(10, '18', 'A Special Collector Spoon (Winged Raven totem pole)', 29.99, 'NATIVE SPOONS AND CERAMIC TRIVETS');
A(11, '11', 'A Thunderbird Art Cloth', 25.99, 'NATIVE ART CLOTHS');
A(12, '20', 'A trivet with the Native Bear Head image', 17.99, 'NATIVE SPOONS AND CERAMIC TRIVETS');
A(13, '21', 'A trivet with the Native Eagle Head image', 17.99, 'NATIVE SPOONS AND CERAMIC TRIVETS');
A(14, '23', 'A trivet with the Native Raven image', 17.99, 'NATIVE SPOONS AND CERAMIC TRIVETS');
A(15, '19', 'A trivet with the Native Thunderbird image', 17.99, 'NATIVE SPOONS AND CERAMIC TRIVETS');
A(16, '22', 'A trivet with the Native Whale image', 17.99, 'NATIVE SPOONS AND CERAMIC TRIVETS');
A(17, '1', 'An Arrowhead Pendant Kit', 25.99, 'NATIVE INDIAN JEWELLERY KITS');
A(18, '33', 'Canada Flag Ball Set', 23.99, 'GOLF BALL SETSBallsGolf Set OnlySet & 3 Extra Balls');
A(19, '36', 'Canada Golf Ball Set with a Moose emblem', 23.99, 'GOLF BALL SETSBallsGolf Set OnlySet & 3 Extra Balls');
A(20, '35', 'Canada Golf Ball Set with Killer Whale emblem', 23.99, 'GOLF BALL SETSBallsGolf Set OnlySet & 3 Extra Balls');
A(21, '25', 'Dark totem poles', 30.99, 'TOTEM POLES, MASKS AND TRINKET BOXESSizes13"16"9"');
A(22, '5', 'Dreamcatcher Earring Kit', 25.99, 'NATIVE INDIAN JEWELLERY KITS');
A(23, '3', 'Eagle Claw Pendant Kit', 25.99, 'NATIVE INDIAN JEWELLERY KITSBead ColorBlueRed');
A(24, '27', 'Eagle-Bear-Whale totem pole in red or yellow cedar wood', 160.00, 'TOTEM POLES, MASKS AND TRINKET BOXESSize and Wood12" Red Cedar Wood12" Yellow Cedar Wood21" Red Cedar Wood21" Yellow Cedar Wood');
A(25, '28', 'Eagle-Raven-Box of Light totem pole in red/yellow cedar wood', 160.00, 'TOTEM POLES, MASKS AND TRINKET BOXESSize and Wood12" Red Cedar Wood12" Yellow Cedar Wood21" Red Cedar Wood21" Yellow Cedar Wood');
A(26, '37', 'Embroidered caps with the Canadian motif', 24.99, 'EMBROIDERED CAPSColorNavy/RedNavy/WhiteRedWhite/Red');
A(27, '24', 'Hand painted colored totem poles', 30.99, 'TOTEM POLES, MASKS AND TRINKET BOXESSizes10.5"13"9"');
A(28, '15', 'Hand painted totem spoon series', 23.99, 'NATIVE SPOONS AND CERAMIC TRIVETSStyleBear HeadBeaver MaskBeaver PoleOrca WhaleRavenTall TotemTotem Pole');
A(29, '32', 'Maple Leaf Golf Ball Set', 23.99, 'GOLF BALL SETSBallsGolf Set OnlySet & 3 Extra Balls');
A(30, '34', 'Maple Leaf with Canada inscriptions Golf Ball Set', 23.99, 'GOLF BALL SETSBallsGolf Set OnlySet & 3 Extra Balls');
A(31, '29', 'Native Designed trinket boxes', 31.99, 'TOTEM POLES, MASKS AND TRINKET BOXESStyleFishRoundSquare');
A(32, '30', 'Native Designed Whale trinket box', 37.99, 'TOTEM POLES, MASKS AND TRINKET BOXES');
A(33, '2', 'Pony Bead Bracelet Kit', 25.99, 'NATIVE INDIAN JEWELLERY KITS');
A(34, '13', 'The Story Of The Eagle Art Cloth', 25.99, 'NATIVE ART CLOTHS');
A(35, '14', 'The Story Of The Killer Whale Art Cloth', 25.99, 'NATIVE ART CLOTHS');
A(36, '26', 'Three  hand painted totem poles on a platform', 52.99, 'TOTEM POLES, MASKS AND TRINKET BOXES');
function A(i, id, s, p, c)
{
	ir[i] = new RECORD();
	ir[i].itemID = id; 
	ir[i].catalog=c;
	ir[i].itemName = s; 
	ir[i].price = p;
}

function MakeArray(n) {
      this.length = n;
      for(var i = 0; i < n; i++){
            this[i] = 0;
      }
      return this;
}

function Currency(money)
{
	money =  parseFloat(money);
	money += 0.005;
	money +=  "";           
	var monLen = money.length;
	var digPos = money.indexOf(".");
	if(digPos == -1) {
		if (money <=0) {
			money ="0.00";
		} else {
			money += ".00";
		}
		return money;
	} else {
		if (digPos + 3 > monLen) {
			money += "0";
		} else if (digPos + 3 != monLen) {
			money = money.substring(0, digPos+3);
		} 
		return money;
	}     
}
function RECORD()
{
	this.itemID = 0;
	this.itemName="";
	this.price=0;
	this.match=0;
	this.catalog="";
	return this;
}



function CompareMatch(a, b) {
   return a.match < b.match;
}

function Search()
{
	Search_Start(parent.frames["cart"].document.forms[0]);
}

function NewSearch(theForm)
{
	Search_Start(theForm);
}


function Search_Start(theForm)
{
	var searchStr = theForm.keywords.value;
	searchStr=searchStr.toLowerCase();
	var space = " ";
	var searchWords = searchStr.split(space);

	searchWords.sort();
	var searchStart =0;
	for (var i=0; i < searchWords.length; i++) {
		if (searchWords[i].length == 0) {
			searchStart++;
		} else {
			break;
		}
	}
	var totalSearchWord = searchWords.length - searchStart;
	if (totalSearchWord <= 0) {
		return;
	}
	var totalFound=0;
	var j;

	for (j=0;j<totalItems;j++) {
		var totalMatch=0;
		var str = ir[j].itemName.toLowerCase();
		var sid=ir[j].itemID.toLowerCase();
		var c= ir[j].catalog.toLowerCase();
		for (var i=searchStart; i < searchWords.length; i++) {
			if (str.search(searchWords[i])>=0) totalMatch++; 
			else 
			if (c.search(searchWords[i])>=0) totalMatch++; 
			else 
			if (sid.search(searchWords[i])>=0) totalMatch++; 
		}
		if (totalMatch>0) totalFound++;
		ir[j].match=totalMatch;
	}
	ir.sort(CompareMatch);
	
	var cWin=parent.frames["shop"].document;
	
	cWin.open();
	cWin.write("<HTML><HEAD><TITLE> Shopping Cart Viewer</TITLE></HEAD>");
	cWin.write("<BODY BACKGROUND='"+parent.mCartBGImage+"' Text='"+parent.mCartText+"' BGCOLOR='"+parent.mCartBGColor+"' LINK='"+parent.mCartALink+"' VLINK='"+parent.mCartLink+"'  ALINK='"+parent.mCartALink+"' valign=top>");
	cWin.write(" "+mAlignStr+"<TABLE width=600 border=1 CELLSPACING=0 CELLPADDING=0>");
	cWin.write("<tr><td width=600 bgcolor=#666699 height=24><p align='center'><big><font color=#FFFFFF size=6><strong>"+parent.storeName+"</strong></font></big></td></tr>");
	cWin.write("<tr><td width=600 bgcolor=#ffffff><font color=#333333 size=2><strong>SECURE SERVER PROCESSING:<font color=#FF6600> Our Guarantee.</strong><BLOCKQUOTE><font color=#333333 size=2>"+parent.storeContactAddress+"</font></td></tr>");
	cWin.write("<tr><td width=600 bgcolor=#666699><center><Strong><font color=#ffffff>Search results are as shown in the following table:["+totalFound+"]</td></tr>");
	cWin.write("<tr><td width=600>");
	cWin.write("<TABLE width=600 border=2 CELLSPACING=0 CELLPADDING=0>");
	cWin.write("<tr bgcolor='"+parent.mCartTableHeaderBGColor+"'><td width=10%><b><strong><font size=2 color='"+parent.mCartTableHeaderColor+"'><center>Match#</center></td><td width=10%><b><strong><font size=2 color='"+parent.mCartTableHeaderColor+"'><center>ItemID</center></td><td width=50%><b><strong><font size=2 color='"+parent.mCartTableHeaderColor+"'><center>Item Name</center></td><td width=10%><b><strong><font size=2 color='"+parent.mCartTableHeaderColor+"'><center>Price</center></td></tr>");
	for (j=0;j<ir.length;j++) {
		if (ir[j].match>0) {
			cWin.write("<tr bgcolor='"+parent.mCartTableBodyBGColor+"'><td valign=top><font size=2 color='"+parent.mCartTableBodyColor+"'><strong><center>"+ir[j].match+"</strong></td><td valign=top><font size=2 color='"+parent.mCartTableBodyColor+"'><strong><center>"+ir[j].itemID+"</strong></td><td valign=top><font size=2 color='"+parent.mCartTableBodyColor+"'><strong><center><a href='item"+ir[j].itemID+".html'  target=shop>"+ir[j].itemName+"</a></strong></td><td align=right><font size=2 color='"+parent.mCartTableBodyColor+"'><strong><right>"+Currency(ir[j].price)+"</strong></td></tr>");
		}
	}
	cWin.write("</table></td></tr></table></body></html>");
	cWin.close();	
}


function PrintSearchPage()
{
	var cWin=parent.frames["shop"].document;
	cWin.open();
	cWin.write("<HTML><HEAD><TITLE> Shopping Cart Viewer</TITLE></HEAD>");
	cWin.write("<BODY Text=#000000 BGCOLOR=#ffffff LINK=#ff0000 VLINK=#ff0000 alink=#222222 valign=top OnLoad='document.forms[0].elements[0].focus()'>");
	cWin.write("<table border=0> <tr><td><a href='"+mainPage+"'><Strong>Main Page</strong></a></td><td><a href='"+parent.returnHtmlPath+"'><Strong>Back</strong></a></td></tr></table><hr size=1 width=50%>");
	cWin.write("<input type=button size=40 value='Submit' onClick='parent.frames[\"cart\"].Search()'>");
	cWin.write("</form></td></tr></table>");
	cWin.write("</body></html>");
	cWin.close();	
}