// 2006.10.25 All Code here written by Reginald Armond of Regivision.COM
// If you choose to use it please credit me for my efforts in some way, thanks

function ObjectRef(ObjectName)  // return a DOM object reference
{
var obj=null;
/*
if(navigator.appName.indexOf("Microsoft") != -1)
    obj=document.getElementById(ObjectName); 
else 	
	obj=document.all(ObjectName);
    // obj=((document.layers) ? document.layers[ObjectName]:eval(ObjectName));
	
*/
	
if(document.getElementById)
	    obj=document.getElementById(ObjectName); 
		
if(obj==null)
	{
	obj=((document.layers) ? document.layers[ObjectName]:eval(ObjectName));
	}
	
if(obj==null)
	obj=document.getElementById(ObjectName);
	
if(obj==null)
	{
	var i;
	for(i=0;i<window.parent.frames.length;i++)
		{
		obj=window.frames[i].getElementById(ObjectName);
		if(obj!=null)
			return obj;
		}
	}

return obj;
}

function oRef(sName)
{
 return ObjectRef(sName);
}

function toggle_div(sDiv)
{
var obj=ObjectRef(sDiv);
if(obj==null)
	return;
	
obj.style.display=(obj.style.display=="none") ? "block":"none";
}


function Local_Menu()
{
var S="";
S+="<menu name=\"menu_root\" x=\"100\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"menubar\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_news\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"index.htm\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO'>News</a></entry>";
S+="</menu>";
S+="<menu name=\"menu_home\" x=\"150\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"submenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_intro\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"home.htm\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>&nbsp;Intro</a></entry>";
S+="<entry name=\"me_today\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_today.htm\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>&nbsp;Today</a></entry>";
S+="<entry name=\"me_news\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"feature_uconst.htm\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>&nbsp;News</a></entry>";
S+="</menu>"
S+="<menu name=\"menu_services\" x=\"150\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"submenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_cart\" target=\"\" enabled=\"1\" cellheight=\"20\" popup=\"menu_cart\" class=\"\"><a href=\"javascript:void(0)\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO'>Cart &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face=\"Times New Roman\">&#9658;</font></a></entry>";
S+="<entry name=\"me_software\" target=\"\" enabled=\"1\" cellheight=\"20\" popup=\"menu_software\" class=\"\"><a href=\"javascript:void(0)\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO'>Programming <font face=\"Times New Roman\">&#9658;</font></a></entry>";
S+="<entry name=\"me_support\" target=\"\" enabled=\"1\" cellheight=\"20\" popup=\"menu_techsup\" class=\"\"><a href=\"javascript:void(0)\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO'>Tech Support &nbsp;<font face=\"Times New Roman\">&#9658;</font></a></entry>";
S+="<entry name=\"me_imaging\" target=\"\" enabled=\"1\" cellheight=\"20\" popup=\"menu_imaging\" class=\"\"><a href=\"javascript:void(0)\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO'>Imaging &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face=\"Times New Roman\">&#9658;</font></a></entry>";
S+="<entry name=\"me_services\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_items.htm?categories=all\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Show All</a></entry>";
S+="</menu>";
S+="<menu name=\"menu_cart\" x=\"150\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"submenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_vcart\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_cart.htm?categories=all\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>View</a></entry>";
S+="<entry name=\"me_scart\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"send_cart.htm\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Send to RVC</a></entry>";
S+="<entry name=\"me_ecart\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_cart.htm?categories=CMD_CLR\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Empty</a></entry>";
S+="</menu>";
S+="<menu name=\"menu_imaging\" x=\"150\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"submenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_acq\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_items.htm?categories=img_acq\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Aquisition</a></entry>";
S+="<entry name=\"me_ps\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_items.htm?categories=img_edt\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Editing</a></entry>";
S+="<entry name=\"me_watermark\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_items.htm?categories=img_bulk\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Bulk Edit</a></entry>";
S+="<entry name=\"me_iall\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_items.htm?categories=img_acq;img_edt;img_bulk\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>All</a></entry>";
S+="</menu>";
S+="<menu name=\"menu_software\" x=\"150\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"submenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_windows\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_items.htm?categories=programming\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Desktop/Server</a></entry>";
S+="<entry name=\"me_web\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_items.htm?categories=webprogramming\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Internet</a></entry>";
S+="</menu>";
S+="<menu name=\"menu_techsup\" x=\"150\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"submenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_pc_hardware\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_items.htm?categories=hardware\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>PC Hardware</a></entry>";
S+="<entry name=\"me_pc_assist\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_items.htm?categories=support\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>SW Assistance</a></entry>";
S+="<entry name=\"me_pc_net\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"view_items.htm?categories=hardware;network\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Networking</a></entry>";
S+="</menu>";
S+="<menu name=\"menu_about\" x=\"150\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"submenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_resume\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"resume.htm\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Resume</a></entry>";
S+="<entry name=\"me_companies\" target=\"\" enabled=\"1\" cellheight=\"20\" popup=\"menu_company_exp\" class=\"\"><a href=\"javascript:void(0)\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO'>Projects <font face=\"Times New Roman\">&#9658;</font></a></entry>";
S+="</menu>";
S+="<menu name=\"menu_contact\" x=\"150\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"submenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_question\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"login.asp?cmd=question\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Question</a></entry>";
S+="<entry name=\"me_email\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"mailto:support@regivision.com?subject=Priority Message-Site Origin\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Send e-Mail</a></entry>";
S+="<entry name=\"me_about\" target=\"\" enabled=\"1\" cellheight=\"20\" popup=\"menu_about\" class=\"\"><a href=\"feature_uconst.htm\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>About &nbsp;&nbsp;&nbsp;<font face=\"Times New Roman\">&#9658;</font></a></entry>";
S+="</menu>";
S+="<menu name=\"menu_company_exp\" x=\"150\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"submenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_experience\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"professional_elogic.htm\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>eLogic.COM</a></entry>";
S+="<entry name=\"me_contract\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"greatcircle_table.htm\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Great Circle</a></entry>";
S+="<entry name=\"me_fulltime\" target=\"\" enabled=\"1\" cellheight=\"20\" class=\"\"><a href=\"skyline_table.htm\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Skyline</a></entry>";
S+="</menu>";


S+="<menu name=\"menu_users\" x=\"150\" y=\"50\" width=\"30\" cellwidth=\"30\" cellheight=\"25\" visible=\"0\" dir=\"v\" class=\"submenu\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
S+="<entry name=\"me_login\" target=\"\" enabled=\"1\" cellheight=\"20\"   class=\"\"><a href=\"login.asp\" target=\"ViewArea\" onmouseover='%MI' onmouseout='%MO' onclick='%CM'>Control Panel</font></a></entry>";
S+="</menu>";
Update_Menu(S);
}

function Update_Menu(xml_menu)
{
proto_menu(20,"g_oMenuStack",d_m,xml_menu);
}

function proto_menu(iMenuStackSize,sMenuStackName,oDiv_ID_To_Use,sXML)
{

if(g_oMenuStack!=null)
    {
    g_oMenuStack.closemenu("");
    delete g_oMenuStack;
    g_oMenuStack=null;
    }

var oMyMenuTree=BuildMenuTree(sXML);
g_oMenuStack=new MenuStack(iMenuStackSize,sMenuStackName);

if(oMyMenuTree!=undefined)
  {
  // var S=DumpList(oMyMenuTree);
  var S=Build_HTML_Menus(oMyMenuTree,sMenuStackName);  

  oDiv_ID_To_Use.innerHTML=S;
  return S;
  }
return "nothing";
}

function rvc_menu(iMenuStackSize,sMenuStackName,oDiv_ID_To_Use)
{
var X="";
X+='<menu name="menu_root" x="100" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="menubar" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_news" target="" enabled="1" cellheight="20" class=""><a href="index.htm" target="ViewArea">News</a></entry>';
X+='</menu>';
X+='<menu name="menu_home" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_intro" target="" enabled="1" cellheight="20" class=""><a href="home.htm" target="ViewArea">&nbsp;Intro</a></entry>';
X+='<entry name="me_today" target="" enabled="1" cellheight="20" class=""><a href="view_today.htm" target="ViewArea">&nbsp;Today</a></entry>';
X+='<entry name="me_news" target="" enabled="1" cellheight="20" class=""><a href="feature_uconst.htm" target="ViewArea">&nbsp;News</a></entry>';
X+='</menu>';
X+='<menu name="menu_services" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_cart" target="" enabled="1" cellheight="20" popup="menu_cart" class=""><a href="javascript:void(0)" target="ViewArea">Cart</a></entry>';
X+='<entry name="me_software" target="" enabled="1" cellheight="20" popup="menu_software" class=""><a href="javascript:void(0)" target="ViewArea">Programming <font face="Times New Roman">&#9658;</font></a></entry>';
X+='<entry name="me_support" target="" enabled="1" cellheight="20" popup="menu_techsup" class=""><a href="javascript:void(0)" target="ViewArea">Tech Support &nbsp;<font face="Times New Roman">&#9658;</font></a></entry>';
X+='<entry name="me_imaging" target="" enabled="1" cellheight="20" popup="menu_imaging" class=""><a href="javascript:void(0)" target="ViewArea">Imaging &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face="Times New Roman">&#9658;</font></a></entry>';
X+='<entry name="me_services" target="" enabled="1" cellheight="20" class=""><a href="view_items.htm?categories=all" target="ViewArea">Show All</a></entry>';
X+='</menu>';
X+='<menu name="menu_cart" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_vcart" target="" enabled="1" cellheight="20" class=""><a href="view_cart.htm?categories=all" target="ViewArea">View</a></entry>';
X+='<entry name="me_scart" target="" enabled="1" cellheight="20" class=""><a href="feature_uconst.htm" target="ViewArea">Send to RVC</a></entry>';
X+='<entry name="me_ecart" target="" enabled="1" cellheight="20" class=""><a href="view_cart.htm?categories=CMD_CLR" target="ViewArea">Empty</a></entry>';
X+='</menu>';
X+='<menu name="menu_imaging" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_acq" target="" enabled="1" cellheight="20" class=""><a href="view_items.htm?categories=img_acq" target="ViewArea">Aquisition</a></entry>';
X+='<entry name="me_ps" target="" enabled="1" cellheight="20" class=""><a href="view_items.htm?categories=img_edt" target="ViewArea">Editing</a></entry>';
X+='<entry name="me_watermark" target="" enabled="1" cellheight="20" class=""><a href="view_items.htm?categories=img_bulk" target="ViewArea">Bulk Edit</a></entry>';
X+='<entry name="me_iall" target="" enabled="1" cellheight="20" class=""><a href="view_items.htm?categories=img_acq;img_edt;img_bulk" target="ViewArea">All</a></entry>';
X+='</menu>';
X+='<menu name="menu_software" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_windows" target="" enabled="1" cellheight="20" class=""><a href="view_items.htm?categories=programming" target="ViewArea">Desktop/Server</a></entry>';
X+='<entry name="me_web" target="" enabled="1" cellheight="20" class=""><a href="view_items.htm?categories=webprogramming" target="ViewArea">Internet</a></entry>';
X+='</menu>';
X+='<menu name="menu_techsup" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_pc_hardware" target="" enabled="1" cellheight="20" class=""><a href="view_items.htm?categories=hardware" target="ViewArea">PC Hardware</a></entry>';
X+='<entry name="me_pc_assist" target="" enabled="1" cellheight="20" class=""><a href="view_items.htm?categories=support" target="ViewArea">SW Assistance</a></entry>';
X+='<entry name="me_pc_net" target="" enabled="1" cellheight="20" class=""><a href="view_items.htm?categories=hardware;network" target="ViewArea">Networking</a></entry>';
X+='</menu>';
X+='<menu name="menu_about" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_resume" target="" enabled="1" cellheight="20" class=""><a href="resume.htm" target="ViewArea">Resumé</a></entry>';
X+='<entry name="me_companies" target="" enabled="1" cellheight="20" popup="menu_company_exp" class=""><a href="javascript:void(0)" target="ViewArea">Projects <font face="Times New Roman">&#9658;</font></a></entry>';
X+='</menu>';
X+='<menu name="menu_contact" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_question" target="" enabled="1" cellheight="20" class=""><a href="feature_uconst.htm" target="ViewArea">Question</a></entry>';
X+='<entry name="me_email" target="" enabled="1" cellheight="20" class=""><a href="mailto:support@regivision.com?subject=Priority Message-Site Origin" target="ViewArea">Send e-Mail</a></entry>';
X+='<entry name="me_about" target="" enabled="1" cellheight="20" popup="menu_about" class=""><a href="feature_uconst.htm" target="ViewArea">About &nbsp;&nbsp;&nbsp;<font face="Times New Roman">&#9658;</font></a></entry>';
X+='</menu>';
X+='<menu name="menu_company_exp" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_experience" target="" enabled="1" cellheight="20" class=""><a href="professional_elogic.htm" target="ViewArea">eLogic.COM</a></entry>';
X+='<entry name="me_contract" target="" enabled="1" cellheight="20" class=""><a href="greatcircle_table.htm" target="ViewArea">Great Circle</a></entry>';
X+='<entry name="me_fulltime" target="" enabled="1" cellheight="20" class=""><a href="skyline_table.htm" target="ViewArea">Skyline</a></entry>';
X+='</menu>';



X+='<menu name="menu_users" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_login" target="" enabled="1" cellheight="20" popup="menu_security" class=""><a href="javascript:void(0)" target="ViewArea">Security&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face="Times New Roman">&#9658;</font></a></entry>';
X+='<entry name="me_profile" target="" enabled="1" cellheight="20" class=""><a href="feature_uconst.htm" target="ViewArea">View/Edit Profile</a></entry>';
X+='</menu>';

X+='<menu name="menu_security" x="150" y="50" width="30" cellwidth="30" cellheight="25" visible="0" dir="v" class="submenu" border="0" cellpadding="0" cellspacing="0">';
X+='<entry name="me_sec0" target="" enabled="1" cellheight="20" class=""><a href="feature_uconst.htm" target="ViewArea">Sign In</a></entry>';
X+='<entry name="me_sec1" target="" enabled="1" cellheight="20" class=""><a href="feature_uconst.htm" target="ViewArea">Sign Out</a></entry>';
X+='</menu>';

proto_menu(iMenuStackSize,sMenuStackName,oDiv_ID_To_Use,X);
}

