$(document).ready(function(){
    if (location.href=="http://megastar.su/" || location.href=="http://www.megastar.su/" || location.href=="http://megastar.zzz/" || location.href=="http://www.megastar.zzz/" || location.href=="http://megastar.rekoweb.ru/" || location.href=="http://www.megastar.rekoweb.ru/") {
        // alert(location.href); alert(location.href.length) }
        $("body").css("overflow","hidden");
        $('<div id="ffoverlay"><div id="flashka"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/eGmkQvRT4Dw&amp;hl=ru_RU&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/eGmkQvRT4Dw&amp;hl=ru_RU&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></div></div>').appendTo("body");
        $('<br/><a id="flashka_close" href="#" onClick="remove_ffoverlay()">Перейти на сайт</a>').appendTo("#flashka");
    }
}); 

function remove_ffoverlay() {
    $("#ffoverlay").remove();
    $("body").css("overflow","visible");
}
function get_prev_calendar() {
    $.post("/cgi-bin/calendar_event.py",
    {   month:$("#month").text(),
        year: $("#year").text(),
        prev:"true",
        ajax:"true"
    },function(data)
    {
        $("#calendar_event").html(data);
    }
    );
}
/*
$("#next_month").bind('click',function(even) {
    get_next_calendar(); return false;
});*/
function get_next_calendar() {
    $.post("/cgi-bin/calendar_event.py",
    {   month:$("#month").text(),
        year: $("#year").text(),
        next:"true",
        ajax:"true"
    },function(data)
    {
        $("#calendar_event").html(data);
    }
    );
}
/*
$("#prev_month").bind('click',function(even) {
    get_prev_calendar(); return false;
});*/
    
$(document).ready(function(){
    var w = $(window);
    $("#div_fon_menu").css("width",(w.width()-64) + "px");
    if ($.browser.opera) {
        $("#div_fon_menu").css("top","236px");
        $(".ld").css("top","238px");
        $(".rd").css("top","238px");    
    }
    if ($.browser.msie) {
       $("#div_fon_menu").css("top","241px");
        $(".ld").css("top","243px").css("left","30px");
        $(".rd").css("top","243px").css("right","25px");   
    }
    $("#kolonki>tbody>tr>td:nth-child(1)").css("width","25%").css("padding-right","4%");
    //$("#kolonki>tbody>tr>td:nth-child(2)").css("width","44%");
    $("#kolonki>tbody>tr>td:nth-child(3)").css("width","25%").css("padding-left","4%");
    
    if ($('#price').length) {
        $('#price tr:odd').addClass('price_odd');
        $('#price tr:even').addClass('price_even');
        $('#price td>strong').parents("tr").addClass('price_first');
        $('#price tr').each(function(event){
            var current=this;
            this.onmouseover = function(event) { 
                if (!event) event=window.event
                var target=(event.target) ? event.target :event.srcElement
                //alert("price");
                $(current).find('td').css("text-decoration","underline")
                //$(current).css("background-color","#d92517");
                //alert(current.tagName)
            }
              this.onmouseout = function(event) { 
                if (!event) event=window.event
                var target=(event.target) ? event.target :event.srcElement
                //alert("price");
                $(current).find('td').css("text-decoration","none")
                //$(current).css("background-color","#d92517");
                //alert(current.tagName)
            }
        });
    }
});
function fun_archive_news_month() {
    //alert($("#archive_news_year option:selected").val())
    
    $.post("/cgi-bin/news.py",
    {   year: $("#archive_news_year option:selected").val(),
        ajax:"true"
    },function(data)
    {
        $("#div_archive_news_month").html(data);
    }
    );
};

