// definisanje promenljivih // scrollToAnchor('office_anchor',-5); - skrol do office dela na strani var cena_ram; var cena_chip; var cena_disk1; var cena_disk2; var cena_protok; var cena_ipadresa; var temp_server_price=0; var office_selected=0; var office_cena_total=0; var showofficebox=-1; var addon_write_final; var server_konfig; function ConfigSet() { konfig_temp=document.getElementById('konfig').value; if (konfig_temp=="a") { SetPartValuesVPS(); } else { SetPartValues(); } } function SetField(fld,val) { document.getElementById(fld).value=val; } function ShowField(fld) { document.getElementById(fld).style.display = 'block'; } function HideField(fld) { document.getElementById(fld).style.display = 'none'; } function ChangeClassValue(className,newvalue){ var elemArray = document.getElementsByClassName(className); for(var i = 0; i < elemArray.length; i++){ document.getElementsByClassName(className)[i].className = className + ' ' + newvalue; } } function DisableRAM(val) { if (val>1) { document.getElementById("sel_ram").options[4].disabled = false; document.getElementById("sel_ram").options[5].disabled = false; // document.getElementById("sel_ram").options[6].disabled = false; } else { if (document.getElementById("sel_ram").value>4) { document.getElementById("sel_ram").value=4; // SetPartValues('ram_cena','ram_name','cena_ram','ram',4); } document.getElementById("sel_ram").options[4].disabled = true; document.getElementById("sel_ram").options[5].disabled = true; // document.getElementById("sel_ram").options[6].disabled = true; } } function scrollToAnchor(aid,num){ var aTag = $("a[name='"+ aid +"']"); $('html,body').animate({scrollTop: aTag.offset().top+num},'slow'); } function ShowOfficeCompare() { if (showofficebox<0) { document.getElementById('office_compare').style.display='block'; scrollToAnchor('office_compare_anchor',0); } else { document.getElementById('office_compare').style.display='none'; // scrollToAnchor('office_anchor',-3); } showofficebox=showofficebox*-1; } function SelectPackage(n) { document.getElementById('arrow').style.display="none"; num_cpu=document.getElementById('num_cpu').value; td1='td1'+n; td2='td2'+n; td3='td3'+n; td4='td4'+n; td5='td5'+n; td6='td6'+n; td7='td7'+n; td8='td8'+n; ChangeClassValue('tdbelo','bela-bela'); ChangeClassValue('tdsivo','siva-bela'); document.getElementById(td1).className='tdbelo naslov-orange'; document.getElementById(td2).className='tdsivo siva-orange'; document.getElementById(td3).className='tdbelo bela-orange'; document.getElementById(td4).className='tdsivo siva-orange'; document.getElementById(td5).className='tdbelo bela-orange'; document.getElementById(td6).className='tdsivo siva-orange'; document.getElementById(td7).className='tdbelo bela-orange'; document.getElementById(td8).className='tdsivo siva-orange'; SetField('konfig',n); if (n == "a") { document.getElementById('server_kind').innerHTML = "Virtuelni "; ram_temp=document.getElementById('sel_ram_vps').value; chip_temp=document.getElementById('sel_processor_vps').value; disk1_temp=document.getElementById('sel_disk1_vps').value; ipaddress_temp=document.getElementById('ipaddress_vps').value; disk2_temp=0; protok_temp=document.getElementById('sel_protok_vps').value; SetField('num_cpu',1); disk_all_temp = drive_short[disk1_temp]; // if (disk2_temp!=0) disk_all_temp=disk_all_temp+" + "+drive_short[disk2_temp]; document.getElementById('server_spec').innerHTML="— CPU: "+chip_short[chip_temp]+"
— RAM: "+ram_name[ram_temp]+"
— Disk: "+disk_all_temp+"
— Protok: "+protok_temp+"TB
— IP adrese: "+ipaddress_temp; if (chip_temp == 10) { SetField('num_cores',2); } else if (chip_temp == 11) { SetField('num_cores',4); } else if (chip_temp == 12) { SetField('num_cores',6); } else { SetField('num_cores',8); } cena_chip=chip_price[chip_temp]; cena_ram=ram_price[ram_temp]; cena_disk1=drive_price[disk1_temp]; if (disk2_temp!=0) { cena_disk2=drive_price[disk2_temp]; } else { cena_disk2=0; } cena_protok=protok_temp*5+7; cena_ipadresa=(ipaddress_temp-1)*2; SetField('chip',chip_name[chip_temp]); SetField('disk1',drive_name[disk1_temp]); if (disk2_temp!=0) { SetField('disk2',drive_name[disk2_temp]); } else { SetField('disk2',0); } SetField('ram',ram_name[ram_temp]); SetField('protok',protok_temp+' TB'); SetField('mes_cena',temp_server_price); } else { document.getElementById('server_kind').innerHTML = "Namenski "; ram_temp=document.getElementById('sel_ram').value; chip_temp=document.getElementById('sel_processor').value; ipaddress_temp=document.getElementById('ipaddress').value; disk1_temp=document.getElementById('sel_disk1').value; disk2_temp=document.getElementById('sel_disk2').value; protok_temp=document.getElementById('sel_protok').value; disk_all_temp = drive_short[disk1_temp]; if (disk2_temp!=0) disk_all_temp=disk_all_temp+" + "+drive_short[disk2_temp]; document.getElementById('server_spec').innerHTML="— CPU: "+chip_short[chip_temp]+"
— RAM: "+ram_name[ram_temp]+"
— Disk: "+disk_all_temp+"
— Protok: "+protok_temp+"TB
— IP adrese: "+ipaddress_temp; if (chip_temp == 1) { SetField('num_cores',4); SetField('num_cpu',1); } else if (chip_temp == 2) { SetField('num_cores',6); SetField('num_cpu',1); } else { SetField('num_cores',12); SetField('num_cpu',2); } cena_chip=chip_price[chip_temp]; cena_ram=ram_price[ram_temp]; cena_disk1=drive_price[disk1_temp]; if (disk2_temp!=0) { cena_disk2=drive_price[disk2_temp]; } else { cena_disk2=0; } cena_protok=protok_temp*5+7; cena_ipadresa=(ipaddress_temp-1)*2; SetField('chip',chip_name[chip_temp]); SetField('disk1',drive_name[disk1_temp]); if (disk2_temp!=0) { SetField('disk2',drive_name[disk2_temp]); } else { SetField('disk2',0); } SetField('ram',ram_name[ram_temp]); SetField('protok',protok_temp+' TB'); SetField('mes_cena',temp_server_price); } cena_ram=Math.round(cena_ram/7); cena_chip=Math.round(cena_chip/7); cena_disk1=Math.round(cena_disk1/7)*2; cena_disk2=Math.round(cena_disk2/7)*2; // cena_protok temp_server_price=Math.round(cena_ram+cena_chip+cena_disk1+cena_disk2)+cena_protok+cena_ipadresa+25; // sa dodatom Windows licencom (+25) SetField('mes_cena',temp_server_price); // document.getElementById("cena_mesec1").innerHTML=temp_server_price; document.getElementById("cena_mesec2").innerHTML=temp_server_price; ShowField('dodatne-usluge'); AddonStuff(); scrollToAnchor('dodatno',-5); } // example - SetPartValues(ram_cena,ram_name,cena_ram,ram,1); function SetPartValues() { konfig=document.getElementById('konfig').value; set_ram=document.getElementById('sel_ram').value; set_chip=document.getElementById('sel_processor').value; set_disk1=document.getElementById('sel_disk1').value; set_disk2=document.getElementById('sel_disk2').value; set_protok=document.getElementById('sel_protok').value; ipaddress_temp=document.getElementById('ipaddress').value; if (set_chip == 1) { SetField('num_cores',4); SetField('num_cpu',1); } else if (set_chip == 2) { SetField('num_cores',6); SetField('num_cpu',1); } else { SetField('num_cores',12); SetField('num_cpu',2); } num_cpu=document.getElementById('num_cpu').value; cena_ram=Math.round(ram_price[set_ram]/7); cena_chip=Math.round(chip_price[set_chip]/7); cena_disk1=Math.round(drive_price[set_disk1]/7)*2; if (set_disk2!=0) { cena_disk2=Math.round(drive_price[set_disk2]/7)*2; } else { cena_disk2=0; } cena_protok=set_protok*5+7; cena_ipadresa=(ipaddress_temp-1)*2; temp_server_priceD=Math.round(cena_ram+cena_chip+cena_disk1+cena_disk2)+cena_protok+cena_ipadresa+25; // temp_server_price=Math.round((cena_ram+cena_chip+cena_disk1+cena_disk2)*0.9)+cena_protok; SetField('mes_cena',temp_server_price); document.getElementById("cena_mesec1").innerHTML=temp_server_priceD; if (konfig == "b") { temp_server_price=temp_server_priceD; document.getElementById("cena_mesec2").innerHTML=temp_server_price; disk_all_temp = drive_short[set_disk1]; if (set_disk2!=0) disk_all_temp=disk_all_temp+" + "+drive_short[set_disk2]; document.getElementById('server_spec').innerHTML="— CPU: "+chip_short[set_chip]+"
— RAM: "+ram_name[set_ram]+"
— Disk: "+disk_all_temp+"
— Protok: "+set_protok+"TB
— IP adrese: "+ipaddress_temp; AddonStuff(); } } function SetPartValuesVPS() { konfig=document.getElementById('konfig').value; set_ram=document.getElementById('sel_ram_vps').value; set_chip=document.getElementById('sel_processor_vps').value; set_disk1=document.getElementById('sel_disk1_vps').value; set_protok=document.getElementById('sel_protok_vps').value; ipaddress_temp=document.getElementById('ipaddress_vps').value; if (set_chip == 10) { SetField('num_cores',2); } else if (set_chip == 11) { SetField('num_cores',4); } else if (set_chip == 12) { SetField('num_cores',6); } else { SetField('num_cores',8); } SetField('num_cpu',1); cena_ram=Math.round(ram_price[set_ram]/7); cena_chip=Math.round(chip_price[set_chip]/7); cena_disk1=Math.round(drive_price[set_disk1]/7)*2; cena_protok=set_protok*5+7; cena_ipadresa=(ipaddress_temp-1)*2; temp_server_priceD=Math.round(cena_ram+cena_chip+cena_disk1)+cena_protok+cena_ipadresa+25; // temp_server_price=Math.round((cena_ram+cena_chip+cena_disk1+cena_disk2)*0.9)+cena_protok; SetField('mes_cena',temp_server_price); document.getElementById("cena_mesec1_vps").innerHTML=temp_server_priceD; if (konfig == "a") { temp_server_price=temp_server_priceD; document.getElementById("cena_mesec2").innerHTML=temp_server_price; disk_all_temp = drive_short[set_disk1]; document.getElementById('server_spec').innerHTML="— CPU: "+chip_short[set_chip]+"
— RAM: "+ram_name[set_ram]+"
— Disk: "+disk_all_temp+"
— Protok: "+set_protok+"TB
— IP adrese: "+ipaddress_temp; AddonStuff(); } } // RAM ram_price=[]; ram_price[1] = 65; ram_price[2] = 105; ram_price[3] = 195; ram_price[4] = 395; ram_price[5] = 800; ram_price[6] = 1600; ram_price[7] = 3200; ram_name=[]; ram_name[1] = "4GB"; ram_name[2] = "8GB"; ram_name[3] = "16GB"; ram_name[4] = "32GB"; ram_name[5] = "64GB"; ram_name[6] = "128GB"; ram_name[7] = "256GB"; // Processori + barebone chip_price=[]; chip_price[1] = 590; // Xeon E3 (HSW-R 4Core+HT E3-1231V3 3.4G 8M 5GT/s DMI) + 512L-200B + 30 (300) chip_price[2] = 920; // Xeon E5 (Haswell 6C E5-2603V3 1.6G 15M 6.4GT/s QPI) + 1RU šasija 4xHotSwap drive bays chip_price[3] = 1160; // 2x Xeon E5 (Haswell 6C E5-2603V3 1.6G 15M 6.4GT/s QPI) + 1RU šasija 4xHotSwap drive bays chip_price[10] = 98; chip_price[11] = 196; chip_price[12] = 294; chip_price[13] = 392; chip_name=[]; chip_name[1] = "Xeon E3 4-core + 512L-200B"; chip_name[2] = "Xeon E5 6-core + 1RU 4xHotSwap drive bays"; chip_name[3] = "2 x Xeon E5 12-core + 1RU 4xHotSwap drive bays"; chip_name[10] = "2 jezgra"; chip_name[11] = "4 jezgra"; chip_name[12] = "6 jezgra"; chip_name[13] = "8 jezgra"; chip_short=[]; chip_short[1] = "Xeon E3 (4 jezgra)"; chip_short[2] = "Xeon E5 (6 jezgra)"; chip_short[3] = "2 x Xeon E5 (12 jezgra)"; chip_short[10] = "2 jezgra"; chip_short[11] = "4 jezgra"; chip_short[12] = "6 jezgra"; chip_short[13] = "8 jezgra"; // Diskovi (racuna se sve puta 2) drive_price=[]; drive_price[1] = 90; drive_price[2] = 130; drive_price[3] = 185; drive_price[4] = 285; drive_price[5] = 340; drive_price[6] = 640; drive_price[10] = 112; drive_price[11] = 210; drive_price[12] = 399; drive_price[13] = 581; drive_name=[]; drive_name[1] = "WD 3.5 500GB SATA 6Gb/s 7.2K RPM 64M RE4"; drive_name[2] = "Seagate 3.5 1TB SATA 6Gb/s 7.2K RPM 128M Megalodon"; drive_name[3] = "WD 3.5 2TB SAS 6Gb/s 7.2K RPM 32M"; drive_name[4] = "WD 3.5 4TB SAS 6Gb/s 7.2K RPM 32M"; drive_name[5] = "Intel DC S3500 300GB, SATA 6Gb/s, MLC 2.5 7.0mm, 20nm"; drive_name[6] = "Intel DC S3500 600GB, SATA 6Gb/s, MLC 2.5 7.0mm, 20nm"; drive_name[10] = "50 GB"; drive_name[11] = "100 GB"; drive_name[12] = "200 GB"; drive_name[13] = "300 GB"; drive_short=[]; drive_short[1] = "2 x 500GB SATA"; drive_short[2] = "2 x 1TB SATA"; drive_short[3] = "2 x 2TB SATA"; drive_short[4] = "2 x 4TB SATA"; drive_short[5] = "2 x 300GB SSD"; drive_short[6] = "2 x 600GB SSD"; drive_short[10] = "50 GB"; drive_short[11] = "100 GB"; drive_short[12] = "200 GB"; drive_short[13] = "300 GB"; // addons addon_win_name=[]; addon_win_name[1] = "Windows Server Standard"; addon_win_name[2] = "Windows Server Essentials"; addon_win_name[3] = "Windows Server Datacenter"; addon_win_price=[]; addon_win_price[1] = 0; addon_win_price[2] = 0; addon_win_price[3] = 115; office_name=[]; office_name[1] = "Office 365 Business Essentials"; office_name[2] = "Office 365 Business"; office_name[3] = "Office 365 Business Premium"; office_price=[]; office_price[1] = 5; office_price[2] = 8.25; office_price[3] = 12.5; addon_sql_name=[]; addon_sql_name[1] = "SQL Server Express"; addon_sql_name[2] = "SQL Server Web Edition"; addon_sql_name[3] = "SQL Server Standard"; addon_sql_price=[]; addon_sql_price[1] = 0; addon_sql_price[2] = 15; addon_sql_price[3] = 140; var cena_os; var cena_ipadresa; var cena_sql; function AddonStuff() { addon_write=""; addon_price=""; num_cores=document.getElementById('num_cores').value; num_cpu=document.getElementById('num_cpu').value; // os + software // os=document.getElementById('os').value; win_verzija=document.getElementById('win-verzija').value; mssql=document.getElementById('mssql').value; if (win_verzija!=0) { cena_os=addon_win_price[win_verzija]*num_cpu; addon_write=addon_write+"
— "+addon_win_name[win_verzija]+" ("+num_cpu+" CPU)"; if ((cena_os==0) && (num_cpu==2)) cena_os=25; // dodatak jer je cena Windows-a ukljucena za 1 CPU addon_price=addon_price+"
"+cena_os+" EUR"; } else { cena_os=0; } if (mssql!=0) { cena_sql=addon_sql_price[mssql]*(num_cores/2); addon_write=addon_write+"
— "+addon_sql_name[mssql]+" ("+num_cores+" cores)"; addon_price=addon_price+"
"+cena_sql+" EUR"; } else { cena_sql=0; } document.getElementById('dodatne_name').innerHTML=addon_write; if (addon_price!="") { document.getElementById('dodatne_price').innerHTML=addon_price; } else { document.getElementById('dodatne_price').innerHTML="0 EUR"; } addon_write_final=addon_write; dodatna_cena_suma=cena_os+cena_ipadresa+cena_sql; // alert(dodatna_cena_suma); // alert(temp_server_price); ukupno_cena_temp=temp_server_price+dodatna_cena_suma; // document.getElementById('ukupno_cena').innerHTML=ukupno_cena_temp; // porez_cena_temp=Math.round(ukupno_cena_temp*0.2,2); // document.getElementById('porez_cena').innerHTML=porez_cena_temp; porez_cena_temp=0; ukupno_cena_temp=ukupno_cena_temp+office_cena_total; document.getElementById('suma_12').innerHTML=porez_cena_temp+ukupno_cena_temp; // document.getElementById('suma_24').innerHTML=Math.round((porez_cena_temp+ukupno_cena_temp)*0.9); } function ToTheForm() { document.getElementById('orderformishere').style.display='block'; server_kind=document.getElementById('server_kind').innerHTML; server_konfig=document.getElementById('server_spec').innerHTML; server_konfig=server_konfig.replace(/
/gi, "\n"); server_konfig=server_kind+" server\n"+server_konfig; ukupna_cena=document.getElementById('suma_12').innerHTML; ukupna_cena=ukupna_cena+" EUR mesecno (uz ugovornu obavezu 24 meseca)\nSetup: 99 EUR"; dodatne_office_name=document.getElementById('dodatne_office_name').innerHTML; dodatne_office_name=dodatne_office_name.replace(/
/gi, "\n"); dodatne_usluge=document.getElementById('dodatne_name').innerHTML; dodatne_usluge=dodatne_usluge.replace(/
/gi, "\n"); dodatne_usluge="\n\nSoftver:"+dodatne_usluge+dodatne_office_name+"\n\nUkupno: "+ukupna_cena; hosting_forma.document.getElementById('element_11').value=server_konfig+dodatne_usluge; hosting_forma.document.getElementById('li_11').style.display='none'; scrollToAnchor('izbor2',-1); } function AddOffice() { var office_addon_write=""; var office_addon_price=""; office_cena_total=0; office1val=document.getElementById('office1').value; office2val=document.getElementById('office2').value; office3val=document.getElementById('office3').value; if ((office1val==0) && (office2val==0) && (office3val==0)) { office_selected=0; } else { office_selected=1; } if (office1val!=0) { office_addon_write=office_addon_write+"
— "+office_name[1]+" ("+office1val+")"; office_addon_price=office_addon_price+"
"+office_price[1]*office1val+" EUR"; office_cena_total=office_cena_total+(office_price[1]*office1val); } if (office2val!=0) { office_addon_write=office_addon_write+"
— "+office_name[2]+" ("+office2val+")"; office_addon_price=office_addon_price+"
"+office_price[2]*office2val+" EUR"; office_cena_total=office_cena_total+(office_price[2]*office2val); } if (office3val!=0) { office_addon_write=office_addon_write+"
— "+office_name[3]+" ("+office3val+")"; office_addon_price=office_addon_price+"
"+office_price[3]*office3val+" EUR"; office_cena_total=office_cena_total+(office_price[3]*office3val); } if (office_addon_write=="") { document.getElementById('dodajte_office_link').style.display="block"; document.getElementById('dodatne_office_price').innerHTML=""; } else { document.getElementById('dodajte_office_link').style.display="none"; document.getElementById('dodatne_office_name').innerHTML=office_addon_write; document.getElementById('dodatne_office_price').innerHTML=office_addon_price; } }