
$(document).ready(function(){
	/*$('.box-content').corner("3px");
	$('.board-time').corner("3px");
	$('.text').corner("3px");
	$('.postnav').corner("3px");
	$('.post-date').corner("3px");
	$('.addcomm').corner("3px");
	$('.code-refresh img').corner("3px");*/
	
	DD_roundies.addRule('.box-content', '3px', true);
	DD_roundies.addRule('.board-time', '3px', true);
	DD_roundies.addRule('.text', '3px', true);
	DD_roundies.addRule('.postnav', '3px', true);
	DD_roundies.addRule('.post-date', '3px', true);
	DD_roundies.addRule('.addcomm', '3px', true);
	DD_roundies.addRule('.code-refresh img', '3px', true);
	DD_roundies.addRule('.textarea', '3px', true);
	DD_roundies.addRule('.popular', '3px', true);

	
	$('.text').each(function(item){
        var val = $(this).val();
        if (val) {
            $(this).attr('valdata', 'data-' + item);
            jQuery.data(document.body, 'data-' + item, val);
            $(this).focus(function(){
                var valdata = $(this).attr('valdata');
                if ( $(this).val() == jQuery.data(document.body, valdata)) {
                     $(this).val('');
                }
            });
            $(this).blur(function(){
                var valdata = $(this).attr('valdata');
                if ( $(this).val() == '') {
                    var valdata = $(this).attr('valdata');
                    $(this).val(jQuery.data(document.body, valdata));
                }
            });
        }
    });
    
    if ( $('#slider').length != 0) {
		$('#slider').s3Slider({
		    timeOut: 3000
		});
    }
    
	
	$('#login_username').focus( function (){
		if ( $(this).val() == 'Логин...') {
			$(this).val('');
		}
	});
	$('#login_username').blur( function (){
		if ( $(this).val() == '') {
			$(this).val('Логин...');
		}
	});
	
	$('#login_password').focus( function (){
		if ( $(this).val() == 'Пароль...') {
			$(this).val('');
		}
	});
	$('#login_password').blur( function (){
		if ( $(this).val() == '') {
			$(this).val('Пароль...');
		}
	});
	
	$('#myAaddComm').click(function(){
		$('#dle-comments-form').submit();
		return false;
	});
	
});

function getCities( obj ) {
	$.post(dle_root + "engine/ajax/get_region.php", {region_id: obj.value}, function (data) {
		$('#city_id').html(data);
	});
	return false;
}

