

function fetch_unix_timestamp() {
        return parseInt(new Date().getTime().toString().substring(0, 10))
}
                                                                                                                                               
                                                                                                                                               
                                                                                                                                               
var diff = 86400;
var start = 4000000;
var startts = 1223401239;
                                                                                                                                               
function updateSubsCounter() {
        ts=fetch_unix_timestamp();
        var diffts = ts - startts;
        var count =  (diffts/10);
        var value = (count+start);
        value = formatFloat(value);
        if ($('teller1'))
            $('teller1').innerHTML = value ;
}
                                                                                                                                               
function periodicalUpdate() {
    new PeriodicalExecuter(updateSubsCounter, 10);
}
periodicalUpdate() ;
                                                                                                                                               

/*
function ajax_request(url, data) {
    var url = 'refresh.php';
    var data = '';
    var myAjax = new Ajax.Request(
        url,
        {method: 'post', parameters: data, onComplete: ajax_response}
    );
}

function ajax_request() {
	url = "get_teller.php";
	pid = 'teller1'; 
	data = "";
	if ($(pid) && $(pid).visible()) { 
		//alert($(pid).innerHTML);
		data = "pid="+$(pid).innerHTML; 
	}	
	
	
 	var myAjax = new Ajax.Updater(
                pid ,
                url,
                {evalScripts: true, method: 'post', parameters: data}
        );
}
                                                                                                                                               

                                                                                                                                               
function ajax_response(originalRequest) {
    //if(!bHasRedirect) {
        //process originalRequest.responseText;
        $('refreshed').innerHTML = originalRequest.responseText;
    //}
    //else {
     //   bHasRedirect = false;
    //    ajax_request(originalRequest.responseText, "");
   // }
}
                                                                                                                                               
function periodicalUpdate() {
    new PeriodicalExecuter(ajax_request, 10);
}
periodicalUpdate() ;

*/
