//
function miniCart(){
var prdCount = 0, prdString = "", subTotal = (xmlConfig.cartSubTotal > 0)?xmlConfig.cartSubTotal:0;
	if(xmlOHeader.childNodes.length==0) subTotal = 0;
	for(var i=0;i<xmlOHeader.childNodes.length;i++){
		prdCount = prdCount+(parseInt(xmlOHeader.childNodes[i].QuantityAmount));
		};
	prdString += "Produse in cos:<strong>&nbsp;" + prdCount + "</strong><br>";
	prdString += "Subtotal:<strong>&nbsp;" + TFormatCurrency(subTotal, objPriCurrency) + "</strong><br><br>";
	prdString += "<a class=\"WAGRUNAV\" href=\"orderform." + xmlConfig.fileExtension + "\">";
	prdString += "<strong>" + '<img src="assets/images/bullet.gif" width="15" height="11" alt="Bullet.gif" border="0" align="absmiddle" hspace="0" vspace="0" class="catnav">' + "Cosul de cumparaturi</strong></a>";
	return(prdString);
	};
//
var TNavDropDownIndent = ".."
//
function NavLinkedDropDownList(){
	return(TNavDropDownList(true));
	};
//
function NavDropDownList(){
	return(TNavDropDownList(false));
	};
//
function storeSearchParameters(optionValueArray){
var xmlSearchEngine = xmlConfig.getFirstItem("SearchEngine");
	if(optionValueArray[0]!="null"&&optionValueArray[0]!="nada"){
		xmlSearchEngine.categoryIndex = optionValueArray[0];
		xmlSearchEngine.categoryId = optionValueArray[2];
		xmlSearchEngine.ByCategory = "1";
		}
	else{
		xmlSearchEngine.categoryIndex = "null";
		xmlSearchEngine.categoryId = "null";
		xmlSearchEngine.ByCategory = "0";
		};
	};
//
function TNavDropDownList(asLink){
var rString = "";
var myNavIndex = "";
	if(asLink) myNavIndex = xmlConfig.navIndex;
	else myNavIndex = xmlConfig.getFirstItem("SearchEngine").categoryIndex;
	if(!(myNavIndex=="null"||myNavIndex=="")){ navigation[parseInt(myNavIndex)].active = true; };
	if(asLink) rString += "<select name=\"navselect\" onChange=\"changeLoc(this[this.selectedIndex].value.split(';;')[0],this[this.selectedIndex].value.split(';;')[1])\">"
	else rString += "<select name=\"navselect\" onChange=\"storeSearchParameters(this[this.selectedIndex].value.split(';;'))\">";
	rString += "<option value=\"nada;;start.htm;;null\">Categorii</option>";
	for(var i=0; i<navigation.length; i++){
		if(navigation[i].parentId==null){
			rString += TNavDropDownItem(navigation[i], "");
			};
		};
	rString += "</select>";
	return(rString);
	};
//
function TNavDropDownItem(navItem, cptPreFix){
var rString = "";
	rString += "<option value=\"" + navItem.id + ";;" + navItem.linkUrl + ";;" + navItem.categoryId + "\"";
	if(navItem.active) rString += " selected";
	rString += ">" + cptPreFix + navItem.caption + "</option>";
	for(var i=0; i<navigation.length;i++) if(navigation[i].parentId==navItem.id) rString += TNavDropDownItem(navigation[i], cptPreFix + TNavDropDownIndent);
	return(rString);	
	};
