var MemValues = [1,2,1,2,1,2,4,2,4,8];
var grey_txt = 'font-size: 12px; color: #AAAAAA; font-family: Arial, sans-serif; text-align: left;';
var black_txt = 'font-size: 12px; color: black; font-family: Arial, sans-serif; text-align: left;';
ColdCPU = new Array(
79, //Celeron 1.7GHz/128Kb
80, //Celeron 1.8GHz/128Kb
81, //Celeron 2.0GHz/128Kb
85, //Celeron 2.4GHz/128Kb
964, //Celeron 2.5GHz/128Kb
965, //Celeron 2.6GHz/128Kb
1348, //Celeron 2.7GHz/128Kb
770, //Pentium 4 2.0 GHz/512Kb
433); //Pentium 4 2.6C GHz/512K/800/HT
ColdAthlon = new Array(69, 71, 1282, 74, 75, 76, 1283);
var mail_ttl = "
\n";
mail_ttl += "\n";
mail_ttl += "\n";
SelField = new Array();
SelField[0] = 'SubCategory0';
SelField2 = new Array();
SelField2[0] = 'multimed0';
order_str1 = '';
order_str2 = ' | ';
order_str3 = ' ' + order_str2;
str_left = ' ';
str_right = ' | ';
function StartOrder(TblName) {
//return " \n\n\n | | \n| "+TblName+" | \n";
return "\n\n | | \n| "+TblName+" | \n";
}
function OrderLine(Field1, Field2){
return '| ' + Field1 + ' | ' + Field2 + " | \n";
}
function HiddenLine(Field1, Field2){
return '\n";
}
function PriceLine(Field1, Field2){
return '| ' + Field1 + ' | ' + Field2 + " | \n";
}
function EndOrder() {
return " \n";
}
function Power(a, b){
return Math.round(Math.exp(b*Math.log(a)));
}
function BooltoInt(bool) {
if (bool == true) {return 1} else {return 0}
}
function CheckQuantity() {
//проверяет на правильность поле 'количество'
with (document) {
var numreg = /^\d+$/;
if (!numreg.test(mainForm.num.value) || mainForm.num.value == 0) {
alert("Поле 'количество': неправильный формат данных!");
mainForm.num.value = 1;
return false;
} else {
return true;
}
}
}
function handlePressEnter(e) {
var key;
if (window.event) {
key = window.event.keyCode;
} else if (e.which) {
key = e.keyCode;
} else {
return false;
}
if (key == 13) {
CheckQuantity();
Calc();
mainForm.num.blur();
}
}
function CheckDigitalField(fieldName) {
//проверяет на правильность поле 'количество'
with (document) {
var numreg = /^\d+$/;
if (!numreg.test(fieldName.value) || fieldName.value == 0) {
alert("Поле 'количество': неправильный формат данных!");
fieldName.value = 1;
return false;
} else {
return true;
}
//Calc();
//return result;
}
}
function CheckEmail(address) {
var oRegExp = /^[A-Za-z0-9][-\w]*(\.[A-Za-z0-9][-\w]*)*@[A-Za-z0-9][-\w]*(\.[A-Za-z0-9][-\w]*)*\.[a-zA-Z]{2,4}$/;
address = address.replace(new RegExp('/\(.*?\)/'), '');
if ((address != '')&&(oRegExp.test(address))){
return true;
} else {
alert('Поле "e-mail": неправильный формат данных!');
return false;
}
}
/*function CheckEmail(address) {
var oRegExp = /^[A-Za-z0-9][-\w]*(\.[A-Za-z0-9][-\w]*)*@[A-Za-z0-9][-\w]*(\.[A-Za-z0-9][-\w]*)*\.[a-zA-Z]{2,4}$/;
address = address.replace(new RegExp('/\(.*?\)/'), '');
if ((address != '')&&(oRegExp.test(address))){
return true;
} else {
alert('Поле "e-mail" не заполнено или имеет неправильный формат');
return false;
}
}*/
/*function CheckIntNumber(num) {
var oRegExp = /^[A-Za-z0-9][-\w]*(\.[A-Za-z0-9][-\w]*)*@[A-Za-z0-9][-\w]*(\.[A-Za-z0-9][-\w]*)*\.[a-zA-Z]{2,4}$/;
address = address.replace(new RegExp('/\(.*?\)/'), '');
if ((address != '')&&(oRegExp.test(address))){
return true;
} else {
alert('Поле "" не заполнено или имеет неправильный формат');
return false;
}
}*/
function ExtractRef2(price){
var params = price.split('|');
return parseInt(params[1]);
}
function ExtractID(price){
var params = price.split('|');
return parseInt(params[1]);
}
function ExtractProductCode(price){
var params = price.split('|');
return String(params[1]);
}
function ExtractPrice(price){
var params = price.split('|');
return parseFloat(params[0]);
}
function SetRef(ref, price, category) {
var params = price.split('|');
if (navigator.appName == "Netscape"){
if (links[ref] != undefined) {
if (params[1] == 0) {
links[ref].href = 'javascript:void(0);';
} else {
links[ref].href = '/comp/builders/specification.php?PartID=' + params[1];
}
}
} else {
if (params[1] == 0) {
ref.href = 'javascript:void(0);';
} else {
ref.href = '/comp/builders/specification.php?PartID=' + params[1];
}
}
}
function ExtractRef(price, category) {
var params = price.split('|');
if (params[1] == 0) {
return 'javascript:void(0);';
} else {
return '/common/php/specification.php?PartID=' + params[1];
//return '/comp/builders/specification.php?PartID=' + params[1];
}
}
function ExtractRef2(price){
var params = price.split('|');
return parseInt(params[1]);
}
function InfoWindow(PartName){
with (document) {
if (eval('mainForm.'+PartName+'.selectedIndex' != 0)) {
eval('NewWindow(ExtractRef(mainForm.'+PartName+'[mainForm.'+PartName+'.selectedIndex].value), "New", 800, 600, "yes")');
}
}
}
/*function SelectValidator(ObjName, ActionType){
var ObjLength = ObjName.length;
if (ActionType == 0) {
while (ObjName[ObjName.selectedIndex].style.color == '#aaaaaa') {
if (ObjName.selectedIndex <= parseInt(ObjLength/2)) {
ObjName.selectedIndex++;
} else {
ObjName.selectedIndex--;
}
}
}
}*/
function SelectValidator(ObjName, ActionType){
var ObjLength = ObjName.length;
if (ObjName[ObjName.selectedIndex].style.color == '#aaaaaa') {
if (ObjName.selectedIndex <= parseInt(ObjLength/2)) {
ValidLine = -1;
for (i=ObjName.selectedIndex; i=0; i--) {
if (ObjName[i].style.color != '#aaaaaa') { ValidLine = i; break; }
}
if (ValidLine == -1) {
while (ObjName[ObjName.selectedIndex].style.color == '#aaaaaa') ObjName.selectedIndex++;
} else {
ObjName.selectedIndex = ValidLine;
}
}
}
}
function SelectValidatorCl(ObjName, ActionType){
var ObjLength = ObjName.length;
if (ObjName[ObjName.selectedIndex].className == 'passive') {
if (ObjName.selectedIndex <= parseInt(ObjLength/2)) {
ValidLine = -1;
for (i=ObjName.selectedIndex; i=0; i--) {
if (ObjName[i].className != 'passive') { ValidLine = i; break; }
}
if (ValidLine == -1) {
while (ObjName[ObjName.selectedIndex].className == 'passive') ObjName.selectedIndex++;
} else {
ObjName.selectedIndex = ValidLine;
}
}
}
}
function FormatLine(Str, Cost) {
function str_repeat(Ch, num) {
var s='';
for (var i=0; i | | |  | ';
SelField.push(sName);
SelField2.push(sName2);
for (i = 0; i < Categories.length; i++) {
document.all[SelField[SelField.length-1]].options[i] = new Option(Categories[i]);
}
ChangeCategory(document.all[SelField[SelField.length-1]], document.all[SelField2[SelField2.length-1]]);
}
function HardMaxNum(obj1, obj2, maxnum) {
with (document) {
var1 = obj1.selectedIndex;
var2 = obj2.selectedIndex;
//alert(obj1[obj1.selectedIndex].text);
//for (i=0; i maxnum) {
CurrSelIndex[j] = 0;
} else Summ += CurrSelIndex[j];*/
if (Summ + parseInt(CurrSelValue[j]) > maxnum) {
CurrSelIndex[j] = 0;
} else Summ += parseInt(CurrSelValue[j]);
for (i=0; i<26; i++) {
eval(arr_obj[j]+'[0] = null');
}
}
//alert('Summ = ' + String(Summ)); );
for (j=0; j maxnum) {
CurrSelIndex[j] = 0;
} else Summ += CurrSelIndex[j];
for (i=0; i<26; i++) {
eval(arr_obj[j]+'[0] = null');
}
//while (arr_obj[j].options.length) { arr_obj[j][0] = null }
}
for (j=0; j=0; i-=3) {
if (rez != '') {
rez = num.substr(i, 3) + ' ' + rez;
} else {
rez = num.substr(i, 3);
}
j = i;
}
if (j != 0) {
rez = num.substr(0, j) + ' ' + rez;
}
return rez;
}
function FormatCost(Cost, Currency) {
with (document) {
//return "$ " + Math.round(Cost * Currency);
return number_format(String(Math.round(Cost * Currency))) + ' ' + String.fromCharCode(0x0440, 0x0443, 0x0431) + '.'; //' &F0;&F3;&E1;руб.';
}
}
| |