function rvc_create_warehouse()
{
o=new InventoryWarehouse();
// Add Items to the warehouse
var pr="";

pr ="cat=\"hardware\" ";
pr+="labor=\"0\" ";
pr+="min_labor=\"60\" ";
pr+="rate=\"30.00\" ";
pr+="title=\"Personal Computer Hardware Maintenance\" ";
pr+="desc=\"We can diagnose, repair, and upgrade your computer system.  In addition to our passion for computers we have years of experience building and upgrading computers.  We can also recommend the upgrades or computer components indicated by your intended use of the machine.\" ";
pr+="tn=\"content\\home.gif\" ";
pr+="img=\"0\" ";
pr+="tasks_cb_t=\"Hardrive Installation/Replacement;Memory Upgrade;Video Card;CPU Upgrade;Computer system case Transfer;Power Supply;Motherboard;Network Interface Card Installation\" ";
pr+="tasks_cb_b=\"f;f;f;f;f;f;f;f\" ";
pr+="tasks_cb_l=\"30;10;10;30;120;30;180;10\" ";
pr+="priority_rb_t=\"Normal;Urgent - Time sensitive;Emergency\" ";
pr+="priority_rb_v=\"NORMAL;URGENT;EMERGENCY\" ";
pr+="priority_rb_b=\"t;f;f\" ";
pr+="purpose_lb_t=\"Just give me an estimate, please;I am interested in having these services performed;Other - additional details to be provided\" ";
pr+="purpose_lb_v=\"ESTIMATE;WORK;OTHER\" ";
pr+="purpose_lb_b=\"t;f;f\" ";
pr+="comment=\"Details Here:%0AManufacturer:%0AModel Number:%0ACPU:%0ARAM:%0AWhat do you need?%0A\"";
o.Add("RVC_HDWRPC1",pr);

pr ="cat=\"network\" ";
pr+="labor=\"0\" ";
pr+="min_labor=\"60\" ";
pr+="rate=\"25.00\" ";
pr+="title=\"Networking - Computer and device connectivity\" ";
pr+="desc=\"We can help you by installing and configuring your home or small office network.  We have experience installing both wired and wireless connectivity solutions which include routers, hubs, WEP, 802-11a/b/g, DSL Modems, Cable Modems, printer servers, ethernet enabled file servers.\" ";
pr+="tn=\"content\\home.gif\" ";
pr+="img=\"0\" ";
pr+="tasks_cb_t=\"Router Installation/Configuration;Network Interface Card Installation;Computer Configuration;Network Shares;Networked Printer setup;Networked Hard Drive Setup\" ";
pr+="tasks_cb_b=\"f;f;f;f;f;f\" ";
pr+="tasks_cb_l=\"0;0;0;0;0;0;0;0;0;0\" ";
pr+="priority_rb_t=\"Normal;Urgent - Time sensitive;Emergency\" ";
pr+="priority_rb_v=\"NORMAL;URGENT;EMERGENCY\" ";
pr+="priority_rb_b=\"t;f;f\" ";
pr+="purpose_lb_t=\"Just give me an estimate, please;I am interested in having these services performed;Other - additional details to be provided\" ";
pr+="purpose_lb_v=\"ESTIMATE;WORK;OTHER\" ";
pr+="purpose_lb_b=\"t;f;f\" ";
pr+="comment=\"Details Here:%0AWhat size is your existing network?%0AWhat do you need?%0A\"";
o.Add("RVC_NETWK1",pr);

pr ="cat=\"support\" ";
pr+="labor=\"0\" ";
pr+="min_labor=\"60\" ";
pr+="rate=\"25.00\" ";
pr+="title=\"Personal Computer Software Maintenence\" ";
pr+="desc=\"We can make sure your operating system and installed applications are working properly.  We have worked with many applications and operating systems and during that time our inate predilection for analysis has made us experts in deducing and improving upon how things work.  In addition to helping you utilize your software more effectively we may be able to help you save money by getting the most out of your investment. Let us show you how.\" ";
pr+="tn=\"content\\home.gif\" ";
pr+="img=\"0\" ";
pr+="tasks_cb_t=\"Virus/Spyware/Worm detection and removal;System optimization - find wasted space, organize menues, clean desktop;Task Automation - Create shortcuts & scripts for common tasks you do;Install software;Troubleshoot a software problem that prevents you from using your application;System Error Resolution\" ";
pr+="tasks_cb_b=\"f;f;f;f;f;f\" ";
pr+="tasks_cb_l=\"0;0;0;0;0;0;0;0;0;0\" ";
pr+="priority_rb_t=\"Normal;Urgent - Time sensitive;Emergency\" ";
pr+="priority_rb_v=\"NORMAL;URGENT;EMERGENCY\" ";
pr+="priority_rb_b=\"t;f;f\" ";
pr+="purpose_lb_t=\"Just give me an estimate, please;I am interested in having these services performed;Other - additional details to be provided\" ";
pr+="purpose_lb_v=\"ESTIMATE;WORK;OTHER\" ";
pr+="purpose_lb_b=\"t;f;f\" ";
pr+="comment=\"Details Here:%0AIs this computer able to access the internet?%0AAre you experiencing excessive popups or error messages?%0ADoes your computer startup or run applications very slowly?%0ADoes your system freeze?%0APlease detail any other problems here:%0A\"";
o.Add("RVC_HDWRPC2",pr);

pr ="cat=\"support\" ";
pr+="labor=\"0\" ";
pr+="min_labor=\"60\" ";
pr+="rate=\"25.00\" ";
pr+="title=\"Software Productivity Assistance - Get the most out of your software\" ";
pr+="desc=\"We can help you use the software you have more effectively.  If you have Microsoft's Office products including Word, Excel, Access, Frontpage, Powerpoint, etc, we can help you use several simple but powerful features that will save you from spending precious dollars on more specialized off-the-shelf solutions.\" ";
pr+="tn=\"content\\info.gif\" ";
pr+="img=\"0\" ";
pr+="tasks_cb_t=\"MS Office Excel Assistance;MS Office Word Assistance;MS Office Powerpoint Assistance;MS Office Access Assistance;MS Office Frontpage Assistance;MS Office Outlook Assistance - eMail filters, advanced features\" ";
pr+="tasks_cb_b=\"f;f;f;f;f;f\" ";
pr+="tasks_cb_l=\"0;0;0;0;0;0;0;0;0;0\" ";
pr+="priority_rb_t=\"Normal;Urgent - Time sensitive;Emergency\" ";
pr+="priority_rb_v=\"NORMAL;URGENT;EMERGENCY\" ";
pr+="priority_rb_b=\"t;f;f\" ";
pr+="purpose_lb_t=\"Just give me an estimate, please;I am interested in having these services performed;Other - additional details to be provided\" ";
pr+="purpose_lb_v=\"ESTIMATE;WORK;OTHER\" ";
pr+="purpose_lb_b=\"t;f;f\" ";
pr+="comment=\"Details Here:%0AIs this for home or office?%0APlease explain with as much detail as possible:%0A\"";
o.Add("RVC_SFWRPC",pr);

pr ="cat=\"support\" ";
pr+="labor=\"0\" ";
pr+="min_labor=\"60\" ";
pr+="rate=\"25.00\" ";
pr+="title=\"Software Tutoring - Windows 3.1, 95, 98, ME, NT, 2000, XP and Office applications\" ";
pr+="desc=\"Learn how to use Microsoft Windows and office applications from someone who is able to bridge the chasm between computerese and understanding.\" ";
pr+="tn=\"content\\comments.gif\" ";
pr+="img=\"0\" ";
pr+="tasks_cb_t=\"MS Word;MS Excel;MS Access;MS Front Page;Windows XP;Windows 3.1;Windows NT;Windows 2000;Windows ME;Windows 98;Linux;Other\" ";
pr+="tasks_cb_b=\"f;f;f;f;f;f;f;f;f;f;f;f\" ";
pr+="tasks_cb_l=\"0;0;0;0;0;0;0;0;0;0\" ";
pr+="priority_rb_t=\"Normal;Urgent - Time sensitive;Emergency\" ";
pr+="priority_rb_v=\"NORMAL;URGENT;EMERGENCY\" ";
pr+="priority_rb_b=\"t;f;f\" ";
pr+="purpose_lb_t=\"Just give me an estimate, please;I am interested in having these services performed;Other - additional details to be provided\" ";
pr+="purpose_lb_v=\"ESTIMATE;WORK;OTHER\" ";
pr+="purpose_lb_b=\"t;f;f\" ";
pr+="comment=\"Please provide task related details here so that we may better assist you:%0A\"";
o.Add("RVC_SFWRTU1",pr);

pr ="cat=\"programming\" ";
pr+="labor=\"0\" ";
pr+="min_labor=\"60\" ";
pr+="rate=\"40.00\" ";
pr+="title=\"Programming for Desktops & Servers - Languages: C#.NET,VB.NET, DOS, VBScript,  VB Office\" ";
pr+="desc=\"Contract computer programming targeted for desktop or server use.  We have experience doing both front end an back end processes, data driven applications, multi-threading, GUI, graphics manipulation, internet conectivity.\" ";
pr+="tn=\"content\\info.gif\" ";
pr+="img=\"0\" ";
pr+="tasks_cb_t=\"Visual BASIC;C#.NET;VB.NET;DOS - CMD/BAT file scripting;VB Script;VB for Office - Visual BASIC for MS Office Applications\" ";
pr+="tasks_cb_b=\"f;f;f;f;f;f\" ";
pr+="tasks_cb_l=\"0;0;0;0;0;0;0;0;0;0\" ";
pr+="priority_rb_t=\"Normal;Urgent - Time sensitive;Emergency\" ";
pr+="priority_rb_v=\"NORMAL;URGENT;EMERGENCY\" ";
pr+="priority_rb_b=\"t;f;f\" ";
pr+="purpose_lb_t=\"Just give me an estimate, please;I am interested in having these services performed;Other - additional details to be provided\" ";
pr+="purpose_lb_v=\"ESTIMATE;WORK;OTHER\" ";
pr+="purpose_lb_b=\"t;f;f\" ";
pr+="comment=\"Please briefly explain what you need:%0AIs this onsite or offsite?%0ABy Project or Hourly?%0AN.D.A.?%0AContact Person:%0Ae-Mail Address:%0AContact Phone:%0A\"";
o.Add("RVC_SFWRENG1",pr);


pr ="cat=\"programming\" ";
pr+="labor=\"0\" ";
pr+="min_labor=\"60\" ";
pr+="rate=\"35.00\" ";
pr+="title=\"Website Design, set-up, and implementation\" ";
pr+="desc=\"We can help you by working with you to design and get your website on the internet.  From domain name registration, webhosting, page layouts, Javascript interactivity, graphics design, we can get the ball rolling.\" ";
pr+="tn=\"content\\info.gif\" ";
pr+="img=\"0\" ";
pr+="tasks_cb_t=\"Website Design (Photoshop/Layout/ETC);Website Programming (Javascript/Flash/CSS/Database);Website Registration/Hosting/Administration;Website Duplication;Website Search Engine Optimization\" ";
pr+="tasks_cb_b=\"f;f;f;f;f\" ";
pr+="tasks_cb_l=\"0;0;0;0;0;0;0;0;0;0\" ";
pr+="priority_rb_t=\"Normal;Urgent - Time sensitive;Emergency\" ";
pr+="priority_rb_v=\"NORMAL;URGENT;EMERGENCY\" ";
pr+="priority_rb_b=\"t;f;f\" ";
pr+="purpose_lb_t=\"Just give me an estimate, please;I am interested in having these services performed;Other - additional details to be provided\" ";
pr+="purpose_lb_v=\"ESTIMATE;WORK;OTHER\" ";
pr+="purpose_lb_b=\"t;f;f\" ";
pr+="comment=\"Is this a new website?%0APersonal or business website?%0APlease explain:%0AIs there a site on the internet with a similar look that you wish to offer as an example of what you want?%0APlease paste the URL here:%0AOther details:%0A\"";
o.Add("RVC_WEBDSGN",pr);


pr ="cat=\"programming\" ";
pr+="labor=\"0\" ";
pr+="min_labor=\"60\" ";
pr+="rate=\"55.00\" ";
pr+="title=\"Contract Programming for Desktops & Servers - Languages: C/C++\" ";
pr+="desc=\"\Contract Computer Programming of high performance Desktop/Server applications and utility software.  High Performance, high efficiency applications for backend, frontend, and utilitarian processes.  Technologies that we know and can use in your applications: Multi-threading, MFC, COM, ATL, Winsock32, WINAPI, GDI, expression trees, WinINET, parsing, graphics processing, multi-threaded animation, TCP/IP, screen scraping, HTML/XML parsing.\" ";
pr+="tn=\"content\\info.gif\" ";
pr+="img=\"0\" ";
pr+="tasks_cb_t=\"C/C++ - The best language for high performance, high efficiency and control.;Utilize Embedded Flash Player for Front-End GUI (Richer Interfaces)\" ";
pr+="tasks_cb_b=\"f;f\" ";
pr+="tasks_cb_l=\"0;0;0;0;0;0;0;0;0;0\" ";
pr+="priority_rb_t=\"Normal;Urgent - Time sensitive;Emergency\" ";
pr+="priority_rb_v=\"NORMAL;URGENT;EMERGENCY\" ";
pr+="priority_rb_b=\"t;f;f\" ";
pr+="purpose_lb_t=\"Just give me an estimate, please;I am interested in having these services performed;Other - additional details to be provided\" ";
pr+="purpose_lb_v=\"ESTIMATE;WORK;OTHER\" ";
pr+="purpose_lb_b=\"t;f;f\" ";
pr+="comment=\"Please briefly explain what you need:%0AIs this onsite or offsite?%0ABy Project or Hourly?%0AN.D.A.?%0AContact Person:%0Ae-Mail Address:%0AContact Phone:%0A\"";
o.Add("RVC_SFWRENG2",pr);

pr ="cat=\"img_edt\" ";
pr+="labor=\"0\" ";
pr+="min_labor=\"60\" ";
pr+="rate=\"30.00\" ";
pr+="title=\"Digital Imaging - Photoshopping\" ";
pr+="desc=\"We can create/edit images for you using Adobe Photoshop.\" ";
pr+="tn=\"content\\themes.gif\" ";
pr+="img=\"0\" ";
pr+="tasks_cb_t=\"Photoshop Editing\" ";
pr+="tasks_cb_b=\"f\" ";
pr+="tasks_cb_l=\"0;0;0;0;0;0;0;0;0;0\" ";
pr+="priority_rb_t=\"Normal;Urgent - Time sensitive;Emergency\" ";
pr+="priority_rb_v=\"NORMAL;URGENT;EMERGENCY\" ";
pr+="priority_rb_b=\"t;f;f\" ";
pr+="purpose_lb_t=\"Just give me an estimate, please;I am interested in having these services performed;Other - additional details to be provided\" ";
pr+="purpose_lb_v=\"ESTIMATE;WORK;OTHER\" ";
pr+="purpose_lb_b=\"t;f;f\" ";
pr+="comment=\"Please explain what you need:%0A\"";
o.Add("RVC_IMG3",pr);

return o;
}

