// JavaScript Document
function calculatePricesOutShare1(planID, users, duration){
var setup_fee = 0;
var duration_length = 0;
var base_price_month = 0;
var base_users = 0;
var addupack_users = 0;
var addupack_price_month = 0;
switch(planID){
case "1": /*Personal Web Access Only plan*/
setup_fee = 12;
addupack_users = 0;
base_users = 1;
switch(duration){
case "1": /*3 months*/
duration_length=3;
base_price_month = 3.95;
addupack_price_month = 0;
break;
case "2": /*6 months*/
duration_length=6;
base_price_month = 2.95;
addupack_price_month = 0;
break;
case "3": /*12 months*/
duration_length=12;
base_price_month = 1.95;
addupack_price_month = 0;
break;
default:
duration_length = 0;
base_price_month = 0;
addupack_price_month = 0;
}
break;
case "2": /*Personal plan*/
setup_fee = 12;
addupack_users = 0;
base_users = 1;
switch(duration){
case "1": /*3 months*/
duration_length=3;
base_price_month = 6.95;
addupack_price_month = 0;
break;
case "2": /*6 months*/
duration_length=6;
base_price_month = 5.95;
addupack_price_month = 0;
break;
case "3": /*12 months*/
duration_length=12;
base_price_month = 4.95;
addupack_price_month = 0;
break;
default:
duration_length = 0;
base_price_month = 0;
addupack_price_month = 0;
}
break;
case "3": /*Family plan*/
setup_fee = 12;
addupack_users = 1;
base_users = 3;
switch(duration){
case "1": /*3 months*/
duration_length=3;
base_price_month = 14.95;
addupack_price_month = 4.95;
break;
case "2": /*6 months*/
duration_length=6;
base_price_month = 13.95;
addupack_price_month = 4.45;
break;
case "3": /*12 months*/
duration_length=12;
base_price_month = 11.95;
addupack_price_month = 3.95;
break;
default:
duration_length = 0;
base_price_month = 0;
addupack_price_month = 0;
}
break;
case "4": /*Small Business plan*/
setup_fee = 50;
addupack_users = 5;
base_users = 25;
switch(duration){
case "1": /*3 months*/
duration_length=3;
base_price_month = 99.95;
addupack_price_month = 19.95;
break;
case "2": /*6 months*/
duration_length=6;
base_price_month = 89.95;
addupack_price_month = 17.95;
break;
case "3": /*12 months*/
duration_length=12;
base_price_month = 79.95;
addupack_price_month = 15.95;
break;
default:
duration_length = 0;
base_price_month = 0;
addupack_price_month = 0;
}
break;
case "5": /*Enterprise plan*/
setup_fee = 100;
addupack_users = 25;
base_users = 100;
switch(duration){
case "1": /*3 months*/
duration_length=3;
base_price_month = 295;
addupack_price_month = 75;
break;
case "2": /*6 months*/
duration_length=6;
base_price_month = 250;
addupack_price_month = 65;
break;
case "3": /*12 months*/
duration_length=12;
base_price_month = 195;
addupack_price_month = 50;
break;
default:
duration_length = 0;
base_price_month = 0;
addupack_price_month = 0;
}
break;
default:
setup_fee = 0;
duration_length = 0;
base_price_month = 0;
base_users = 0;
addupack_users = 0;
addupack_price_month = 0;
}
if (addupack_users>0) {
addu_users = ((users-base_users)/addupack_users)|0;
addusers_price = addupack_price_month*addu_users;
} else {
addu_users = 0;
addusers_price = 0;
}
var result=new Array;
result[0]=round((base_price_month+addusers_price)/users, 2); //Price per user
result[1]=round((base_price_month+addusers_price),2); //Cost per month
//result[2]=round(setup_fee+(base_price_month+addusers_price)*duration_length,2); //SubTotal
result[2]=round((base_price_month+addusers_price)*duration_length,2); //SubTotal
return result;
}
function round(number,X) {
// rounds number to X decimal places, defaults to 2
X = (!X ? 2 : X);
return Math.round(number*Math.pow(10,X))/Math.pow(10,X);
}