function sharebtn(){
document.write( VK.Share.button({url: document.location, title: document.title }, {type: 'custom', text: '<img src="/images/icon-vkontake.png" />'}) );
document.write( '<a target="_blank" href="http://connect.mail.ru/share?share_url='+window.location+'"><img src="/images/icon-myworld.png"></a>');
document.write( '<a target="_blank" href="http://www.livejournal.com/update.bml?subject='+encodeURIComponent(document.title)+'&event='+window.location+'"><img src="/images/icon-livejournal.png"></a>');
document.write( '<a target="_blank" href="http://twitter.com/home?status='+window.location+'"><img src="/images/icon-twitter.png"></a>');
document.write( '<a target="_blank" href="http://www.facebook.com/sharer.php?u='+window.location+'"><img src="/images/icon-facebook.png"></a>');
document.write( '<a target="_blank" href="mailto:?subject='+encodeURIComponent(document.title)+' : '+window.location+'"><img src="/images/icon-email.png"></a>');
}

function number_format(number, decimals, dec_point, thousands_sep){
    number = (number+'').replace(',', '').replace(' ', '');
    var n = !isFinite(+number) ? 0 : +number, 
        prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
        sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,        dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
        s = '',
        toFixedFix = function (n, prec) {
            var k = Math.pow(10, prec);
            return '' + Math.round(n * k) / k;        };
    // Fix for IE parseFloat(0.55).toFixed(0) = 0;
    s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
    if (s[0].length > 3) {
        s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);    }
    if ((s[1] || '').length < prec) {
        s[1] = s[1] || '';
        s[1] += new Array(prec - s[1].length + 1).join('0');
    }    return s.join(dec);
}

function finance_AutoComplete(from, to){
	if( layer(to) ){
//	if( layer(to).value=='' ){
		layer(to).value = (layer(from))?(layer(from).value):('');
//	}
	}
}