// utility functions
function TimeInSeconds()
{
var now=new Date;
var secs=(now.getHours()*3600);
secs+=(now.getMinutes()*60);
secs+=now.getSeconds();
return secs;
}

function oset_display(sName,sValue) // object set display
	{
	var o=oRef(sName);
	if(o!=null || o!=undefined)
		{	
		o.style.display=sValue;
		return;
		}	
	}
	
function oset_visibility(sName,sValue) // object set visibility
	{
	var o=oRef(sName);
	if(o!=null || o!=undefined)
		{	
		o.style.visibility=sValue;
		return;
		}	
	}
	
function oset_xy(sName,xx,yy) // object set visibility
{
var o=oRef(sName);
if(o!=null || o!=undefined)
  {	
   var bOnScreen=(xx>=0 && yy>=0);
   o.style.top=yy+"px";  o.style.left=xx+"px";
   oset_visibility(sName,(bOnScreen ? "visible":"hidden"));
   return;
  }
}

function show_hourglass(b)
{
var ww=640/2,hh=480/2;
if(b==true)
    oset_xy("div_hourglass",ww,hh);
else
    oset_xy("div_hourglass",-1000,-1000);
}

function show_hourglass_xy(ww,hh)
{
oset_xy("div_hourglass",ww,hh);
}



function otd(sName) // object toggle display
	{
	var o=oRef(sName);
	if(o!=null || o!=undefined)
		{	
		o.style.display=(o.style.display=="none") ? "block":"none";
		return;
		}	
	}
	
function otv(sName) // object toggle visibility
	{
	var o=oRef(sName);
	if(o!=null || o!=undefined)
		{		
		o.style.visibility=(o.style.visibility=="hidden") ? "visible":"hidden";
		}
	}
	
function ReplaceAll(S,SS,RS)
	{
	var oSS=new RegExp(SS);
	while(S.indexOf(SS)>=0)
		S=S.replace(oSS,RS);
	return S;
	}
	
function GetUrlParameter(sURL,sName)
	{		
	var S=" "+sURL;
	var iPos=S.indexOf("?");	
	if(iPos<0)
	  return "";
	  
	S=S.substring(iPos+1);
	
	iPos=S.indexOf(sName+"=");
	if(iPos<0)
		return "";
		
	iPos+=(sName.length+1);
	var SR="",x;
	for(x=iPos;S.charAt(x)!="&" && x<S.length;x++)
		{
		SR+=S.charAt(x);
		}
	return SR;
	}
	


var g_oSendRequest=null;

	
function SendRequest()
    {
    // SendRequest object constructor

    this.oDocument=null;
    this.oRemotingDiv=null;
    this.oXHR=null;
    this.sGetDoc="";
    this.cbfn_Document=null;
    this.beIE = document.all?true:false;
    this.OpenXMLHttpRequest=fn_open_xml_http_request;
    this.Open=fn_create; // iframe method
    this.Send=fn_send; // iframe
    this.CallServer=fn_callserver;
    this.UpdatePage=fn_update_page;
    this.GetDocument=fn_get_document;
    g_oSendRequest=this;
    function fn_get_document(sURL,cb)
        {
        var sCMD=sURL;
        this.sGetDoc=sURL;
        this.cbfn_Document=cb;
        this.oXHR.open("GET",sURL,true);
        // also HEAD for .getAllResponseHeaders() || .getResponseHeader("LastModified");
        
        this.oXHR.onreadystatechange=this.UpdatePage;

        this.oXHR.send(null);
        
        }
    function fn_update_page()
        {
        // also .status==404notExist || .status==200Exist
        
        var dis=null;
        var i;
        dis=g_oSendRequest;
        if(dis.oXHR.readyState==4)
            {
            var res=dis.oXHR.responseText;
            if(dis.cbfn_Document!=null)
                {
                dis.cbfn_Document(res);
                dis.cbfn_Document=null;                
                return;
                }
            var afields=res.split(";");
            var n=0;
            for(n=0;n<afields.length;n++)
                {
                var values=afields[n].split("=");
                try 
                    {
                    dis.oDocument.getElementById(values[0]).value=unencode(values[1]);
                    }
                catch(e)
                    {
                    }
                }
            }
        }
    function fn_callserver(sURL,sFormFields)
        {
        var sCMD=sURL+"?";
        var afields=sFormFields.split(";");
        var n,sValue;
        for(n=0;n<afields.length;n++)
            {
            try
                {
                sValue=escape(this.oDocument.getElementById(afields[n]).value);
                }
            catch(e)
                {
                sValue="";
                }
            sCMD+=((n!=0) ?"&":"")+afields[n]+"="+sValue;
            }
        this.oXHR.open("GET",sURL,true);
        // also HEAD for .getAllResponseHeaders() || .getResponseHeader("LastModified");
        this.oXHR.onreadystatechange=this.UpdatePage;
        this.oXHR.send(null);
        }
    function fn_open_xml_http_request(oDocument)
        {
        this.oDocument=oDocument;
        
        if(this.beIE)
            {
            try
                {
                this.oXHR=new ActiveXObject("Msxml2.XMLHTTP");                
                }
            catch(e)
                {
                try
                    {
                    this.oXHR=new ActiveXObject("Microsoft.XMLHTTP");
                    }
                catch(e2)
                    {
                    this.oXHR=null;
                    }
                }
            }
        else
            {
            try
                {
                this.oXHR=new XMLHttpRequest();                
                }
            catch(e)
                {
                this.oXHR=null;
                }
            }

        }
    function fn_create(oDocument,sID,sURL)
        {
        this.oDocument=oDocument;
        var oDiv=this.oDocument.createElement('div');
        oDiv.id='remotingDiv';
        var style='border:0;width:0;height:0;';
        oDiv.innerHTML="<iframe name='"+sID+"' id='"+sID+"' style='"+style+"'></iframe>";
        this.oDocument.body.appendChild(oDiv);
        oDiv.iframe=this.oDocument.getElementById(sID);
        
        oDiv.form=this.oDocument.createElement('form');
        oDiv.form.setAttribute('id',sID+'RemotingForm');
        oDiv.form.setAttribute('action',sURL);
        oDiv.form.setAttribute('target',sID);
        oDiv.form.target=sID;
        oDiv.form.setAttribute('method','post');
        oDiv.form.innerHTML='<input type="hidden" name="data" id="'+sID+'Data">';
        oDiv.appendChild(oDiv.form);
        oDiv.data=this.oDocument.getElementById(sID+'Data');
        this.oRemotingDiv=oDiv;        
        }
    function fn_send(sURL,sData,fn_callback)
        {
        // Send request call
        if(this.oRemotingDiv==null)
            this.oRemotingDiv=this.Open('remotingFrame','blank.html');
        this.oRemotingDiv.form.action=sURL;
        this.oRemotingDiv.data.value=sData;
        this.oRemotingDiv.callback=fn_callback;
        this.oRemotingDiv.form.submit();
        }
    
    }

// START: COOKIE JAR
// COOKIE JAR

function getCookieVal (offset) 
   {
   var endstr = document.cookie.indexOf (";", offset);

   if (endstr == -1)      endstr = document.cookie.length;

   return unescape(document.cookie.substring(offset, endstr));
   }

function GetCookie (name) 
   {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;

   var i = 0;

   while (i < clen) 
      {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)      return getCookieVal (j);

      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0)       break; 
      }

   return "";
   }

function SetCookie (name, value) 

   {
   t=new Date();   
   t.setTime(t.getTime() +  (24 * 60 * 60 * 1000 * 365)); 	

   var argv = SetCookie.arguments;
   var argc = SetCookie.arguments.length;
   var expires =  t; // (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;

	path="/";

   document.cookie = name + "=" + escape (value) +
   	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
     	((path == null) ? "" : ("; path=" + path)) +
     	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");

   }



function LoadSettings(snam,sdef)
{
	X=GetCookie(snam);       
	if(X=="") X=sdef;	
return X;       
}


function SaveSettings(snam,X)
{	
	 var t=new Date();
         vcount=0;
	 lastdate=GETENVSTR(X,"VD");
         
        thisdate=""+(1900+t.getYear())+"."+t.getMonth()+"."+t.getDate();
	if(lastdate!=thisdate)
		{
		VC=GETENVSTR(X,"VC");
		vcount=(VC!="") ? ParseInt(VC):1;
		vcount++;
		VC=""+vcount;
		X=SETENVSTR(X,"VC",VC);
		}
	VD=""+thisdate;
        X=SETENVSTR(X,"VD",thisdate);        
	
        SetCookie (snam,X) ;      
}

// ENV TYPE SETTINGS MANAGEMENT
function GETENVSTR(ENVSTR,SS)
{
 var spos=ENVSTR.indexOf(SS+"=");
 var slen=ENVSTR.length;

if(spos<0) return "";

var ibeg=spos+SS.length+1;
var SR="";
for(i=ibeg;(c=ENVSTR.charAt(i))!=cDelim && i<slen;i++)
	{
	SR+=c;
	}

return SR;
}

function SETENVSTR(ENVSTR,SS,NEWVAL)
{
 var spos=ENVSTR.indexOf(SS+"=");
 var slen=ENVSTR.length;

var ibeg=spos;

if(spos<0) return ENVSTR+SS+"="+NEWVAL+cDelim;

e_left=ENVSTR.substring(0,spos);

var SR="";
for(i=ibeg;(c=ENVSTR.charAt(i))!=cDelim && i<slen;i++,spos++)
	{
	SR+=c;
	}

e_right=ENVSTR.substring(spos,slen);

return e_left+SS+"="+NEWVAL+e_right;
}


function DELENVSTR(ENVSTR,SS)
{
 var spos=ENVSTR.indexOf(SS+"=");
 var slen=ENVSTR.length;

var ibeg=spos;

if(spos<0) return ENVSTR;

e_left=ENVSTR.substring(0,spos);

var SR="";
for(i=ibeg;(c=ENVSTR.charAt(i))!=cDelim && i<slen;i++,spos++)
	{
	SR+=c;
	}

e_right=ENVSTR.substring(spos+1,slen);

return e_left+e_right;
}
// end: COOKIE JAR


