//auto generates by the storecreator and templates
var storeName='Ziron Multimedia';
var mainPage='intro.html';
var totalItems=8;
var ir = new Array(totalItems);
var mAlignStr='<Left>';
A(0, 'cea', 'Change Email Address', 20.00, 'Change Email Address');
A(1, 'cus', 'Customization', 0.00, 'Customization');
A(2, '0', 'Real time credit card processing', 100.00, 'Real time Credit Card ProcessingCard Processing ServerAuthorizeNetCardServiceCyberCashECommerceToolsGoChargeit.comTotalMerchantManager');
A(3, '1', 'Secured Server(SSL) for your online stores', 50.00, 'SSL order');
A(4, '2', 'ShopCreator version 1.x upgrade to StoreCreatversion 4.x', 59.90, 'StoreCreator Upgrade');
A(5, 'cdupgrade', 'Upgrade to CD version 4.x with additional Templates', 50.00, 'Purchase Additional TemplatesLicense--- None --One Additional Account IDTwo Additional Accounts');
A(6, '3', 'Zilron StoreCreator Version 4.x', 99.90, 'Zilron StoreCreatorSSL secure server-- None --1 year ($50 per year)2 year ($45 per year) --3 year ($40 per year)Version-- Web Site Download version --CD Version with Printed Manual');
A(7, '3reseller', 'Reseller Zilron StoreCreator Ver 4.x(2 copies min. required)', 55.00, 'Zilron StoreCreatorSSL secure server-- None --1 year ($50 per year)2 year ($45 per year) --3 year ($40 per year)Version-- Web Site Download --CD version with Printed Manual');
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> Zilron StoreCreator v3.0 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>Contact Address:</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> Zilron StoreCreator v3.0 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();	
}
