﻿
var counterTR = new Array(9);
var counterEN = new Array(9);

var counter0 = new Object();
counter0.title = "Inveon'da şu ana kadar geliştirilen yazılım kodlarının miktarı";
counter0.now1 = 562000000;
counter0.now2 = 776000000;
counter0.year = 2009;
counter0.month = 6;
counter0.day = 15;
counter0.suffix = "bit";

var counter1 = new Object();
counter1.title = "Inveon'un çevre duyarlılığı sayesinde kurtulan ağaçlardaki yaprak sayısı";
counter1.now1 = 27146875;
counter1.now2 = 27922500;
counter1.year = 2009;
counter1.month = 6;
counter1.day = 15;
counter1.suffix = "adet";

var counter2 = new Object();
counter2.title = "Inveon'un çözümlerini kullanan firmaların sağladığı toplam maliyet azalma miktarı";
counter2.now1 = 55000000;
counter2.now2 = 60000000;
counter2.year = 2009;
counter2.month = 6;
counter2.day = 15;
counter2.suffix = "TL";


var counter3 = new Object();
counter3.title = "Inveon'un çözümleri ve girişimlerini kullanan kişi sayısı";
counter3.now1 = 2800000;
counter3.now2 = 3000000;
counter3.year = 2009;
counter3.month = 6;
counter3.day = 15;
counter3.suffix = "kişi";


var counter4 = new Object();
counter4.title = "Inveon'un geliştirdiği projelerdeki toplam sayfa gösterimi";
counter4.now1 = 90000000;
counter4.now2 = 100000000;
counter4.year = 2009;
counter4.month = 6;
counter4.day = 15;
counter4.suffix = "gösterim";

var counter5 = new Object();
counter5.title = "Inveon projelerini kullanan kişilere kazandırılan toplam zaman";
counter5.now1 = 544000000;
counter5.now2 = 576000000;
counter5.year = 2009;
counter5.month = 6;
counter5.day = 15;
counter5.suffix = "dakika";


var counter6 = new Object();
counter6.title = "Bir Inveon projesi olan Bulucak.com'da bulunan toplam uçuş sayısı";
counter6.now1 = 82733333;
counter6.now2 = 87600000;
counter6.year = 2009;
counter6.month = 6;
counter6.day = 15;
counter6.suffix = "uçuş";

var counter7 = new Object();
counter7.title = "Bir Inveon projesi olan BloXoo'dan ulaşılabilen yazılardaki toplam sözcük sayısı";
counter7.now1 = 50000000;
counter7.now2 = 80000000;
counter7.year = 2009;
counter7.month = 6;
counter7.day = 15;
counter7.suffix = "sözcük";

var counter8 = new Object();
counter8.title = "Inveon'u tercih eden şirketlerin 1 yıllık cirolarının toplamı";
counter8.now1 = 29600000000;
counter8.now2 = 30000000000;
counter8.year = 2009;
counter8.month = 6;
counter8.day = 15;
counter8.suffix = "TL";


var counter0_en = new Object();
counter0_en.title = "The amount of software code developed so far by Inveon";
counter0_en.now1 = 562000000;
counter0_en.now2 = 776000000;
counter0_en.year = 2009;
counter0_en.month = 6;
counter0_en.day = 15;
counter0_en.suffix = "byte";

var counter1_en = new Object();
counter1_en.title = "The number of tree leaves saved by environmental awareness of Inveon";
counter1_en.now1 = 27146875;
counter1_en.now2 = 27922500;
counter1_en.year = 2009;
counter1_en.month = 6;
counter1_en.day = 15;
counter1_en.suffix = "item";

var counter2_en = new Object();
counter2_en.title = "Total cost reduction of the companies that are using Inveon Solutions";
counter2_en.now1 = 55000000;
counter2_en.now2 = 60000000;
counter2_en.year = 2009;
counter2_en.month = 6;
counter2_en.day = 15;
counter2_en.suffix = "TL";


var counter3_en = new Object();
counter3_en.title = "The number of people that benefit from solutions and initiatives of Inveon";
counter3_en.now1 = 2800000;
counter3_en.now2 = 3000000;
counter3_en.year = 2009;
counter3_en.month = 6;
counter3_en.day = 15;
counter3_en.suffix = "people";


var counter4_en = new Object();
counter4_en.title = "Total pageview in the projects developed by Inveon";
counter4_en.now1 = 90000000;
counter4_en.now2 = 100000000;
counter4_en.year = 2009;
counter4_en.month = 6;
counter4_en.day = 15;
counter4_en.suffix = "pageview";