// start: list_lib.js


// My Tag Reader
function tag_reader(sX)
{
/* Programmer: Reginald Armond
   Purpose: My self contained simple xml reader
*/ 
this.sgml=sX;
this.ipos=0;
this.init=fn_init;
this.current_tag="";
this.current_attributes="";
this.current_tagtext="";
this.current_taghtml="";
this.bEof=(sX.length<1);

// Interface
this.tag=fn_tag;
this.next=fn_next;
this.eof=fn_eof;
this.property=fn_property;
this.tag_text=fn_tag_text;
this.tag_html=fn_tag_html;

function fn_init(SS)
  {
  this.sgml=SS;
  this.ipos=0;
  this.bEof=(SS.length<1);
  }
function fn_next()
  {

  var iPos=this.sgml.indexOf("<",this.ipos);

this.current_tag="";
this.current_attributes="";
this.current_tagtext="";
this.current_taghtml="";


  var iStart;
  if(iPos<0)
    {
     this.bEof=true;
     return false;
    }
  iStart=iPos;

  iPos++;
  var tagname="";
  var c=this.sgml.charAt(iPos++).toLowerCase();
  while(iPos<this.sgml.length && ((c>="a" && c<="z") || c=="/" || c=="?"))
    {
    tagname+=c;
    c=this.sgml.charAt(iPos++).toLowerCase();
    }
  iPos--;

  if(tagname.length<1)
    {
     this.bEof=true;
     return false;
    }
  var iPosEnd=iPos;
  var iQuotes=0;
  var sProperties="";

  c=this.sgml.charAt(iPosEnd++);

  // find end of tag
  while(iPosEnd<this.sgml.length && (c==">" && (iQuotes & 1)==0)==false)
    {
    sProperties+=c;
    if(c=='"')
      iQuotes++;
    c=this.sgml.charAt(iPosEnd++);
    }

  iPosEnd--;

  if(c==">")
    {
    this.current_tag=tagname;
    this.ipos=iPosEnd+1;

    if(tagname.charAt(0)=="/")
      return true;
    this.current_attributes=sProperties;

    var findtag="</"+tagname+">";
    var iFoundTag=this.sgml.indexOf(findtag,this.ipos);
    if(iFoundTag>=0)
      {
      this.current_tagtext=this.sgml.substring(iStart,iFoundTag);
      this.current_taghtml=this.sgml.substring(this.ipos,iFoundTag);//+findtag;
      }

    return true;
    }

  return false;
  }
function fn_tag()
  {
  return this.current_tag;
  }
function fn_eof()
  {
  return this.bEof;
  }
function fn_property(sKey)
  {
  return properties_get(this.current_attributes,sKey);
  }
function fn_tag_text()
  {
   return this.current_tagtext;
  }
function fn_tag_html()
  {
   return this.current_taghtml;
  }
}

function properties_get(sProps,sKey)
{
         if (sProps=="")
           return "";
		
		sProperties=sProps;
		sProperties=ReplaceAll(sProperties,"\"\"","\"?\"");		
		
         var iPos=sProperties.indexOf(sKey);
         if(iPos<0)
           return "";
         iPos+=sKey.length;

         var c=sProperties.charAt(iPos++);
         while(iPos<sProperties.length && c==" " && c!="=")
             {
             c=sProperties.charAt(iPos++);
             }
         if(c!="=")
             return "";

         iPos++;
         c=sProperties.charAt(iPos++);

         while(iPos<sProperties.length && c==" ")
             {
             c=sProperties.charAt(iPos++);
             }
         var value="";
         if(c=='"')
           {           
           c=sProperties.charAt(iPos++);
           }
          while(iPos<sProperties.length && c!='"')
             {
             value+=c;
             c=sProperties.charAt(iPos++);
             }
			if(value=="?")
				value="";
          return value;

}

function properties_put(sProperties,sKey,sValue)
{
        if (sProperties=="")
           {
           sProperties=sKey+"=";
           sProperties+='"';
           sProperties+=sValue;
           sProperties+='"';
           return sProperties;
           }
         var iPos=sProperties.indexOf(sKey);
         if(iPos<0)
            {
           sProperties+=" ";
           sProperties+=sKey+"=";
           sProperties+='"';
           sProperties+=sValue;
           sProperties+='"';
           return sProperties;
           }
         iPos+=sKey.length;
         var c=sProperties.charAt(iPos);
         while(iPos<sProperties.length && c==" " && c!="=")
             {
             c=sProperties.charAt(iPos); iPos++;
             }
         if(c!="=")
             return undefined;
         iPos++;
         c=sProperties.charAt(iPos);

         while(iPos<sProperties.length && c==" ")
             {
             c=sProperties.charAt(iPos); iPos++;
             }
         if(c!='"')
           return undefined;
         var iPosEnd=sProperties.indexOf('"',iPos+1);
         if (iPosEnd<0)
          return undefined;
         var sLeft=sProperties.substring(0,iPos+1);
         var sRight=sProperties.substring(iPosEnd);
         sProperties=sLeft;
         sProperties+=sValue;
         sProperties+=sRight;
         return sProperties;
}


function ListEntry(sName,sProperties)
  {
  this.oname=sName;
  this.properties=sProperties;
  this.next=0;
  this.children=0;
  this.data=0;
  this.get_property=fn_get;
  this.set_property=fn_put;
  this.set_property_list_item=fn_put_li;
  this.get_property_list_item=fn_get_li;
  this.toggle_property_list_item=fn_flip_li;

  function fn_get(sKey)
         {
         return properties_get(this.properties,sKey);
         }
  function fn_put(sKey,sValue)
         {
          var ReturnValue=properties_put(this.properties,sKey,sValue);
          if(ReturnValue!=undefined)
            {
            this.properties=ReturnValue;
            return true;
            }
          return false;
         }
	function fn_get_li(sKey,iOrdinal)
		{
		var li_a=this.get_property(sKey).split(";");
		if(li_a.length<1)
			return "";
		return li_a[iOrdinal];
		}
	function fn_put_li(sKey,sValue,iOrdinal)
		{
		var li_a=this.get_property(sKey).split(";");
		
		if(iOrdinal>=li_a.length || li_a.length==0)
			return false;		
		li_a[iOrdinal]=sValue;
		
		var x=0,S="";
		for(x=0;x<li_a.length;x++)	
			{
			S+=li_a[x]+(x<(li_a.length-1) ? ";":"");			
			}
		
		this.set_property(sKey,S);
		
		return true;
		}
	function fn_flip_li(sKey,iOrdinal)
		{
		var sON,sOFF,v=this.get_property_list_item(sKey,iOrdinal);
		
		if(v=="")
			return false;
		if(v=="t" || v=="f")
			{
			sON="t";sOFF="f";
			}
		else
		if(v=="y" || v=="n")
			{
			sON="y";sOFF="n";
			}
		else
			{
			sON="1";sOFF="0";
			}
		var newval=(v==sON ? sOFF:sON);		
		this.set_property_list_item(sKey,newval,iOrdinal);
		return true;		
		}
  }


function GetTail(oList)
  {
  var oTraverse=oList;
  if(oTraverse==undefined)
     return undefined;

  while(oTraverse.next!=0)
    {
    oTraverse=oTraverse.next;
    }
  return oTraverse;
  }

function GetNamed(oList,sName)
  {
  var oTraverse=oList;
  if(oTraverse==undefined)
     return undefined;

  while(oTraverse!=0)
    {
    if(oTraverse.oname==sName)
      return oTraverse;
    oTraverse=oTraverse.next;
    }
  return undefined;
  }

function DeleteList(oList)
  {
  try
	{
	var oTraverse=oList;
	if(oTraverse==undefined || oTraverse==null)
		return undefined;

	while(oTraverse.next!=0)
		{
		var oDelete=oTraverse.next;
		oTraverse.next=oTraverse.next.next;
		if(oDelete.children!=0)
			DeleteList(oDelete.children);
	
		delete oDelete;
		}

	}
	catch(e)
					{					
					}

  }

function DeleteNamed(oList,sName)
  {
  var oTraverse=oList;
  if(oTraverse==undefined)
     return false;

  while(oTraverse.next!=0)
    {
    if(oTraverse.next.oname==sName)
      {
      var oDelete=oTraverse.next;
      oTraverse.next=oTraverse.next.next;
      if(oDelete.children!=0)
        delete oDelete.children;
      delete oDelete;
      return true;
      }
    oTraverse=oTraverse.next;
    }
  return false;
  }

function InsertAfterNamed(oList,sName,oListToAdd)
  {
  // insert list after named item
  var oItem=GetNamed(oList,sName);
  if(oItem==undefined)
    return false;
  var oItemLast=GetTail(oListToAdd);
  oItemLast.next=oItem.next;
  oItem.next=oListToAdd;
  return true;
  }

function InsertBeforeNamed(oList,sName,oListToAdd)
  {
  // insert list before named item
  var oItem=GetNamed(oList,sName);
  if(oItem==undefined)
    return false;
  var oTraverse=oList;
  while(oTraverse.next!=0)
    {
    if(oTraverse.next==oItem)
      {
      var oItemLast=GetTail(oListToAdd);
      oItemLast.next=oTraverse.next;
      oTraverse.next=oListToAdd;
      return true;
      }
    oTraverse=oTraverse.next;
    }

  }

function AddEntry(oList,oEntry)
  {
  var oListTail=GetTail(oList);
  if(oListTail==undefined)
     return false;
  oListTail.next=oEntry;  
  return true;
  }

function SetProperty(oList,sName,sKey,sValue)
  {
  var oEntry=GetNamed(oList,sName);
  if(oEntry==undefined)
    return false;
  return oEntry.set_property(sKey,sValue);
  }


function DumpList(oList)
{
var oTraverse=oList;
var sList="";
while(oTraverse!=0)
  {
  sList+=oTraverse.oname;
  sList+=" / ";
  sList+=oTraverse.properties;
  sList+="<br>";
  if(oTraverse.children!=0)
      {
      var oTraverseChildren=oTraverse.children;
      while(oTraverseChildren!=0)
        {
        sList+="...";
        sList+=oTraverseChildren.oname;
        sList+=" / ";
        sList+=oTraverseChildren.properties;
        sList+="<br>";
        oTraverseChildren=oTraverseChildren.next;
        }
      }
  oTraverse=oTraverse.next;
  }
return sList;
}

// start: list_lib.js

// start: dhtml_menu.js
var oMenuTreeRoot;

function BuildMenuTree(SGML)
{
var oReader=new tag_reader(SGML);
var oMenuTree=new ListEntry("root","");
var tagname="";
var oMenuEntries=0;
var oTemp;

oReader.next();
while(oReader.eof()==false)
  {
  tagname=oReader.tag();

  if(tagname=="menu")
    {
    var oMenu=new ListEntry(oReader.property("name"),oReader.current_attributes);

    if(oMenuEntries!=0)
      {
      DeleteList(oMenuEntries);oMenuEntries=0;
      }
    while(oReader.eof()==false && oReader.tag()!="/menu")
        {
        if(oReader.tag()=="entry")
          {
          var oEntry=new ListEntry(oReader.property("name"),oReader.current_attributes);
          oEntry.data=oReader.tag_html();
          if(oMenuEntries==0)
            oMenuEntries=oEntry;
          else
            AddEntry(oMenuEntries,oEntry);
          }
        oReader.next();
        }
      if(oReader.tag()=="/menu")
        {
        oMenu.children=oMenuEntries;
        oMenuEntries=0;
        AddEntry(oMenuTree,oMenu);
        }
    }
  oReader.next();
  }
return oMenuTree;
}