//
	function openItem(itemId){
	var objActiveItem = null;
		if(itemId!=null){
			objActiveItem = navigation[itemId];
			if(objActiveItem!=null){
				objActiveItem.open = true;
				openItem(objActiveItem.parentId);
				};
			};
		};
		
	function activateItem(itemId){
	var objActiveItem = null;
		if(itemId!=null){
			objActiveItem = navigation[itemId];
			if(objActiveItem!=null){
				objActiveItem.active = true;
				openItem(objActiveItem.parentId);
				};
			};
		};
		
	function itemHasSubelems(itemId){
		for(var i=0; i<navigation.length;i++) if(navigation[i].parentId==itemId) return(true);
		return(false);
		};
	
	function TNavLinkList(){
	var strHTML = "";
		for(var i=0; i<navigation.length; i++) if(navigation[i].parentId==null) strHTML += printItem(navigation[i], 0);
		return(strHTML);
		};	
		
	function printItem(navItem, depth){
	var strHTML = "";
	var elemWidth = 1;
		strHTML += '<table width="100%" class="CATLINKS1STPARENT" border="0" cellpadding="1" cellspacing="0" >';
		strHTML += "<tr>"
		for(var i=0; i<depth; i++){
			strHTML += "<td";
			if(navItem.active) strHTML += " class=\"ACTIVECATEGORY\""
			else strHTML += " class=\"CATLINKS1STBULLET\"";
			strHTML += ' width="1%"><img src="assets/images/spacer.gif" width="14" height="1" height="1" alt="" border="0"></td>';
			};
		if(navItem.active) strHTML += '<td width="1%" class="ACTIVECATEGORY"><img src="assets/images/bulletcatact.gif" width="14" height="11" alt="BulletCatAct.gif" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else if(navItem.open&&itemHasSubelems(navItem.id)) strHTML += '<td width="1%" class="CATLINKS1STBULLET"><img src="assets/images/bulletcat1stcls.gif" width="14" height="11" alt="BulletCat1stCls.gif" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		else strHTML += '<td width=\"1%\"><img src="assets/images/bulletcat1st.gif" width="14" height="11" alt="BulletCat1st.gif" border="0" align="bottom" hspace="0" vspace="0" class="catnav"></td>'
		strHTML += "<td";
		if(navItem.active) strHTML += " class=\"ACTIVECATEGORY\""
		else strHTML += " class=\"CATLINKS1STBULLET\"";
		strHTML += "width=\"" + ( 100 - ( depth + 1 ) ) + "%\">"
			+ "<a href=\"" + navItem.linkUrl + "?categoryId=" + escape(navItem.id) + "\" class=\"WAGRUNAV\">"
			+ navItem.caption
			+ "</a>"
			+ "</td>";
		strHTML += "</tr>"
		strHTML += "</table>"
		depth++;
		if(navItem.active||navItem.open){
			for(var i=0; i<navigation.length;i++) if(navigation[i].parentId==navItem.id) strHTML += printItem(navigation[i], depth);
			};
		return(strHTML);
		};


//

// navElem
	function navElem(id,caption,linkUrl,parentId,categoryId){
		this.id = id;
		this.caption = caption;
		this.linkUrl = linkUrl;
		this.parentId = parentId;
		this.active = false;
		this.open = true;
		this.categoryId = categoryId;
		};
