﻿$(window).load(function(){
    jQuery(document).ready(function () {
        
        window.setTimeout( function() { 
            alfa_get_money_k()
        }, 0 ); 

        $('#close_form').click(function() {
        	$('div.email_form').hide(100); restore();});
//        $('#sendmailform').click(function() {$('div.email_form').show(100).css('top', $(window).scrollTop() + 60); return false;});
        $('#contact_us').click(function() {$('div.email_form').show(100).css('top', $(window).scrollTop() + 60); return false;});
    });
});


function alfa_get_money_k () {
    jQuery.getJSON('/alfa_src/moneyrequest.php?type=fast', {},
        function (json) {

            var s = '';
			var jjj=0;
            for (var i in json['data']) {
            	if (json['data'][i])
				{
					if(!document.getElementById('string').getElementsByTagName('span').length)
						s += '<span id="string'+jjj+'"><b>' + i + '</b>&nbsp;&nbsp;' + json['data'][i][1] + '&nbsp;&nbsp;&nbsp;&nbsp;</span>';else
						document.getElementById('string'+jjj).innerHTML='<b>' + i + '</b>&nbsp;&nbsp;' + json['data'][i][1] + '&nbsp;&nbsp;&nbsp;&nbsp;';
					jjj++;
						
				}
					
            }
            try {
			if(!document.getElementById('string').getElementsByTagName('span').length)
			{
			 jQuery('div#string').html(s);
			 string({id:'string',step:1,speed:50}).init();
			}
            //jQuery('#money_stat_date')[0].innerHTML = json['stat'];
            } catch (e) { }
         
		
        } );
    window.setTimeout( function() { 
        alfa_get_money_k()
    }, 3600 );
	
}


function openGraphWindow () {
    var stScrollBar = 'yes';
    var width = '800';
    var height = '600';
    window.open('/graph.php','graph','width='+width+',height='+height+',status=yes,menubar=no,resizable=yes,scrollbars='+stScrollBar+',left='+String((screen.width-width)/2)+',top='+String((screen.height-height)/2));
}