function Build_HTML_Menus(oMenuTree,sMOVN)
{
if(oMenuTree==0 || oMenuTree==undefined)
	return "";	
var oTraverse=oMenuTree;
var X="";

var bVertical=true;
var iCount=0;
var sOID;
var iCellHeight=30;
oTraverse=oTraverse.next;
while(oTraverse!=0)
	{


    if(oTraverse.oname=="menu_root")
    	oTraverse=oTraverse.next;        
    
	sOID='div_'+oTraverse.get_property("name");
	X+='<div id="'+sOID+'" ';		
	X+='style="display:block; position: absolute; top:'+oTraverse.get_property("y")+'px; left:'+oTraverse.get_property("x")+'px;';	
	X+='visibility:';
	X+=(oTraverse.get_property("visible")=="1" ? "visible":"hidden")+";";
	X+='"'; // end style
	X+='>'; // end div
	
	bVertical=(oTraverse.get_property("dir")=="v");
	
	X+='<table name="table_'+oTraverse.get_property("name")+'" ';	
	if(oTraverse.get_property("class")!="")
		X+='class="'+oTraverse.get_property("class")+'" ';
	if(oTraverse.get_property("cellpadding")!="")
		X+='cellpadding="'+oTraverse.get_property("cellpadding")+'" ';
	if(oTraverse.get_property("cellspacing")!="")
		X+='cellspacing="'+oTraverse.get_property("cellspacing")+'" ';
	if(oTraverse.get_property("width")!="")
		X+='width="'+oTraverse.get_property("width")+'" ';
	if(oTraverse.get_property("cellheight")!="")
	  iCellHeight=parseInt(oTraverse.get_property("cellheight"));
	if(oTraverse.get_property("border")!="")
		{
		X+='border="'+oTraverse.get_property("border")+'" ';
		if(oTraverse.get_property("border")=="0")			
			X+='style="border-collapse: collapse;" ';			
		}
	X+=">";
	
	
	if(oTraverse.children!=0)
		{
		var oTraverseChildren=oTraverse.children;
		var sEDIT="";
		var iPos;
		var q="'";
		var iTop=0;
		var	sCloseMenu=sMOVN+'.closemenu("");';
		if(bVertical==false) X+="<tr>";
		while(oTraverseChildren!=0)
			{

				if(bVertical) X+="<tr>";
				X+='<td>';
				X+='<div id="td_div_'+oTraverseChildren.get_property("name")+'">';

				sEDIT=oTraverseChildren.data;
				
					var sMouseOver="";
					var sMouseOut="";					
					var sMenuOpen=oTraverseChildren.get_property("popup");

					if(sMenuOpen!="")					
						sMouseOver+=sMOVN+'.openmenu("'+sOID+'","div_'+sMenuOpen+'",('+iTop+'));';					
					else
						sMouseOver+=sMOVN+'.mi("'+sOID+'");';
					sMouseOut+=sMOVN+'.mo("'+sOID+'");';						

					sEDIT=ReplaceAll(sEDIT,"%CM",sCloseMenu);
                    sEDIT=ReplaceAll(sEDIT,"%MI",sMouseOver);
                    sEDIT=ReplaceAll(sEDIT,"%MO",sMouseOut);					                
				
				X+=sEDIT;
				X+='</div>';			
				X+="</td>";
				if(bVertical) X+="</tr>";
            iTop+=iCellHeight;
			oTraverseChildren=oTraverseChildren.next;
			}
		if(bVertical==false) X+="</tr>";

		}
		
	X+="</table></div>";
    
	oTraverse=oTraverse.next;
	iCount++;
	}
return X;
}

function MenuStack(iSize,sObjectName)
{
// sObjectName supplies the instantiated variable name for callbacks, etc, eg. oMenuStack
this.mstack=new Array(iSize);
this.mopened=new Array(iSize);
this.mpos=0;
this.current_oMenu=null;
this.oLastOpenedMenu=null;
this.msize=iSize;
this.bOnEntry=false;
this.objectname=sObjectName;
this.timer_id=setTimeout(sObjectName+".HeartBeat()",250); // come back here 
this.timer_expire=0;
this.timer_expire_seconds=1; // if not on an entry for this many seconds, then close menues
this.sMenuOpenScript=""; // script to execute before each menu open
this.HeartBeat=fn_heartbeat;
this.find_menudepth=fn_menudepth;
this.hide_children=fn_hidechildren;
this.prune=fn_prune;
this.openmenu=fn_openmenu;
this.openmenu_ex=fn_openmenu_ex;
this.closemenu=fn_closemenu;
this.queryclosemenu=fn_queryclosemenu;
this.mi=fn_mouseover;
this.mo=fn_mouseout;


var i=0;
for(i=0;i<this.msize;i++)
	{
	this.mstack[i]=null;
	this.mopened[i]="";
	}
	
function fn_heartbeat()
	{
	if(this.timer_expire>0 && TimeInSeconds()>this.timer_expire)
	  {
	  if(this.bOnEntry==false)
	    {// close menues		
		this.closemenu("");
		this.timer_expire=0;
		}
	  }
	this.timer_id=setTimeout(sObjectName+".HeartBeat()",250); // come back here 
	}
	
function fn_hidechildren(oMenu)
	{
	var Slot=this.find_menudepth(oMenu);		
	if(Slot<0)
		return;
	if(this.mopened[Slot]!="")
		{
		var oChild=oRef(this.mopened[Slot]);
		oChild.style.visibility='hidden';
		this.hide_children(oChild);
		this.mopened[Slot]="";
		}
	}
	
function fn_menudepth(oFind)
	{
	var i=0;
	for(i=0;i<this.msize;i++)
		{
		if(this.mstack[i]==oFind)
			return i;
		}
	return -1;
	}
	
function fn_prune(iDepth)
	{
	var i=iDepth;	
	if(i<0)
	  return;	
	
	for(;i<this.msize;i++)
		{		
		if(this.mstack[i]!=null && this.mstack[i]!=undefined)
			{			
			this.mstack[i].style.visibility='hidden';
			this.mstack[i]=null;
			}
		}
	this.mpos=i;
	}
	
function fn_openmenu_ex(sOID_Parent,sOID,iOffsetX,iOffsetY)
	{
	// used to open a child menu from an always visible menu
	var oMenu_Parent=oRef(sOID_Parent);
	if(oMenu_Parent==null)
		return;			
		
	var oMenu_Child=oRef(sOID);
	if(oMenu_Child==null)
		return;
	
	var iChildX=parseInt(oMenu_Parent.style.left)+iOffsetX;
	var iChildY=parseInt(oMenu_Parent.style.top)+iOffsetY;			
	
	this.closemenu("");		
	
	var Slot_Child=this.find_menudepth(oMenu_Child);
	if(Slot_Child<0)
	  {
	  this.mstack[this.mpos++]=oMenu_Child;
	  if(this.mpos>=this.msize) 
		this.mpos=this.msize-1;
	  Slot_Child=this.find_menudepth(oMenu_Child);	  
	  }
	
	oMenu_Child.style.left=iChildX;
	oMenu_Child.style.top=iChildY;
	oMenu_Child.style.visibility='visible';		
	if(this.sMenuOpenScript!="")
		eval(this.sMenuOpenScript);
	this.bOnEntry=true;
	}
		
function fn_openmenu(sOID_Parent,sOID,iTop)
	{	
	var oMenu_Parent=oRef(sOID_Parent);
	if(oMenu_Parent==null)
		return;	
	
	
	var oMenu_Child=oRef(sOID);
	if(oMenu_Child==null)
		return;	
		
	
	var iChildX=parseInt(oMenu_Parent.style.left)+oMenu_Parent.offsetWidth;
	var iChildY=parseInt(oMenu_Parent.style.top)+iTop;
	
		
	var Slot_Parent=this.find_menudepth(oMenu_Parent);
	if(Slot_Parent<0)
	  {
	  this.mstack[this.mpos++]=oMenu_Parent;
	  if(this.mpos>=this.msize) 
		this.mpos=this.msize-1;
	  Slot_Parent=this.find_menudepth(oMenu_Parent);	  
	  }
	  
	var Slot_Child=this.find_menudepth(oMenu_Child);
	if(Slot_Child<0)
	  {
	  this.mstack[this.mpos++]=oMenu_Child;
	  if(this.mpos>=this.msize) 
		this.mpos=this.msize-1;
	  Slot_Child=this.find_menudepth(oMenu_Child);	  
	  }	
	  
	// Display child menu, only one child visible per parent
	var oChild=oRef(this.mopened[Slot_Parent]);
	if(oChild!=null)
		{		
		oChild.style.visibility='hidden'; // and any children it may have
		this.hide_children(oChild);
		}
	oMenu_Child.style.left=iChildX+4;
	oMenu_Child.style.top=iChildY;
	oMenu_Child.style.visibility='visible';	
	this.mopened[Slot_Parent]=sOID;	
	
	if(this.sMenuOpenScript!="")
		eval(this.sMenuOpenScript);
	this.bOnEntry=true;
	
	}
function fn_queryclosemenu(sOID)
	{
	var oMenu=oRef(sOID);
	
	if(oMenu==null) return;
	if(this.current_oMenu!=oMenu)
		return;
	if(this.bOnEntry==true)
		{
		return;
		}
	this.closemenu(sOID);
	}
function fn_closemenu(sOID)
	{	
	var oMenu=oRef(sOID);
	var i=0;
	if(oMenu==null)
		{		
		for(i=0;i<this.msize;i++)
			{
			if(this.mstack[i]!=null)
				{
				this.mstack[i].style.visibility='hidden';
				this.hide_children(this.mstack[i]);
				}
			}
		// this.mpos=0;
		return;
		}
	
	for(i=0;i<this.mpos;i++)
		{
		if(this.mstack[i]==oMenu)
			{
			var j;
			for(j=i;j<this.mpos;j++)
				{
				if(this.mstack[j]!=null)
					{
					 this.mstack[j].style.visibility='hidden';
					 this.mstack[j]=null;
					}
				}
			this.mpos=i-1;
			if(this.mpos<0)
				this.mpos=0;
			this.current_oMenu=this.mstack[this.mpos];
			return;
			}
		}
	}
function fn_mouseover(sOID)
	{	
	var oMenu=oRef(sOID);		
	
	if(oMenu==null)		
		return;	
		
	this.bOnEntry=true;
	iDepth=this.find_menudepth(oMenu);
	if(iDepth<0)
		iDepth=0;
		
	this.current_oMenu=oMenu;	
	
	}
function fn_mouseout(sOID)
	{
	
	var oMenu=oRef(sOID);
	
	if(oMenu==null) return;
	this.bOnEntry=false;
	this.timer_expire=TimeInSeconds()+this.timer_expire_seconds;
	// setTimeout(this.objectname+'.queryclosemenu("'+sOID+'")',2000);	
	}
}

// end: dhtml_menu.js

// start: shopping cart stuff