// navigation
var navigation = new Array();
//
navigation[0] = new navElem(0,"20% Pret Redus&nbsp(47)","pi-1113243429.htm",null,"oferta");
navigation[1] = new navElem(1,"40% Pret Redus&nbsp(9)","pi-429428773.htm",null,"40%");
navigation[2] = new navElem(2,"AUTOart Design","pi-1046291636.htm",null,"AUTOartDes");
navigation[3] = new navElem(3,"Cadouri si accesorii&nbsp(9)","pi1159485996.htm",2,"Cadouri si");
navigation[4] = new navElem(4,"Machete auto ","pi-1716505219.htm",null,"Machete au");
navigation[5] = new navElem(5,"AUTOart &nbsp(14)","pi-1092335899.htm",4,"Autoart");
navigation[6] = new navElem(6,"Bauer&nbsp(1)","pi195646197.htm",4,"Bauer");
navigation[7] = new navElem(7,"BBR","pi1129198726.htm",4,"BBR");
navigation[8] = new navElem(8,"BBurago&nbsp(1)","pi-1973602430.htm",4,"BBUrago");
navigation[9] = new navElem(9,"CMC","pi1118618027.htm",4,"CMC");
navigation[10] = new navElem(10,"ERTL&nbsp(3)","pi-1646875167.htm",4,"ERTL");
navigation[11] = new navElem(11,"Exoto","pi1195305333.htm",4,"Exoto");
navigation[12] = new navElem(12,"GMP","pi1228486937.htm",4,"GMP");
navigation[13] = new navElem(13,"Greenlight&nbsp(1)","pi-1772356610.htm",4,"Greenlight");
navigation[14] = new navElem(14,"Guiloy","pi1149978139.htm",4,"Guiloy");
navigation[15] = new navElem(15,"Highway 61&nbsp(5)","pi1141166477.htm",4,"Highway 61");
navigation[16] = new navElem(16,"Hotwheels &nbsp(3)","pi-1824109640.htm",4,"machete 1");
navigation[17] = new navElem(17,"Hotwheels Elite&nbsp(1)","pi621160148.htm",4,"Hotwheels ");
navigation[18] = new navElem(18,"IstModels&nbsp(2)","pi330638302.htm",4,"IstModels");
navigation[19] = new navElem(19,"JadaToys &nbsp(2)","pi-838929164.htm",4,"Jadatoys");
navigation[20] = new navElem(20,"KYOSHO&nbsp(10)","pi1241473582.htm",4,"Kyosho");
navigation[21] = new navElem(21,"Liberty Classics&nbsp(1)","pi1161300216.htm",4,"Liberty Cl");
navigation[22] = new navElem(22,"Maisto&nbsp(2)","pi1921776182.htm",4,"Maisto");
navigation[23] = new navElem(23,"MINICHAMPS&nbsp(9)","pi1120418359.htm",4,"Minichamps");
navigation[24] = new navElem(24,"Mondo Motors&nbsp(2)","pi-516788825.htm",4,"Mondo");
navigation[25] = new navElem(25,"MotorMax&nbsp(6)","pi-1149988992.htm",4,"MotorMax");
navigation[26] = new navElem(26,"NOREV&nbsp(5)","pi1134514735.htm",4,"Norev");
navigation[27] = new navElem(27,"Powco&nbsp(3)","pi1254481270.htm",4,"Powco");
navigation[28] = new navElem(28,"Revell&nbsp(5)","pi-1072899433.htm",4,"Revell");
navigation[29] = new navElem(29,"Road Signature&nbsp(27)","pi1104743291.htm",4,"Road Legen");
navigation[30] = new navElem(30,"Shelby Collectibles&nbsp(2)","pi1418220897.htm",4,"shelby");
navigation[31] = new navElem(31,"Signature Models&nbsp(15)","pi1127483478.htm",4,"Signature");
navigation[32] = new navElem(32,"SOLIDO&nbsp(11)","pi1146089597.htm",4,"Solido");
navigation[33] = new navElem(33,"SUNSTAR&nbsp(11)","pi-280539548.htm",4,"Sunstar");
navigation[34] = new navElem(34,"Welly&nbsp(6)","pi-377408127.htm",4,"Welly");
navigation[35] = new navElem(35,"Machete auto 1/24&nbsp(4)","pi-470781758.htm",null,"22");
navigation[36] = new navElem(36,"Machete auto 1/32&nbsp(2)","pi-1510489734.htm",null,"m322");
navigation[37] = new navElem(37,"Machete auto 1/43, 1/50&nbsp(23)","pi-864874143.htm",null,"machete");
navigation[38] = new navElem(38,"Machete motorsport","pi-781577675.htm",null,"Machete Mo");
navigation[39] = new navElem(39,"Formula 1&nbsp(1)","pi1105117531.htm",38,"Formula 1");
navigation[40] = new navElem(40,"LeMans, DTM","pi1664954882.htm",38,"DTM");
navigation[41] = new navElem(41,"WRC&nbsp(1)","pi1664063067.htm",38,"WRC");
navigation[42] = new navElem(42,"Motociclete","pi-2115506320.htm",null,"Motociclet");
navigation[43] = new navElem(43,"1/10","pi-148162172.htm",42,"1/10");
navigation[44] = new navElem(44,"1/12","pi-488393039.htm",42,"1/12");
navigation[45] = new navElem(45,"1/18&nbsp(2)","pi1122384845.htm",42,"moto");
navigation[46] = new navElem(46,"1/6","pi-1442291304.htm",42,"1/9");
navigation[47] = new navElem(47,"R/C Automodele","pi-1910127682.htm",null,"Automodeli");
navigation[48] = new navElem(48,"Automodele Electrice&nbsp(3)","pi1674535544.htm",47,"Electrice");
navigation[49] = new navElem(49,"Automodele Termice&nbsp(4)","pi602677017.htm",47,"termic");
navigation[50] = new navElem(50,"Piese de rezerva","pi2108812646.htm",47,"piese");
navigation[51] = new navElem(51,"Attacker 1/10&nbsp(45)","pi-593491017.htm",50,"Attacker");
navigation[52] = new navElem(52,"C18 1/18&nbsp(17)","pi-1639698212.htm",50,"C18");
navigation[53] = new navElem(53,"Envoy 1/8&nbsp(10)","pi533614230.htm",50,"Envoy 1/8");
navigation[54] = new navElem(54,"FMH 1/18&nbsp(4)","pi14827181.htm",50,"FMH 1/18");
navigation[55] = new navElem(55,"H-8860 1/10&nbsp(24)","pi412131481.htm",50,"8860");
navigation[56] = new navElem(56,"H-8963 1/8&nbsp(7)","pi-1526342961.htm",50,"8963");
navigation[57] = new navElem(57,"Iwaver 1/28&nbsp(2)","pi1215095817.htm",50,"Iwaver");
navigation[58] = new navElem(58,"KL-06 1/10&nbsp(42)","pi1772834977.htm",50,"kl-06");
navigation[59] = new navElem(59,"KL-07 1/10&nbsp(54)","pi1195037885.htm",50,"Kl-07");
navigation[60] = new navElem(60,"LRP Electronic&nbsp(13)","pi1237283487.htm",50,"LRP Electr");
navigation[61] = new navElem(61,"Monitor 1/10&nbsp(43)","pi1087230542.htm",50,"monitor 1/");
navigation[62] = new navElem(62,"REVO, Jato Traxxas&nbsp(20)","pi14917537.htm",50,"Revo");
navigation[63] = new navElem(63,"Robitronic&nbsp(1)","pi1239620278.htm",50,"Robitronic");
navigation[64] = new navElem(64,"Spurt 1/8&nbsp(20)","pi761821484.htm",50,"Spurt 1/8");
navigation[65] = new navElem(65,"R/C Elicoptere&nbsp(2)","pi1273238583.htm",null,"R/C Elicop");
navigation[66] = new navElem(66,"Tancuri avioane si elicoptere","pi-1068692043.htm",null,"Tancuri 1/");
navigation[67] = new navElem(67,"1/16","pi-1687711320.htm",66,"1/16");
navigation[68] = new navElem(68,"1/24","pi1208179768.htm",66,"1/35");
navigation[69] = new navElem(69,"1/32&nbsp(2)","pi-2056719027.htm",66,"1/32");
navigation[70] = new navElem(70,"1/48","pi1731162179.htm",66,"1/48");
navigation[71] = new navElem(71,"1/72","pi1377193098.htm",66,"1/72");
navigation[72] = new navElem(72,"Utilaje de constructii&nbsp(2)","pi-485506224.htm",null,"Utilaje");

