function showCategory(categoryID) { for (i = 0; i < noCategories; ++i) { document.getElementById("subCategories[" + arrCategoriesIDs[i] + "]").style.display = 'none'; document.getElementById("bulletImage[" + arrCategoriesIDs[i] + "]").src = 'images/bullet_64.jpg'; document.getElementById("bulletImage[" + arrCategoriesIDs[i] + "]").height = 7; } document.getElementById("subCategories[" + categoryID + "]").style.display = 'inline'; document.getElementById("bulletImage[" + categoryID + "]").src = 'images/bullet_53.jpg'; document.getElementById("bulletImage[" + categoryID + "]").height = 9; } function gE(sID) { return document.getElementById(sID); } /* Convertor */ var inCurr,outCurr,enteredAmount,resultAmount, aux, auxObj, auxEnteredAmount; function ReCalculate(){ outCurr = document.getElementById('currencyOut').options[document.getElementById('currencyOut').selectedIndex].value; inCurr = document.getElementById('currencyIn').options[document.getElementById('currencyIn').selectedIndex].value; oldEnteredAmount = enteredAmount; enteredAmount = document.getElementById('amountEntered').value; var thePat = /^(\d+)*$/; var gotIt = thePat.exec(enteredAmount); if(gotIt){ aux = inCurr * enteredAmount/outCurr; if(aux > 0){ auxObj = new NumberFormat(aux); auxObj.setSeparators(true, auxObj.PERIOD, auxObj.COMMA); resultAmount = auxObj.toFormatted(); document.getElementById('amountResult').value = resultAmount; //document.getElementById('strCurrencyResult').innerHTML = document.getElementById('currencyOut').options[document.getElementById('currencyOut').selectedIndex].innerHTML; } else document.getElementById('amountResult').value = ''; } else { enteredAmount = enteredAmount.replace(/(\D+)*$/, ''); document.getElementById('amountEntered').value = enteredAmount; } } var OpenWin = null; function imgPopup(file, pwidth, pheight, title) { var content = ''; var x = (screen.width-pwidth)/2; y = (screen.height-pheight)/2; //y = 10; width = (pwidth > 1024) ? 1024 : pwidth; height = (pheight > 768) ? 768 : pheight; content += '' + title + ''; content += ''; content += '
'; if(OpenWin) OpenWin.close(); if(pwidth > 1024 || pheight > 768) OpenWin = this.open('', "CtrlWindow", "width=" + width + ",height=" + height + " toolbar=no, menubar=no, location=no, scrollbars=yes, statusbar=no, resizable=yes, screenX="+x+", screenY="+y+", left="+x+", top="+y); else OpenWin = this.open('', "CtrlWindow", "width=" + width + ",height=" + height + " toolbar=no, menubar=no, location=no, scrollbars=no, statusbar=no, resizable=yes, screenX="+x+", screenY="+y+", left="+x+", top="+y); OpenWin.document.write(content); OpenWin.focus(); } function currencyPopup(file) { var x = (screen.width-500)/2; y = (screen.height-300)/2; OpenWin = this.open(file, "CtrlWindow", "width=300,height=400 toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no, screenX="+x+", screenY="+y+", left="+x+", top="+y); } /** * Sets a Cookie with the given name and value. * * name Name of the cookie * value Value of the cookie * [expires] Expiration date of the cookie (default: end of current session) * [path] Path where the cookie is valid (default: path of calling document) * [domain] Domain where the cookie is valid * (default: domain of calling document) * [secure] Boolean value indicating if the cookie transmission requires a * secure transmission */ function setCookie(name, value, expires, path, domain, secure) { document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } /** * Gets the value of the specified cookie. * * name Name of the desired cookie. * * Returns a string containing value of specified cookie, * or null if cookie does not exist. */ function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } /** * Deletes the specified cookie. * * name name of the cookie * [path] path of the cookie (must be same as path used to create cookie) * [domain] domain of the cookie (must be same as domain used to create cookie) */ function deleteCookie(name, path, domain) { if (getCookie(name)) { var myDate=new Date(); myDate.setFullYear(2000,0,14); setCookie(name, 1, myDate, '/'); // document.cookie = name + "=" + // ((path) ? "; path=" + path : "") + // ((domain) ? "; domain=" + domain : "") + // "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } function populateModels(el, target, sel) { gE(target).options.length = 0; j = 0; gE(target).options[j] = new Option("Toate modelele ...", 0); j++; // alert if(el.value > 0) { if(jsModels[el.value].length) { for (var i = 0; i < jsModels[el.value].length; i++) { if(jsModels[el.value][i]) { gE(target).options[j] = new Option(jsModels[el.value][i], i); if(sel == i) { gE(target).options[j].selected = true; } j++; } } } } }