function ShoppingCart(sName)
	{
	// shopping cart constructor	
	this.sName=sName;
	this.oList=new ListEntry("root","");
	this.oInventoryWarehouse=null;
	this.oIndex=null;
	this.iItemCount=0;
	this.sCartPropertyFilter="";
	// methods
	this.Add=fn_add_item_to_cart;
	this.Remove=fn_remove_item_from_cart;
	this.Empty=fn_empty_cart;
	this.Count=fn_count_cart_items;
	this.Change=fn_change_cart_item;
	this.Get=fn_get_cart_item;
	this.SelectItem=fn_select_cart_item;
	this.Save=fn_save_shopping_cart;
	this.Load=fn_load_shopping_cart;
	this.Evaluate=fn_evaluate;
	this.o_enum_current=undefined;
	this.FindFirst=fn_find_first;
	this.FindNext=fn_find_next;	
	this.SetWarehouse=fn_set_warehouse;
	this.BuildIndex=fn_build_index;
	this.ItemInCart=fn_item_in_cart;
	this.ClearIndex=fn_clear_index;
	this.SetPropertiesFilter=fn_set_properties_filter;
	// variables
	this.oSelected=undefined;	
	function fn_set_properties_filter(SF)
	   {
	   this.sCartPropertyFilter=SF;
	   }
	function fn_clear_index()
		{
		if(this.oIndex!=null)
			{
			delete this.oIndex;
			this.oIndex=null;
			}
		}
	
	function fn_build_index()
		{
		if(this.oIndex!=null)
			{
			delete this.oIndex;
			this.oIndex=null;
			}
		this.oIndex=new Array();
		var x=0;
		var y=0;
		var oTraverse=this.oList;
		while(oTraverse!=0)
			{			
			this.oIndex[x++]=oTraverse;			
			oTraverse=oTraverse.next;
			}
		// sort
		var bDone=false;
		var oHold;
		this.iItemCount=x;
		while(bDone==false)
			{
			bDone=true;
			for(y=0;y<(x-1);y++)
				{
				
				if(this.oIndex[y].oname>this.oIndex[y+1].oname)
					{
					oHold=this.oIndex[y]; this.oIndex[y]=this.oIndex[y+1]; this.oIndex[y+1]=oHold;
					bDone=false;
					}
				}
			}
		}
	function fn_item_in_cart(sItemCode)
		{
		if(this.oIndex==null)
			this.BuildIndex();
		
		// binary search	
		
		var hi=this.iItemCount;		
		
		if(hi==1)			
			return (this.oIndex[0].oname==sItemCode);			
		
		var lo=0;
		var x;
		var d;
		var bNF=false;
		d=Math.round(hi-lo);
		x=Math.round(lo+d/2);
		
		while(x!=lo && bNF==false)
			{
		
			bNF=(d==1);
			if(sItemCode==this.oIndex[x].oname)				
				return true;				
			else
			if(sItemCode>this.oIndex[x].oname)				
				lo=x;				
			else				
				hi=x;
			d=Math.round(hi-lo);
			x=Math.round(lo+d/2);			
			}		
		
		if(this.oIndex[0].oname==sItemCode)
			return true;
		return false;
		}	
	function fn_set_warehouse(obj)
		{
		this.oInventoryWarehouse=obj;
		}
	function fn_find_first()
		{
		this.o_enum_current=this.oList;
		return this.o_enum_current;
		}
	function fn_find_next()
		{
		if(this.o_enum_current.next==0 || this.o_enum_current.next==undefined)
			return undefined;
		this.o_enum_current=this.o_enum_current.next;
		return this.o_enum_current;
		}
	function fn_add_item_to_cart(sItemCode,sProperties,sListedProperties)
		{		
		
		var S=sProperties;
		if(this.oInventoryWarehouse!=null)
			{			
			var oEntry=this.oInventoryWarehouse.Get(sItemCode);
			if(oEntry!=undefined)
				S=oEntry.properties;
			else
				{		
				return false;
				}
			}
			
		if(sListedProperties=="")
		  sListedProperties=this.sCartPropertyFilter;
			
		if(sListedProperties!="" && sListedProperties!="[load]")
			{
			var sFiltered="",aProperties=sListedProperties.split(";"),x=0,spv;
			for(x=0;x<aProperties.length;x++)	
				{
				spv=oEntry.get_property(aProperties[x]);				
				if(spv.length>0)
					sFiltered+=aProperties[x]+"=\""+spv+"\" ";
				}
			S=sFiltered;			
			}		
		
		var oListEntry=GetNamed(this.oList,sItemCode);
		if(oListEntry!=undefined)
			{
			// alert("shoppingcart already in cart - not added: "+sItemCode);
			return false;
			}		
			
		// Add any properties included with the call to add properties
		if(sListedProperties!="" && sListedProperties!="[load]")
            {
            var alist=sListedProperties.split(";"),iEnum=0;				
    		var iEnum=0;
				
	       	for(iEnum=0;iEnum<alist.length;iEnum++)	
               {				

               S=properties_put(S,alist[iEnum],properties_get(S,alist[iEnum]));

			   // oListEntry.set_property(alist[iEnum],this.oList.get_property(alist[iEnum]));									
			   }
	        }
	        
        if(sListedProperties=="[load]")
            S=sProperties;		
            

		
		oListEntry=new ListEntry(sItemCode,S);
		
		
		if(AddEntry(this.oList,oListEntry)==true) // Modify later for sorted entry, in the case of carts with many entries
			{			
			this.ClearIndex();
			this.iItemCount++;
			}
		
		return true;
		}
	function fn_remove_item_from_cart(sItemCode)
		{
		if(DeleteNamed(this.oList,sItemCode)==true)			
			{
			this.ClearIndex();
			this.iItemCount=(this.iItemCount>0) ? (this.iItemCount-1):0;			
			return true;
			}
		return false;
		}
	function fn_empty_cart()
		{
		DeleteList(this.oList);
		this.ClearIndex();
		this.iItemCount=0;
		}
	function fn_count_cart_items(bIncludeChildren)
		{
		var oTraverse=this.oList;
		var iCount=0;
		while(oTraverse!=0)
			{		    
			if(bincludeChildren==true && oTraverse.children!=0)
				{
				var oTraverseChildren=oTraverse.children;
				while(oTraverseChildren!=0)
					{        
					iCount++;
					oTraverseChildren=oTraverseChildren.next;					
					}
				}
			iCount++;
			oTraverse=oTraverse.next;
			}
		return iCount;
		}
	function fn_change_cart_item(sItemCode,sKey,sValue)
		{
		var oListEntry=undefined;
		if(sItemCode=="" && this.oSelected!=undefined)
			oListEntry=this.oSelected;
		else
			oListEntry=GetNamed(this.oList,sItemCode);
			
		if(oListEntry==undefined)
			return false;
		oListEntry.set_property(sKey,sValue);
		return true;
		}
	function fn_get_cart_item(sItemCode,sKey)
		{
		var oListEntry=undefined;
		if(sItemCode=="" && this.oSelected!=undefined)
			oListEntry=this.oSelected;
		else
			oListEntry=GetNamed(this.oList,sItemCode);
			
		if(oListEntry==undefined)
			return "";
		
		return oListEntry.get_property(sKey);
		}
	function fn_select_cart_item(sItemCode)
		{
		this.oSelected=GetNamed(this.oList,sItemCode);
		}
	function fn_save_shopping_cart()
		{		
		var oTraverse=this.oList;
		var sList="";
		while(oTraverse!=0)
			{
			sList+="{";
			sList+=oTraverse.oname;
			sList+="/";
			sList+=oTraverse.properties;			
			if(oTraverse.children!=0)
				{
				var oTraverseChildren=oTraverse.children;
				while(oTraverseChildren!=0)
					{
					sList+="[";
					sList+=oTraverseChildren.oname;
					sList+="/";
					sList+=oTraverseChildren.properties;
					sList+="]";
					oTraverseChildren=oTraverseChildren.next;
					}
				}
			sList+="}";
			oTraverse=oTraverse.next;
			}
		
		var X="";
		X=SETENVSTR(X,"CART",sList);  
		SaveSettings(this.sName,X);				
		}		
	
		
	function fn_evaluate(sItemCode,sExpression)
		{
		var oTraverse=this.oList;
		var sEval;
		var sFind;
		var result=0;
		var x;		
		
		while(oTraverse!=0)
			{				
			if(sItemCode=="" || sItemCode==oTraverse.oname)
				{
				
				sEval="";x=0;
				while(x<sExpression.length)
					{					
					if(sExpression[x]=='"')
						{
						sFind=""; x++;
						while(x<sExpression.length && sExpression[x]!='"')
							sFind+=sExpression[x++];
						
						sEval+=oTraverse.get_property(sFind);
						x++;
						}
					else
						sEval+=sExpression[x++];
					}
				
				try
					{
					result+=eval("("+sEval+")");
					}
				catch(e)
					{					
					}
				
				}
			oTraverse=oTraverse.next;
			
			}
		return result;
		}
		
	function fn_load_shopping_cart()
		{
		var X=LoadSettings(this.sName,"");
		var sCart=GETENVSTR(X,"CART");		
		
		var iEnd=-1;		
		var sValue;
		var sArray;		
		
		var iPos=sCart.indexOf("{");
		if(iPos<0)
			return false;
		
		this.Empty(); // empty the cart
		
		while(iPos>=0)
			{
			iEnd=sCart.indexOf("}",iPos);
			sValue=sCart.substring(iPos+1,iEnd);				
			sCart=sCart.substring(iEnd);			
			iPos=sCart.indexOf("{");
			sArray=sValue.split("/");			
			this.Add(sArray[0],sArray[1],"[load]");	
			}
		}
	}
	