// getNavElementByCatID
function getNavElementByCatID(categoryId){
	for(var i=0; i<navigation.length; i++){
		if(navigation[i].categoryId==categoryId){
			return(navigation[i]);
			break;
			};
		};
		return(null);
	};
// changeLoc
function changeLoc(id,linkUrl){
	if(id!="nada"){
		xmlConfig.navIndex = id.toString();
		if(xmlConfig.getFirstItem("SearchEngine").ByCategory == "1"){
			if(id=="null") xmlConfig.getFirstItem("SearchEngine").categoryId = "null"
			else xmlConfig.getFirstItem("SearchEngine").categoryId = navigation[id].categoryId;
			xmlConfig.getFirstItem("SearchEngine").categoryIndex = id;
			}
		else{
			xmlConfig.getFirstItem("SearchEngine").categoryId = "null";
			xmlConfig.getFirstItem("SearchEngine").categoryIndex = "null";
			};
		safeData();
		location.href = linkUrl + "?categoryId=" + id.toString();
		};
	};
// searchOnEnterNavi
function searchOnEnterNavi(){
	if(window.event.keyCode==13){
		xmlConfig.getFirstItem('SearchEngine').term=document.searchEngine.searchTerm.value;
		location.href = "search.htm";
		};
	};
// activates entries for categories
activateItem(getParameterFromURL("categoryId"));

