
$(document).ready(function() {
        function menu_open()  { $(this).find('ul').eq(0).css("opacity","0").css("visibility","visible").fadeTo(500, 1, function() { $(this).css("opacity",""); }); }
    function menu_close() { $(this).find('ul').eq(0).fadeTo(300, 0, function() { $(this).css("visibility","hidden"); }); }

    var config = {    
         sensitivity: 2,    
         interval: 100,    
         timeout: 100,    
         over: menu_open,    
         out: menu_close    
    };

        $("table.menu_top td , table.menu_top td li ").hoverIntent(config);

        /*$("table.menu_top td table td, table.menu_top table td li").hoverIntent(config);

    $("table.menu_top td table td ul li ul").each(function() {
       $(this).css('left',$(this).parent().parent('ul').width());
       $(this).css('top',$(this).parent('li').eq(0).find('a').position().top);
    }); */
                                                   
                                                   
    // Uniform jQuery
    $("input, textarea, reset, button").uniform();
	//$("input, textarea, reset, select, button").uniform();
    
    // lightbox
   // $("a[href$=.jpg], a[href$=.png], a[href$=.gif], popup").lightBox();
   
});
function display(id) {
    obj = document.getElementById(id);
    obj.style.display = (obj.style.display == 'none') ? '' : 'none';
}

function slide(id) {
    obj = document.getElementById(id);
    $(obj).slideToggle("normal");
}
                
function select(obj) {
        $(obj).siblings('.selected').removeClass('selected');
    $(obj).addClass('selected');
}

function element(id)                                                                                                                                          
{                                                                                                                                          
    if(document.getElementById)                                                                                                                                          
    return document.getElementById(id);                                                                                                                                          
    if(document.all)                                                                                                                                          
    return document.all(id);                                                                                                                                          
    if(document.layers)                                                                                                                                          
    return document.layers(id);                                                                                                                                          
}                                                                                                                                          

function ShowPage(div_name, url, param) 
{                                  
    if (param == "") param = "t=1";                     
    $("#loading").ajaxStart(function(){                                 
      $(this).show();                 
    });                                                                                                                                          

    $.post(url, param, function(data){                                    
       element(div_name).innerHTML=data;                                    
    });                                    
    $("#loading").ajaxStop(function(){                                 
      $(this).hide();                                                                                                                                          
    });                                                                                                                                          
} 




/* в избранное */

function getBrowserInfo() {
    var t,v = undefined;
   
    if (window.chrome) t = 'Chrome';
    else if (window.opera) t = 'Opera';
    else if (document.all) {
        t = 'IE';
        var nv = navigator.appVersion;
        var s = nv.indexOf('MSIE')+5;
        v = nv.substring(s,s+1);
    }
    else if (navigator.appName) t = 'Netscape';
   
    return {type:t,version:v};
}

function bookmark(a){
    var url = window.document.location;
    var title = window.document.title;
    var b = getBrowserInfo();
   
    if (b.type == 'IE' && 8 >= b.version && b.version >= 4) window.external.AddFavorite(url,title);
    else if (b.type == 'Opera') {
        a.href = url;
        a.rel = "sidebar";
        a.title = url+','+title;
        return true;
    }
    else if (b.type == "Netscape") window.sidebar.addPanel(title,url,"");
    else alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
    return false;
} 

/* /в избранное  */

if($.browser.msie)
jQuery.fx.off = true;