var counter5_en = new Object();
counter5_en.title = "Total time saving of user that benefit from Inveon solutions";
counter5_en.now1 = 544000000;
counter5_en.now2 = 576000000;
counter5_en.year = 2009;
counter5_en.month = 6;
counter5_en.day = 15;
counter5_en.suffix = "minute";


var counter6_en = new Object();
counter6_en.title = "Total number of flights listed by an Inveon venture Bulucak.com";
counter6_en.now1 = 82733333;
counter6_en.now2 = 87600000;
counter6_en.year = 2009;
counter6_en.month = 6;
counter6_en.day = 15;
counter6_en.suffix = "flight";

var counter7_en = new Object();
counter7_en.title = "Total word count of articles reached by an Inveon venture Bloxoo.com";
counter7_en.now1 = 50000000;
counter7_en.now2 = 80000000;
counter7_en.year = 2009;
counter7_en.month = 6;
counter7_en.day = 15;
counter7_en.suffix = "word";

var counter8_en = new Object();
counter8_en.title = "1-year turnover of the companies that prefer Inveon";
counter8_en.now1 = 29600000000;
counter8_en.now2 = 30000000000;
counter8_en.year = 2009;
counter8_en.month = 6;
counter8_en.day = 15;
counter8_en.suffix = "TL";



counterTR[0] = counter0;
counterTR[1] = counter1;
counterTR[2] = counter2;
counterTR[3] = counter3;
counterTR[4] = counter4;
counterTR[5] = counter5;
counterTR[6] = counter6;
counterTR[7] = counter7;
counterTR[8] = counter8;


counterEN[0] = counter0_en;
counterEN[1] = counter1_en;
counterEN[2] = counter2_en;
counterEN[3] = counter3_en;
counterEN[4] = counter4_en;
counterEN[5] = counter5_en;
counterEN[6] = counter6_en;
counterEN[7] = counter7_en;
counterEN[8] = counter8_en;


var selectedCounter = new Object();

function get_random() {
    var ranNum = Math.floor(Math.random() * 9);
    return ranNum;
}


function getaCounter() {
    var whichCounter1 = get_random();
    var lang = window.location;

	
    if (lang.toString().indexOf("/en/") >= 0) {
        selectedCounter = counterEN[whichCounter1];
    }
    else {
        selectedCounter = counterTR[whichCounter1];
    }

    maind();
}

function maind() {
    startdate = new Date();
    now(startdate.getYear(), startdate.getMonth(), startdate.getDate(), startdate.getHours(), startdate.getMinutes(), startdate.getSeconds(), selectedCounter);
}

function now(year, month, date, hours, minutes, seconds) {
    startdatum = new Date(year, month, date, hours, minutes, seconds)

    if (selectedCounter != undefined) {
        var now = selectedCounter.now1
        var now2 = selectedCounter.now2
        var groeipercentage = (now2 - now) / now * 100
        var groeiperseconde = (now * (groeipercentage / 100)) / 365.0 / 24.0 / 60.0 /60.0
        nu = new Date()
        schuldstartdatum = new Date(selectedCounter.year, selectedCounter.month, selectedCounter.day)
        secondenoppagina = (nu.getTime() - startdatum.getTime()) / 1000
        totaleschuld = (nu.getTime() - schuldstartdatum.getTime()) / 1000 * groeiperseconde + now2
        ChangeValue(totaleschuld, 1);

        timerID = setTimeout("now(startdatum.getYear(), startdatum.getMonth(), startdatum.getDate(), startdatum.getHours(), startdatum.getMinutes(), startdatum.getSeconds(), selectedCounter)", 200)
    }
}


function ChangeValue(number, pv) {
    numberstring = "";
    var j = 0;
    var i = 0;
    while (number > 1) {

        numberstring = (Math.round(number - 0.5) % 10) + numberstring;
        number = number / 10;
        j++;
        if (number > 1 && j == 3) {
            numberstring = "." + numberstring;
            j = 0
        }
        i++;
    }

    if (pv == 1) {
        if ($("#worldpop") != undefined) {
            $("#worldpop").html('<span id="counterTitle">' + selectedCounter.title + '</span><br> <span class="counterNumber">' + numberstring + " " + selectedCounter.suffix + '</span>');
        } 
    }


}
 