function InventoryWarehouse()
	{
	this.oList=new ListEntry("root","");
	this.oIndex=null;
	this.iItemCount=0;
	// methods
	this.Add=fn_add_item_to_warehouse;
	this.Remove=fn_delete_item_from_warehouse;
	this.BuildIndex=fn_build_index;
	this.Get=fn_get_warehouse_item;
	function fn_add_item_to_warehouse(sItemCode,sProperties)
		{
		if(AddEntry(this.oList,new ListEntry(sItemCode,sProperties)))
			{
			if(this.oIndex!=null)
				{
				delete this.oIndex;
				this.oIndex=null;
				}
			this.iItemCount++;
			return true;
			}
		return false;
		}
	function fn_delete_item_from_warehouse(sItemCode)
		{
		if(DeleteNamed(this.oList,sItemCode))
			{
			if(this.oIndex!=null)
				{
				delete this.oIndex;
				this.oIndex=null;
				}
			this.iItemCount--;
			return true;
			}
		return false;
		}
	function fn_build_index()
		{
		if(this.oIndex!=null)
			{
			delete this.oIndex;
			this.oIndex=null;
			}
		this.oIndex=new Array();
		var x=0;
		var y=0;
		var oTraverse=this.oList;
		while(oTraverse!=0)
			{			
			this.oIndex[x++]=oTraverse;			
			oTraverse=oTraverse.next;
			}
		// sort
		var bDone=false;
		var oHold;
		while(bDone==false)
			{
			bDone=true;
			for(y=0;y<(x-1);y++)
				{
				
				if(this.oIndex[y].oname>this.oIndex[y+1].oname)
					{
					oHold=this.oIndex[y]; this.oIndex[y]=this.oIndex[y+1]; this.oIndex[y+1]=oHold;
					bDone=false;
					}
				}
			}
		}
	function fn_get_warehouse_item(sItemCode)
		{
		if(this.oIndex==null)
			this.BuildIndex();
		// binary search
		var hi=this.iItemCount;
		var lo=0;
		var x;
		var d;
		var bNF=false;
		d=Math.round(hi-lo);
		x=Math.round(lo+d/2);
		while(x!=lo && bNF==false)
			{
			bNF=(d==1);
			if(sItemCode==this.oIndex[x].oname)				
				return this.oIndex[x];				
			else
			if(sItemCode>this.oIndex[x].oname)				
				lo=x;				
			else				
				hi=x;
			d=Math.round(hi-lo);
			x=Math.round(lo+d/2);			
			}
		
		if(this.oIndex[0].oname==sItemCode)
			return this.oIndex[0];
		return undefined;
		}
	}
	
	function ListEntryRenderer(ObjName,oWarehouse,oCart)
		{		
		
		this.sObjName=ObjName;
		this.oWarehouse=oWarehouse;
		this.oCart=oCart;
		this.iEntriesRendered=0;
		this.ENTRIES_HEADER="<div id=\"div_entries\" style=\"display:block;visibility:visible;\">";
		this.ENTRIES_FOOTER="</div>";
		
		this.START="";
		this.END="";		
		
		this.sCartPropertyFilter="";
		this.sListbox_BEG="";		
		this.sListbox_Entry="";
		this.sListbox_END="";		
		// 
		this.sRadiobutton_BEG="";		
		this.sRadiobutton_Entry="";
		this.sRadiobutton_END="";		
		
		// %1="checked"|""
		// %2="radioseriesname"
		
		this.sCheckbox_BEG="";		
		this.sCheckbox_Entry="";
		this.sCheckbox_END="";
		
		this.sTextarea_BEG="";		
		this.sTextarea_Entry="";		
		this.sTextarea_END="";
		
		this.sMain_BEG="";		
		this.sMain_Entry="";
		this.sMain_END="";		
		
		this.sReplaceValues="%CIL/itemlabel;%CIT/itemtext;%CDL/desclabel;%CDT/desctext;%CTT/titletext;%CUL/unitlabel;%CUT/unittext;%CRB/radbtn;%CFSRB/fsradbtn;%CCB/chkbox;%CLB/lstbox;%CTA/txarea;%LNXCRB/rblnk;%LNXCLB/lblnk;%LNXCTA/talnk;%LNXCA2C/a2clnk;;%LNXCCB/cblnk;%CTN/tnimage;%CNTD/tdnote;%CNBCAN/nbcan;%CNBACC/nbacc;%CPNFO/tdnfo;%LNXDET/detlnk;";
		
		
		this.oList=null;
		this.oListLocal=null;
		this.sName="";
		this.sMode="";
		this.bAddToCart=true;
		this.bReadOnly=false;
		
		// methods
		this.RenderItem=fn_render_item;
		this.RenderCheckboxes=fn_render_cb;
		this.RenderRadiobuttons=fn_render_rb;
		this.RenderListbox=fn_render_lb;
		this.RenderTextarea=fn_render_ta;
		this.SetName=fn_set_name;
		this.SetListObject=fn_list_object;
		this.SetInfo=fn_set_info;
		this.SetWarehouse=fn_set_warehouse_object;
		this.TLI=fn_toggle_list_item;
		this.SLI=fn_select_list_item;
		this.SV=fn_set_value;		
		this.SNOTE=fn_set_note;
		this.AddToCart=fn_add_to_cart;
		this.ReplaceValues=fn_replace_values;
		this.SetMode=fn_set_mode;
		this.SetStart_HTML=fn_set_start_html;
		this.SetEnd_HTML=fn_set_end_html;
		this.SetHeader=fn_set_header;
		this.SetFooter=fn_set_footer;
		this.Close=fn_close;
		this.ToString=fn_to_string;
		function fn_close()
		  {
		  return this.ENTRIES_FOOTER;
		  }
		function fn_set_header(sHTML)
		  {
		  this.ENTRIES_HEADER=sHTML;
		  }
  		function fn_set_footer(sHTML)
		  {
		  this.ENTRIES_FOOTER=sHTML;
		  }
		function fn_set_start_html(sHTML)
			{
			this.START=sHTML;
			}
		function fn_set_end_html(sHTML)
			{
			this.END=sHTML;
			}
		function fn_set_mode(sMode)
			{
			this.iEntriesRendered=0;
			if(sMode=="inventory")
				{				
				this.sMode=sMode;
				this.bAddToCart=true;
				this.bReadOnly=false;
				this.sCartPropertyFilter="tasks_cb_b;priority_rb_b;purpose_lb_b;rate;labor;comment;cat";
				this.oCart.SetPropertiesFilter(this.sCartPropertyFilter);
				this.sListbox_BEG="<div id=\"div_%N_lb\" style=\"display:none;visibility:visible;\">";
				this.sListbox_BEG+="<table><tr><td width=\"30\"></td><td><select %D class=\"%CLB\" size=\"1\" name=\"%0\">";
				this.sListbox_Entry="<option %D %0 onclick='"+this.sObjName+".SLI(\"%PN\",\"%PR_lb_b\",%SER);'>%1</option>";
				this.sListbox_END="</td></tr></table></select></div>";		
				// 
		
				this.sRadiobutton_BEG="<div id=\"div_%N_rb\" style=\"display:none;visibility:visible;\">";
				this.sRadiobutton_BEG+="<table><tr><td width=\"30\"></td><td><fieldset class=\"%CFSRB\"><legend>%0</legend>";
				this.sRadiobutton_Entry="<input class=\"%CRB\" %D type=\"radio\" value=\"%0\" %1 name=\"%2\" onclick='"+this.sObjName+".SLI(\"%PN\",\"%PR_rb_b\",%SER);'>%3<br>";
				this.sRadiobutton_END="</fieldset></td></tr></table></div>";		
		
				// %1="checked"|""
				// %2="radioseriesname"
		
				this.sCheckbox_BEG="<div id=\"div_%N_cb\" style=\"display:none;visibility:visible;\">";
				this.sCheckbox_BEG+="<table><tr><td width=\"30\"></td><td></td></tr>";
				this.sCheckbox_Entry="<tr><td></td><td><input class=\"%CCB\" %D type=\"checkbox\" name=\"%0\" value=\"\" %1 onclick='"+this.sObjName+".TLI(\"%PN\",\"%PR_cb_b\",%SER);'>%2</input></td></tr>";
				this.sCheckbox_END="</table></div>";
		
				this.sTextarea_BEG="<div id=\"div_%N_ta\" style=\"display:none;visibility:visible;\">";
				this.sTextarea_BEG+="<table><tr><td width=\"30\"></td><td></td></tr>";
				this.sTextarea_Entry="<tr><td></td><td><textarea class=\"%CTA\" %D rows=\"12\" name=\"%0_value\" cols=\"40\">%1</textarea></td><td class=\"%CNTD\">Please enter any additional details, questions, or instructions in the text box to the left.  At Regivision Computer Consulting we take pride in our ability to provide you with the outstanding service that you deserve.</td></tr>";
				this.sTextarea_Entry+="<tr><td></td><td><input class=\"%CNBACC\" %D type=\"button\" value=\"Accept\" name=\"%0_B3\" onclick='"+this.sObjName+".SNOTE(\"%PN\",\"%PR\",%0_value.value);otd(\"div_%N_ta\");'><input class=\"%CNBCAN\" type=\"button\" value=\"Cancel\" name=\"%0_B4\" onclick='otd(\"div_%N_ta\");'><td></td></tr>";
				this.sTextarea_END="</table></div>";
		
				this.sMain_BEG="<table>";		
				this.sMain_Entry="<tr><td><span class=\"%CTN\"><img src=\"%2\"></span></td><td class=\"%CPNFO\"><font class=\"%CTT\">%0</font></td></tr>";
				this.sMain_Entry+="<tr><td></td><td><font class=\"%CIL\">Item:</font>&nbsp;<font class=\"%CIT\">%7</font></td></tr>";		
				this.sMain_Entry+="<tr><td></td><td><font class=\"%CDL\">Description:</font>&nbsp;<font class=\"%CDT\">%1</font></td></tr>";		
				this.sMain_Entry+="<tr><td></td><td><font class=\"%CUL\">Unit Rate:</font>&nbsp;<font class=\"%CUT\">$%4</font></td><td></td></tr>";		
				this.sMain_END="</table>";		
				}
			else
			if(sMode=="cart")
				{				
				this.sMode=sMode;
				this.bAddToCart=false;
				this.bReadOnly=true;
				this.sCartPropertyFilter="tasks_cb_b;priority_rb_b;purpose_lb_b;rate;labor;comment;cat";
				this.oCart.SetPropertiesFilter(this.sCartPropertyFilter);

				this.sListbox_BEG="<div id=\"div_%N_lb\" style=\"display:none;visibility:visible;\">";
				this.sListbox_BEG+="<table><tr><td width=\"30\"></td><td><select %D class=\"%CLB\" size=\"1\" name=\"%0\">";
				this.sListbox_Entry="<option %D %0 onclick='"+this.sObjName+".SLI(\"%PN\",\"%PR_lb_b\",%SER);'>%1</option>";
				this.sListbox_END="</td></tr></table></select></div>";		
				// 
		
				this.sRadiobutton_BEG="<div id=\"div_%N_rb\" style=\"display:none;visibility:visible;\">";
				this.sRadiobutton_BEG+="<table><tr><td width=\"30\"></td><td><fieldset class=\"%CFSRB\"><legend>%0</legend>";
				this.sRadiobutton_Entry="<input class=\"%CRB\" %D type=\"radio\" value=\"%0\" %1 name=\"%2\" onclick='"+this.sObjName+".SLI(\"%PN\",\"%PR_rb_b\",%SER);'>%3<br>";
				this.sRadiobutton_END="</fieldset></td></tr></table></div>";		
		
				// %1="checked"|""
				// %2="radioseriesname"
		
				this.sCheckbox_BEG="<div id=\"div_%N_cb\" style=\"display:none;visibility:visible;\">";
				this.sCheckbox_BEG+="<table><tr><td width=\"30\"></td><td></td></tr>";
				this.sCheckbox_Entry="<tr><td></td><td><input class=\"%CCB\" %D type=\"checkbox\" name=\"%0\" value=\"\" %1 onclick='"+this.sObjName+".TLI(\"%PN\",\"%PR_cb_b\",%SER);'>%2</input></td></tr>";
				this.sCheckbox_END="</table></div>";
		
				this.sTextarea_BEG="<div id=\"div_%N_ta\" style=\"display:none;visibility:visible;\">";
				this.sTextarea_BEG+="<table><tr><td width=\"30\"></td><td></td></tr>";
				this.sTextarea_Entry="<tr><td></td><td><textarea class=\"%CTA\" %D rows=\"12\" name=\"%0_value\" cols=\"40\">%1</textarea></td><td class=\"%CNTD\">%DESC</td></tr>";
				this.sTextarea_Entry+="<tr><td></td><td><input class=\"%CNBCAN\" type=\"button\" value=\"Hide\" name=\"%0_B4\" onclick='otd(\"div_%N_ta\");'><td></td></tr>";
				this.sTextarea_END="</table></div>";
		
				this.sMain_BEG="<table>";		
				this.sMain_Entry="<tr><td></td><td class=\"%CPNFO\"><font class=\"%CTT\">%0</font></td><td><span class=\"%LNXDET\"><a href=\"javascript:;\" onclick=\"otd(\'div_iopt_%N\');\">Details</a></span></td></tr>";				
				this.sMain_Entry+="<tr><td></td><td><font class=\"%CUL\">&nbsp;&nbsp;Unit Rate:</font>&nbsp;<font class=\"%CUT\">$%4</font></td><td></td><td></td></tr>";		
				this.sMain_END="</table>";		
				}
			}
		function fn_replace_values(S,sKeyValues)
			{
			// Key Value pairs are separated with /
			var akv=sKeyValues.split(";");
			var x,kv,k,v,iPos;
			for(x=0;x<akv.length;x++)
				{
				kv=akv[x];
				iPos=kv.indexOf("/");
				if(iPos>=0)					
					{
					k=kv.substring(0,iPos); v=kv.substring(iPos+1);										
					S=ReplaceAll(S,k,v);					
					}
				}
			return S;
			}
		function fn_add_to_cart(sPN)
			{
			var obj=this.oWarehouse.Get(sPN);
			
			if(obj==null || obj==undefined)
				return false;
				
			if(this.oCart==null || this.oCart==undefined)
				return false;				
			
			var b=this.oCart.Add(sPN,obj.properties,this.sCartPropertyFilter);			
			if(b==true)
			  this.oCart.Save();
			return b;
			}
		function fn_set_value(sPN,sPR,sValue)
			{
			var obj=this.oWarehouse.Get(sPN);
			
			if(obj==null || obj==undefined)
				return false;

			b=obj.set_property(sPR,sValue);			
			
			return b;
			}
		function fn_set_note(sPN,sPR,sValue)
			{
			var obj=this.oWarehouse.Get(sPN);
			
			if(obj==null || obj==undefined)
				return false;
			
			b=obj.set_property(sPR,escape(sValue));			
			
			return b;
			}
		function fn_toggle_list_item(sPN,sPR,iOrd)
			{
			var obj=this.oWarehouse.Get(sPN);						
			if(obj==null || obj==undefined)
				return false;
			b=obj.toggle_property_list_item(sPR,iOrd);
			
			return b;
			}
		function fn_select_list_item(sPN,sPR,iOrd)
			{
			var obj=this.oWarehouse.Get(sPN);						
			if(obj==null || obj==undefined)
				return false;
			var v=obj.get_property(sPR);			
			v=ReplaceAll(v,"t","f");
			obj.set_property(sPR,v);
			
			b=obj.toggle_property_list_item(sPR,iOrd);			
			
			return b;
			}
		function fn_set_warehouse_object(obj)
			{
			this.oWarehouse=obj;
			}
		function fn_set_info(sName,oList)
			{			
			this.sName=sName;
			this.oList=oList;			
			}
		function fn_list_object(oList)
			{
			this.oList=oList;
			}
		function fn_set_name(sN)
			{
			this.sName=sN;			
			}
		
		function fn_render_item(scb,srb,slb,sta)
			{
			
			// %0 = Title
			// %1 = Description
			// %2 = Thumb Nail URL
			// %3 = Full Sized Image
			// %4 = price
			// %5 = labor
			// %6 = comment
			// %7 = product code
			
			this.oListLocal=this.oList;			
			
			if(this.sMode=="")
				{				
				this.SetMode("inventory");
				}
			
			if(this.sMode=="inventory")
				{
				this.oListLocal=this.oList;
				}
			else
			if(this.sMode=="cart")
				{
				var sProperties="";
				if(this.oWarehouse!=null)
					{
					var obj=this.oWarehouse.Get(this.oList.oname);
					if(obj==null)
						return;
					sProperties=obj.properties;
					}
				else
					return;				
				
				this.oListLocal=new ListEntry(this.oList.oname,sProperties);
				
				// set local properties
				var alist=this.sCartPropertyFilter.split(";"),iEnum=0;				
				
				for(iEnum=0;iEnum<alist.length;iEnum++)	
                    {				
					this.oListLocal.set_property(alist[iEnum],this.oList.get_property(alist[iEnum]));									
					}
				}
				
			var bAddToCart=this.bAddToCart,bReadOnly=this.bReadOnly;			
			
			var S="";
			if(this.iEntriesRendered==0)
    			 S+=this.ENTRIES_HEADER;

			S+="<div id=\"div_en_%N\" style=\"display:block;\">"+this.START+this.sMain_BEG;
			var R=this.sMain_Entry;			
			
			
			
			R=ReplaceAll(R,"%0",this.oListLocal.get_property("title"));
			R=ReplaceAll(R,"%1",this.oListLocal.get_property("desc"));
			R=ReplaceAll(R,"%2",this.oListLocal.get_property("tn"));
			R=ReplaceAll(R,"%3",this.oListLocal.get_property("img"));
			R=ReplaceAll(R,"%4",this.oListLocal.get_property("rate"));
			R=ReplaceAll(R,"%7",this.oListLocal.oname);			
			S+=R;
			S+=this.sMain_END;
			
			var sMF="",links_cb="",links_rb="",links_lb="",links_ta="";
			
			
			if(scb!="")
				{
				var cba=scb.split(";");
				var x,ss="",pr,gr,ipos;
				for(x=0;x<cba.length;x++)					
					{
					ipos=cba[x].indexOf("/");
					if(ipos>=0)
						{
						pr=cba[x].substring(0,ipos);
						gr=cba[x].substring(ipos+1);
						}
					else
						{
						pr=cba[x];gr="";
						}
					ss=this.RenderCheckboxes(pr);
					if(ss!="")
						{
						var xx="<span class=\"%LNXCCB\"><a href='javascript:;' onclick='otd(\"div_%N_cb\");'>"+gr+"</a></span><br>";
						xx=ReplaceAll(xx,"%N",this.sName+"_"+pr);
						links_cb+=xx;
						}
					sMF+=ss;
					}
				}
			if(srb!="")
				{
				var rba=srb.split(";");
				var x,pr,gr,ipos,ss="";				
				for(x=0;x<rba.length;x++)			
					{
					ipos=rba[x].indexOf("/");
					pr=rba[x].substring(0,ipos);
					gr=rba[x].substring(ipos+1);
					ss=this.RenderRadiobuttons(pr,gr);					
					if(ss!="")
						{
						var xx="<span class=\"%LNXCRB\"><a href='javascript:;' onclick='otd(\"div_%N_rb\");'>"+gr+"</a></span><br>";
						xx=ReplaceAll(xx,"%N",this.sName+"_"+pr);
						links_rb+=xx;
						}
					sMF+=ss;
					}
				}
			if(slb!="")
				{
				var lba=slb.split(";");
				var x,pr,gr,ipos,ss="";
				for(x=0;x<lba.length;x++)					
					{
					ipos=lba[x].indexOf("/");
					if(ipos>=0)
						{
						pr=lba[x].substring(0,ipos);
						gr=lba[x].substring(ipos+1);
						}
					else
						{
						pr=lba[x];gr="";
						}
					ss=this.RenderListbox(pr);
					if(ss!="")
						{
						var xx="<span class=\"%LNXCLB\"><a href='javascript:;' onclick='otd(\"div_%N_lb\");'>"+gr+"</a></span><br>";
						xx=ReplaceAll(xx,"%N",this.sName+"_"+pr);
						links_lb+=xx;
						}
					sMF+=ss;
					}
				}
			if(sta!="")
				{				
				var taa=sta.split(";");
				var x,pr,gr,ipos,ss="";
				for(x=0;x<taa.length;x++)					
					{
					ipos=taa[x].indexOf("/");
					if(ipos>=0)
						{
						pr=taa[x].substring(0,ipos);
						gr=taa[x].substring(ipos+1);
						}
					else
						{
						pr=taa[x];gr="";
						}					
					ss=this.RenderTextarea(pr);
					if(ss!="")
						{
						var xx="<span class=\"%LNXCTA\"><a href='javascript:;' onclick='otd(\"div_%N_ta\");'>"+gr+"</a></span><br>";
						xx=ReplaceAll(xx,"%N",this.sName+"_"+pr);
						links_ta+=xx;
						}
					sMF+=ss;
					}
				}
			var bInTheCart=false;
			
			
			
			var sCartIndicator="";
				
			var sRemoveItem=this.sObjName+".oCart.Remove(\"%PN\");"+this.sObjName+".oCart.Save();";			
			var sItemOptions="<div id=\"div_iopt_%N\" style=\"position:relative; top:0px; visibility:visible; display:"+(this.sMode=="cart" ? "none":"block")+";\"><table>";
			if(this.sMode=="inventory")
				{
				if(this.oCart!=null)
					bInTheCart=this.oCart.ItemInCart(this.oListLocal.oname);				
				sCartIndicator="<div id=\"div_ct_%N\" style=\"position:relative; top:0px; visibility:"+(bInTheCart ? "visible":"hidden")+"; display:block;\"><img src=\"content/icon_cart.gif\" style=\"border:none;\"></div>";
				sItemOptions+="<tr><td width=\"30\"></td><td></td><td></td><td></td><td></td><td>"+sCartIndicator+"</td></tr>";
				}
			sItemOptions+="<tr><td width=\"30\"></td><td>"+links_cb+"</td><td>"+links_rb+"</td><td>"+links_lb+"</td><td>"+links_ta+"</td><td><span class=\"%LNXCA2C\"><div id=\"div_a2c_%N\" style=\"display:block; visibility:"+(bInTheCart ? "hidden":"visible")+";\"><a href=\"javascript:;\" onclick=\'"+(bAddToCart==true ? this.sObjName+".AddToCart(\"%PN\");oset_visibility(\"div_ct_%N\",\"visible\");oset_visibility(\"div_a2c_%N\",\"hidden\");":"oset_display(\"div_en_%N\",\"none\");"+sRemoveItem+";")+"\'>"+(bAddToCart==true ? "Add to Cart ":"Remove Item")+"</a></span><br></td></tr>";
			sItemOptions+="</table>";
			S+=sItemOptions;
			S+=sMF+"</div>";
			
			S+=this.END+"</div>";
			
			S=ReplaceAll(S,"%PN",this.oListLocal.oname);			
				
			S=this.ReplaceValues(S,this.sReplaceValues);			
			
			S=ReplaceAll(S,"%N",this.sName);
			
			S=ReplaceAll(S,"%D",(bReadOnly==true ? "disabled":""));			
				
			if(this.sMode=="cart")
				delete this.oListLocal;
            this.iEntriesRendered++;			
			return S;			
			}
function fn_to_string()
			{			
			this.oListLocal=this.oList;			

			if(this.sMode=="")
				{				
				this.SetMode("inventory");
				}
			
			if(this.sMode=="inventory")
				{
				this.oListLocal=this.oList;
				}
			else
			if(this.sMode=="cart")
				{
				
				var sProperties="";
				if(this.oWarehouse!=null)
					{
					var obj=this.oWarehouse.Get(this.oList.oname);
							
					if(obj==null)
						return;
					sProperties=obj.properties;
					}
				else
					return;				

				this.oListLocal=new ListEntry(this.oList.oname,sProperties);
				
				// set local properties
				var alist=this.sCartPropertyFilter.split(";"),iEnum=0;				
				
				for(iEnum=0;iEnum<alist.length;iEnum++)	
                    {				
					this.oListLocal.set_property(alist[iEnum],this.oList.get_property(alist[iEnum]));									
					}
				}			

			
			var S="";
			var R="";
            var iLaborMinutes=0;						
            var iMinLabor=0;
            var sMins="";
            var sRate="";
            var fCost=0.0;
			


			R+="Product: "+this.oListLocal.oname+"\n";
			R+="Title: "+this.oListLocal.get_property("title")+"\n";
			sRate=this.oListLocal.get_property("rate");
			R+="Rate: "+sRate+"\n";		
			sMins=this.oListLocal.get_property("min_labor");
			R+="Min Labor: "+sMins+"\n";						

			iMinLabor=parseInt(sMins,10);			

			R+="Tasks:\n";
			var n=0;
			var atasks_b=this.oListLocal.get_property("tasks_cb_b").split(";");
			var atasks_t=this.oListLocal.get_property("tasks_cb_t").split(";");
			var atasks_l=this.oListLocal.get_property("tasks_cb_l").split(";");
            for(n=0;n<atasks_b.length;n++)
                {
                if(atasks_b[n]=="t")
                    {
                    R+="  "+atasks_l[n]+":"+atasks_t[n]+"\n";
                    iLaborMinutes+=parseInt(atasks_l[n],10);
                    }
                }
                
            iLaborMinutes=(iMinLabor>iLaborMinutes) ? iMinLabor:iLaborMinutes;            
            fCost=parseFloat(sRate)*(iLaborMinutes/60.0);
            R+="Labor Minutes: "+iLaborMinutes+"\n";     
            R+="Estimated Cost: "+fCost+"\n";           

			R+="Priority:\n";                
            var apty_b=this.oListLocal.get_property("priority_rb_b").split(";");
			var apty_t=this.oListLocal.get_property("priority_rb_v").split(";");
            for(n=0;n<apty_b.length;n++)
                {
                if(apty_b[n]=="t")
                    R+="  "+apty_t[n]+"\n";
                }
                
            R+="Purpose:\n";                
            var apur_b=this.oListLocal.get_property("purpose_lb_b").split(";");
			var apur_t=this.oListLocal.get_property("purpose_lb_v").split(";");
            for(n=0;n<apur_b.length;n++)
                {
                if(apur_b[n]=="t")
                    R+="  "+apur_t[n]+"\n";
                }   
            R+="Comment:\n";
            R+=unescape(this.oListLocal.get_property("comment"))+"\n";            
            

            R+="===\n";

				
			if(this.sMode=="cart")
				delete this.oListLocal;
            this.iEntriesRendered++;
            R=ReplaceAll(R,"\n","<br>");			
			return R;			
			}
		function fn_render_cb(sCheckboxProperty)
			{
			var S=this.sCheckbox_BEG;
			var R=this.sCheckbox_Entry;
			var Prompts=this.oListLocal.get_property(sCheckboxProperty+"_cb_t");
			if(Prompts=="") 
				return "";
			var Values=this.oListLocal.get_property(sCheckboxProperty+"_cb_b");			
			var cb_prompts=Prompts.split(";");
			var cb_values=Values.split(";");			
			var n,E;		
			
			
			for(n=0;n<cb_prompts.length;n++)
				{
				E=R;								
				E=E.replace(new RegExp("%0"),this.sName+"_cb"+n);
				E=E.replace(new RegExp("%1"),(cb_values[n]=="t" ? "checked":""));
				E=E.replace(new RegExp("%2"),cb_prompts[n]);
				E=E.replace(new RegExp("%SER"),""+n);
				S+=E;					
				}
			S+=this.sCheckbox_END;						
			S=ReplaceAll(S,"%N",this.sName+"_"+sCheckboxProperty);
			S=ReplaceAll(S,"%PR",sCheckboxProperty);
			S=ReplaceAll(S,"%PN",this.oListLocal.oname);			
			return S;
			}
		function fn_render_ta(sTextareaProperty)
			{
			var S=this.sTextarea_BEG;
			var R=this.sTextarea_Entry;			
			
			var Value=this.oListLocal.get_property(sTextareaProperty);			
			
			var n,E;
			
			
			
			E=R;
			E=ReplaceAll(E,"%0",this.sName+"_ta"+n);
			E=ReplaceAll(E,"%1",unescape(Value));
			E=ReplaceAll(E,"%DESC",this.oListLocal.get_property("desc"));			
			S+=E;					
			
			
			S+=this.sTextarea_END;
			S=ReplaceAll(S,"%N",this.sName+"_"+sTextareaProperty);
			S=ReplaceAll(S,"%PR",sTextareaProperty);
			S=ReplaceAll(S,"%PN",this.oListLocal.oname);			
			return S;
			}
		function fn_render_rb(sRadiobuttonProperty,sGroupTitle)
			{
			var S=""
			var R=this.sRadiobutton_Entry;
			var Prompts=this.oListLocal.get_property(sRadiobuttonProperty+"_rb_t");
			if(Prompts=="") 
				return "";
			var Values=this.oListLocal.get_property(sRadiobuttonProperty+"_rb_b");			
			var rb_prompts=Prompts.split(";");
			var rb_values=Values.split(";");
			var n,E;
			
			S=this.sRadiobutton_BEG;
			S=S.replace(new RegExp("%0"),sGroupTitle);			
			for(n=0;n<rb_prompts.length;n++)
				{
				E=R;				
				E=ReplaceAll(E,"%0","");
				E=ReplaceAll(E,"%1",(rb_values[n]=="t" ? "checked":""));
				E=ReplaceAll(E,"%2",this.sName+"_rb");
				E=ReplaceAll(E,"%3",rb_prompts[n]);				
				E=ReplaceAll(E,"%SER",""+n);								
				S+=E;				
				}
			S+=this.sRadiobutton_END;
			S=ReplaceAll(S,"%N",this.sName+"_"+sRadiobuttonProperty);			
			S=ReplaceAll(S,"%PR",sRadiobuttonProperty);
			S=ReplaceAll(S,"%PN",this.oListLocal.oname);						
			return S;
			}
		function fn_render_lb(sListboxProperty)
			{
			var S="";
			var R=this.sListbox_Entry;
			var Prompts=this.oListLocal.get_property(sListboxProperty+"_lb_t");
			if(Prompts=="") 
				return "";
			var Values=this.oListLocal.get_property(sListboxProperty+"_lb_b");			
			var lb_prompts=Prompts.split(";");
			var lb_values=Values.split(";");
			var n,E;
			
			S=this.sListbox_BEG;
			S=S.replace(new RegExp("%0"),this.sName+"_lb");		

			
			for(n=0;n<lb_prompts.length;n++)
				{
				E=R;
				E=ReplaceAll(E,"%0",(lb_values[n]=="t" ? "selected":""));
				E=ReplaceAll(E,"%1",lb_prompts[n]);
				E=ReplaceAll(E,"%SER",""+n);				
				S+=E;
				}
			S+=this.sListbox_END;
			
			S=ReplaceAll(S,"%N",this.sName+"_"+sListboxProperty);
			S=ReplaceAll(S,"%PR",sListboxProperty);
			S=ReplaceAll(S,"%PN",this.oListLocal.oname);						
			
			return S;
			}
		}
