<?php
ob_start();
if(!(is_readable(realpath(dirname(__FILE__).'/../').'/include/includesroutines.inc'))) {
	die('Error - Could not open or read file '.realpath(dirname(__FILE__).'/../').'/include/includesroutines.inc');
} else {
	include_once(realpath(dirname(__FILE__).'/../').'/include/includesroutines.inc');
}
?>

function refreshMainMenuPollsCount(){
    urlservice =  "<?php  echo getCurPageURLWO('js').'service/mainMenuPollsCountService.php';?>";
    $.ajax({
        url: urlservice,
        type: 'get',
        success: function(data) {
            if(data && data.length > 0) {
                $('#pollcounterinconer').html(data).show("slow").parent().find('span').css('padding-right',( data.length > 2 ? '35px' : '25px'));
            } else {
                $('#pollcounterinconer').hide().parent().find('span').css('padding-right','8px');
                $('#pollcounterinconer').remove();
            }
        }
    });
}

function refreshMainMenuNewMessagesCount(){
    urlservice =  "<?php  echo getCurPageURLWO('js').'service/mainMenuNewMessagesCountService.php';?>";
    $.ajax({
        url: urlservice,
        type: 'get',
        success: function(data) {
            if(data && data.length > 0) {
                $('#discussioncounterinconer').html(data).show("slow").parent().find('span').css('padding-right',( data.length > 2 ? '35px' : '25px'));
            } else {
                $('#discussioncounterinconer').hide().parent().find('span').css('padding-right','8px');
                $('#discussioncounterinconer').remove();
            }
        }
    });
}

