/* Useful JS lib's    */
  function addOption(selectId, val, txt, selectedValue) {
    var objOption = new Option(txt, val);
    if (val == selectedValue)
    	objOption.selected = true;
     document.getElementById(selectId).options.add(objOption);
   }

function spCheckAll(chkAll)
{
	$("input.killmy").attr('checked', chkAll);
	$("input.killmy").trigger('change');
}
$(document).ready(function(){
	$('input.killmy').change(function(){	SetToKill(this.checked, this.value); });
	$('input#select_all').click(function(){	spCheckAll(this.checked) });
	$("a.thickbox").fancybox({
    	hideOnContentClick: true,
    	overlayShow: true,
    	overlayOpacity: 0.7,
    	zoomSpeedIn: 300,
    	zoomSpeedOut:300
    });
    $("a.fbox").fancybox({
    	hideOnContentClick: false,
    	overlayShow: true,
    	overlayOpacity: 0.7,
    	zoomSpeedIn: 300,
    	zoomSpeedOut:300,
    	frameWidth: 350,
    	frameHeight: 450
    });
    $('#login').focus(
    	function(){
    		if(this.value=='ваш e-mail'){
    			this.value='';
    		}
    	}
    );
    $('a.open_msg').click(function(){
    	msgId=this.href;
    	parts=msgId.split('#');
    	msgId=parts[1];
    	$('#msg_'+msgId).slideToggle("slow");
    	xajax_PagerControl('Read', msgId); 
    	return(false);
    });
});
/********* pager ********/
var aChkedIds=new Array();
function SetToKill(bState, iValue)
{
	if(bState)
	{
		aChkedIds[iValue]=iValue;
	}
	else
	{
		delete aChkedIds[iValue];
	}
}
/********* pager ********/
opened="";
function spHide(idStr)
{

        Object=document.getElementById(idStr);
        if(Object!=null)Object.style.display="none"

}
function spShow(idStr) {

        Object=document.getElementById(idStr);
        if(Object!=null)Object.style.display="block"
}
function spTicSingle(idStr) {

        Object=document.getElementById(idStr);
        if(Object.style.display=="block")
            {
             Object.style.display='none'
            return false
            }
                        else
             {
             Object.style.display='block'
             return false
             }

}
function spTic(idStr) {

        Object=document.getElementById(idStr);
        if(Object.style.display=="block")
            {
             Object.style.display='none'
            return false
            }
                        else
             {
             Object.style.display='block'
             return false
             }

}
function spSetHtml(idStr, ValueStr) {

        Object=document.getElementById(idStr);
        Object.innerHTML=ValueStr;

}