// end: shopping cart stuff

// Dynamically Add An Element To a Parent object

function Divinator(oParent,sName)
   {
	var oDiv=oParent.createElement('div');
	if (oDiv==null)
		return null;		
	
	this.oParent=oParent;
	this.obj=oDiv;
	// this.obj.style="position:absolute; display:none; top:0px; left:0px; border:none;";
	this.obj.setAttribute('style','position:absolute; display:none; top:0px; left:0px; border:none;');
	this.id=sName;
	oParent.body.appendChild(oDiv);
	// interface
	this.innerHTML=fn_set_innerhtml;
	this.SetPos=fn_setpos;
	this.GetPosX=fn_getx;
	this.GetPosY=fn_gety;	
	this.display=fn_set_display;	
	this.style=fn_setstyle;
	
	function fn_setstyle(S)
		{
		try
			{
			this.obj.style=S;
			return true;
			}
		catch(e)
			{
			return false;
			}
		}
	
	function fn_set_display(S)
		{
		try
			{
			this.obj.style.display=S;
			return true;
			}
		catch(e)
			{
			return false;
			}
		}
	
	function fn_getx()
		{
		var x=0;
		try
			{
			x=ParseInt(this.obj.style.left);			
			}
		catch(e)
			{
			x=0;
			}
		return x;
		}
	function fn_gety()
		{
		var y=0;
		try
			{
			y=ParseInt(this.obj.style.left);			
			}
		catch(e)
			{
			y=0;
			}
		return y;
		}

	
	function fn_setpos(x,y)
		{
		try
			{
			this.obj.style.left=x & "px";
			this.obj.style.top=y & "px";
			return true;
			}
		catch(e)
			{
			return false;
			}
		}
	
	function fn_set_innerhtml(S)
		{
		this.obj.innerHTML=S;
		}
		
	return this;
   }