
//a=getChronicles

function getInfo(act, target, envAfterLoad)
{
         JsHttpRequest.query(
                'GET /guide/chronicle.php', // backend
                {
                    'a':act,
                    'nd':1
                },

                function(result, errors) {
                        if(result)
                        {
                            document.getElementById(target).innerHTML=result;
                            eval(envAfterLoad)
                        }
                },
                true  // do not disable caching
            );
}

function SetClass(xid, xclass){

var bTest = document.getElementById(xid);

    if (bTest!=null){

    bTest.className=xclass;

    }

}

function refreshEmotions()
{
    var menu = document.getElementById('note_emotions');
    if(menu)
    {
        if(menu.options.selectedIndex >= 0)
        {
            menu.options[menu.options.selectedIndex].selected=false;
        }
    }
}
var NotfirstCheak = 0;
function cheakImotion(obj)
{
    var menu = document.getElementById('note_myemotion');
	var emotionAsmile = document.getElementById('emotionAsmile');
	if(obj && menu)
    {
        if(obj.options.selectedIndex > 0)
        {
            menu.style.display='none';
			emotionAsmile.src=emotionsPic[obj.options.selectedIndex];
			emotionAsmile.style.display='';
        }
		else
		{
			emotionAsmile.style.display='none';
			menu.style.display='';
			if ( NotfirstCheak ) menu.value='';
			menu.disabled=false;
		}
		NotfirstCheak=1;
    }
}

function confirmLink(theLink, confirmMsg)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg);
    if (is_confirmed) {
        if ( typeof(theLink.href) != 'undefined' ) {
            theLink.href += '&is_js_confirmed=1';
        } else if ( typeof(theLink.form) != 'undefined' ) {
            theLink.form.action += '?is_js_confirmed=1';
        }
    }

    return is_confirmed;
} // end of the 'confirmLink()' function


