//main_menu $(document).ready(function(){ ieVer = 9; if (($.browser.msie) && ($.browser.version <= '8.0')) { ieVer = $.browser.version; } //level1 $('#main_menu ul.menu').children('li:has(ul)').addClass('parrent_l1'); $('#main_menu li.parrent_l1').children('ul').wrap('
'); if(ieVer > '8.0'){ $('#main_menu li.parrent_l1').children('div').css('opacity', 0); } $('#main_menu li.parrent_l1').hover(function() { if(ieVer > '8.0'){ $(this).children('div').css('opacity', 0); } $(this).children('div').css('left',0); levWidth = $(this).children('div').outerWidth(true); rightOfs = $(this).children('div').offset(); rightOfs = parseInt((rightOfs.left)) + levWidth; winWidth = $(window).width(); dimm = winWidth - rightOfs; if ( dimm < 0){ $(this).children('div').css({'left':'auto','right':0}); } if(ieVer > '8.0'){ $(this).children('div').animate({opacity: '1.0'}); } }, function() { $(this).children('div').css({'left':-999+'em','right':'auto'}); if(ieVer > '8.0'){ $(this).children('div').css('opacity', '0'); } }); //level2_and_more $('#main_menu ul.menu li ul').children('li:has(ul)').addClass('parrent_l2'); $('#main_menu li.parrent_l2').children('ul').wrap('
'); if(ieVer > '8.0'){ $('#main_menu li.parrent_l2').children('div').css('opacity', 0); } $('#main_menu li.parrent_l2').hover(function() { if(ieVer > '8.0'){ $(this).children('div').css('opacity', 0); } $(this).children('div').css('left',180); levWidth = $(this).children('div').outerWidth(true); rightOfs = $(this).children('div').offset(); rightOfs = parseInt((rightOfs.left)) + levWidth; winWidth = $(window).width(); dimm = winWidth - rightOfs; if ( dimm < 0){ $(this).children('div').css('left',-180); } if(ieVer > '8.0'){ $(this).children('div').animate({opacity: '1.0'}); } }, function() { $(this).children('div').css({'left':-999+'em','right':'auto'}); if(ieVer > '8.0'){ $(this).children('div').css('opacity', '0'); } }); //select_color $('#main_menu li a').css('color','#666'); imSelected(); $('#main_menu li:not(:first)').hover(function() { $(this).children('a').css('color','#4FB6DD'); }, function() { $(this).children('a').css('color','#666'); imSelected(); }); }); function imSelected(){ $('#main_menu li.selected').children('a').css('color','#4FB6DD'); $('#main_menu li:first').children('a').css('color','#fff'); }; //tabber $(function(){ $('div#tabber div#tabber_switcher a') .click(function(){ tabbox = 'div#tabber'; tabs = 'div.tabber_tab'; actclass = 'active'; speed = 500; thisLink = $(this); if($(this.hash).css('display')=='none'){ thisLink.parent().parent().find('a').removeClass(actclass); thisLink .addClass(actclass) .parents(tabbox) .find(tabs).hide().end() .find(this.hash).animate({opacity : 'show'},speed); } return false; }); }); //LogReg $(function(){ $('.login_switch').click(function() { $('body').append('
'); $('#overlay_bg').css({'opacity' : '0'}); $('#login_pos_inner_bg').prepend(''); $('#overlay_bg').show().animate({'opacity' : '0.7'}); $('#login_pos_inner_bg').show().animate({'top' : '50%'}); return false; }); $('#login_pos_inner_bg a.close_login, #overlay_bg').live('click', function() { $('#login_pos_inner_bg').animate({'top' : '-1000px'},500,hideOver); return false; }); }); function hideOver(){ $('#overlay_bg').animate({'opacity' : '0'},hideBg); } function hideBg(){ $('object').css('visibility', 'visible'); $('embed').css('visibility', 'visible'); $('#login_pos_inner_bg').hide(); $('#login_pos_inner_bg a.close_login,#overlay_bg').remove(); }; //CatList jQuery.cookie = function (key, value, options) { if (arguments.length > 1 && (value === null || typeof value !== "object")) { options = jQuery.extend({}, options); if (value === null) { options.expires = -1; } if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setDate(t.getDate() + days); } return (document.cookie = [ encodeURIComponent(key), '=', options.raw ? String(value) : encodeURIComponent(String(value)), options.expires ? '; expires=' + options.expires.toUTCString() : '', options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } options = value || {}; var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent; return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; }; $(function() { $('#cat_list').append(''); $('#cat_list').addClass('close'); $('#cat_list').css('left' , -230); cvalue = $.cookie('clo'); if ( cvalue == 'open') { $('#cat_list').css({'left': 0}); $('#cat_list').removeClass('close').addClass('open'); $('#cat_list #cat_list_switch a.inactive').removeClass('inactive') $('#cat_list #cat_list_switch a').addClass('active'); } $('#cat_list #cat_list_switch a.inactive').live('click', function(){ $('#cat_list_switch').hide(); cookieName = 'clo'; cookieValue = 'open'; $(this).removeClass('inactive'); $(this).addClass('active'); $('#cat_list').animate({'left':0}); $('#cat_list').removeClass('close'); $('#cat_list').addClass('open'); $.cookie(cookieName, cookieValue, { path: '/', expires: 10 }); return false; }); $('#cat_list #cat_list_switch a.active').live('click', function(){ $('#cat_list_switch').hide(); cookieName = 'clo'; $(this).removeClass('active'); $(this).addClass('inactive'); $('#cat_list').animate({'left':-230}); $('#cat_list').removeClass('open'); $('#cat_list').addClass('close'); $.cookie(cookieName, null, { path: '/', expires: 10 }); return false; }); if (($.browser.msie) && ($.browser.version < '9.0')) { $(document).mousemove(mouseMie) }else{ mouseM(); } $(document).scroll(function(){ $('#cat_list_switch').hide(); }); }); function mouseMie(e){ e = e || window.event if (e.pageX == null && e.clientX != null ) { var html = document.documentElement var body = document.body e.pageX = e.clientX + (html && html.scrollLeft || body && body.scrollLeft || 0) - (html.clientLeft || 0) e.pageY = e.clientY + (html && html.scrollTop || body && body.scrollTop || 0) - (html.clientTop || 0) } scrollT = document.documentElement.scrollTop; winHt = $(window).height(); cvalue = $.cookie('clo'); if(e.pageX < 300){ if(e.pageY > (scrollT+30)){ if((e.pageY-scrollT) < (winHt-70)){ $('#cat_list_switch').show(); $('#cat_list_switch').css({ 'position' : 'absolute', 'left' : '', 'top' : e.pageY-scrollT-30 }); } } }else{ $('#cat_list_switch').hide(); } } function mouseM(){ $(window).mousemove(function(e){ e.pageX; e.pageY; scrollT = document.documentElement.scrollTop; winHt = $(window).height(); cvalue = $.cookie('clo'); if(e.pageX < 300){ if(e.pageY > (scrollT+30)){ if((e.pageY-scrollT) < (winHt-70)){ $('#cat_list_switch').show(); $('#cat_list_switch').css({ 'position' : 'absolute', 'left' : '', 'top' : e.pageY-scrollT-30 }); } } }else{ $('#cat_list_switch').hide(); } }); } $(document).ready(function() { ccvalue = $.cookie('ccl'); $('.component ul.video_cat_list').parent('div.component').prepend('
Категории - развернуть/свернуть список категорий
'); if ( ccvalue == 'open') { $('a.hidecat').addClass('active'); $('.component').children('ul.video_cat_list').show(); }else{ $('.component').children('ul.video_cat_list').hide(); $('a.hidecat').addClass('inactive'); } $('a.hidecat.inactive').live('click', function(){ $(this).removeClass('inactive'); $(this).addClass('active'); $('.component ul.video_cat_list').show(); cookieName = 'ccl'; cookieValue = 'open'; $.cookie(cookieName, cookieValue, { path: '/', expires: 10 }); return false; }); $('a.hidecat.active').live('click', function(){ $(this).removeClass('active'); $(this).addClass('inactive'); $('.component ul.video_cat_list').hide(); cookieName = 'ccl'; $.cookie(cookieName, null, { path: '/', expires: 10 }); return false; }); }); //tips $(document).ready(function() { $('.t_upload').live('mousemove', function(y) { var mousex = y.pageX+50; var mousey = y.pageY-50; var tipVisX = $(window).width() - (mousex); var tipVisY = $(document).height() - (mousey); if ( tipVisX < 50 ) { mousex = y.pageX - 50; } if ( tipVisY < 0 ) { mousey = y.pageY - 50; } $('.t_upload td .hinttext').css({ top: mousey, left: mousex }); }); }); //movie functions $(document).ready(function() { if($('.video_menu').length>0) { if ($.browser.msie){ $('a.login_switch').click(function(){ $('object').css('visibility', 'hidden'); $('embed').css('visibility', 'hidden'); }); } else { $('embed').attr("wmode", "opaque"); } $('div.component').css('position', 'relative'); } movCon = $('#field_for_movie_content'); simMov = $('#plugin_p_similarmovie'); simMov.css('display', 'block'); $('.h_movie').next('.info').next('table').addClass('videotable'); //ajax $('div.component').ajaxComplete(function(){ catVal = $('.component ul.video_cat_list'); catEx = $('.hidecat'); if(catVal.length>0) { if(!catEx.length){ ccvalue = $.cookie('ccl'); $('.component ul.video_cat_list').parent('div.component').prepend('
Категории - развернуть/свернуть список категорий
'); if ( ccvalue == 'open') { $('a.hidecat').addClass('active'); $('.component').children('ul.video_cat_list').show(); }else{ $('.component').children('ul.video_cat_list').hide(); $('a.hidecat').addClass('inactive'); } $('a.hidecat.inactive').live('click', function(){ $(this).removeClass('inactive'); $(this).addClass('active'); $('.component ul.video_cat_list').show(); cookieName = 'ccl'; cookieValue = 'open'; $.cookie(cookieName, cookieValue, { path: '/', expires: 10 }); return false; }); $('a.hidecat.active').live('click', function(){ $(this).removeClass('active'); $(this).addClass('inactive'); $('.component ul.video_cat_list').hide(); cookieName = 'ccl'; $.cookie(cookieName, null, { path: '/', expires: 10 }); return false; }); } } $('.mod_latest_entry').has('.mod_latest_desc').children('.mod_latest_image').children('img').css({'width':'auto','height':'auto'}); if(movCon.length>0) { $('.top_movie').css({'height':62, 'padding-top':0}); if(!$('.top_movie h3').next('div').hasClass('clear')){ $('.top_movie h3').after('
'); } conWd = $('#content_wrap').width() - 20; if(conWd<800){ $('.top_movie').next('table').addClass('videotable'); vidTab = $('table.videotable'); $('.videotable tr:eq(0) td#field_for_movie_content #view_movie_div').after($('.videotable tr:eq(0) td#field_for_movie_content').next('td').children('.video_menu')); $('.videotable tr:eq(0) td#field_for_movie_content #view_movie_div').next('.video_menu').css({'float':'right','width':208}); sortW = $('.videotable tr:eq(0) td#field_for_movie_content ul.sort').outerWidth(); if(sortW>600){ $('.videotable tr:eq(0) td#field_for_movie_content ul.sort').css({'width' : sortW-208,'clear':'none'}); } } } }); if($('.photo_descr .search_form').length>0) { conWd = $('#content_wrap').width() - 20; if(conWd<800){ $('.photo_descr .search_form input.text-input').css('width', '79%'); } } if(movCon.length>0) { $('.top_movie').css({'height':62, 'padding-top':0}); $('.top_movie h3').after('
'); conWd = $('#content_wrap').width() - 20; if(conWd<800){ $('.top_movie').next('table').addClass('videotable'); vidTab = $('table.videotable'); $('.videotable tr:eq(0) td#field_for_movie_content #view_movie_div').after($('.videotable tr:eq(0) td#field_for_movie_content').next('td').children('.video_menu')); $('.videotable tr:eq(0) td#field_for_movie_content #view_movie_div').next('.video_menu').css({'float':'right','width':208}); sortW = $('.videotable tr:eq(0) td#field_for_movie_content ul.sort').outerWidth(); if(sortW>600){ $('.videotable tr:eq(0) td#field_for_movie_content ul.sort').css({'width' : sortW-208,'clear':'none'}); } } } $('.video_wrap .video_menu:first .links').after('') $('.video_wrap .video_menu:first a.user_block_switch').live('click', function(){ $(this).addClass('active'); $('.video_wrap .video_menu:first .user-block').show(); return false; }); $('.video_wrap .video_menu:first a.user_block_switch.active').live('click', function(){ $(this).removeClass('active'); $('.video_wrap .video_menu:first .user-block').hide(); return false; }); $('table.videotable .video_menu p:has(strong)').wrapAll('
'); $('table.videotable .video_menu .vid_info').before('Дополнительная информация по ролику'); $('table.videotable .video_menu .vid_info').slideUp(1); $('table.videotable .video_menu a.vid_info_switch').live('click', function(){ $('table.videotable .video_menu .vid_info').slideToggle(); return false; }); $('#recommend, .video_wrap .info #to_id input:last').live('click',function(){ ofTop = parseInt($('.video_wrap .video_menu').outerHeight(true) + $('.video_wrap .h_movie').outerHeight(true) + $('.video_wrap .info').outerHeight(true)); simMov.css('top', ofTop); return false; }); $('.video_menu .cont').append('
'); }); //latest news photo $(document).ready(function() { $('.mod_latest_entry').has('.mod_latest_desc').children('.mod_latest_image').children('img').css({'width':'auto','height':'auto'}); }); //buttons ie7,8 $(document).ready(function() { if (($.browser.msie) && ($.browser.version <= '8.0')){ $('input[type=button],input[type=submit]').wrap(''); } });