$(document).ready(function() { $('#Links').cycle('fade');$("div.searchform button").click(function(){ text = $(this).parent().find('input').val().replace(/^[\s]+|[\s]+$/g, '').replace(/[^a-zA-Z0-9]+/g, '_').toLowerCase();select = $(this).parent().find("#search_select").val();type = $(this).parent().parent().attr('rel');if(type){if(text){if(select){window.location = '/'+ type +'/' + text + '/' + select + '/';}}}return false;});menuYloc = parseInt($("#nicemenu").css("top").substring( 0, $("#nicemenu").css("top").indexOf("px")));$(window).scroll(function () {var offset = $(document).scrollTop() + 0 + "px";if ($(document).scrollTop() > 2) $("#nicemenu").animate({ top: offset }, { duration: 500, queue: false });else $("#nicemenu").animate({ top: menuYloc + "px" }, { duration: 500, queue: false });}); $("#q").bind('keyup', function() {query = $(this).val();$.get("/livesearch.php", { q: query }, function(data){$('.search_bt').css('display','block');$('.result_left').html(data);}); } );$(".movies_menu img.arrow,.tv_menu img.arrow,.anime_menu img.arrow").click(function(){ submenu = $(this).parent().parent().find("div.sub_menu");send = $(this).parent().attr('class');if($(submenu).attr('class').match('resetwidth')){}else{$(submenu).addClass("loading"); $(submenu).html(''); $.get("/index-f.php", { menu: send }, function(data){$(submenu).removeClass("loading"); $(submenu).addClass("resetwidth");$(submenu).html(data); });}});$("#nicemenu img.leftsearch").click(function(){ $("span.head_menu").removeClass('active');submenu = $(this).parent().parent().find("div.sub_menu");if(submenu.css('display')=="block"){$(this).parent().removeClass("active"); submenu.hide(); }else{$(this).parent().addClass("active"); submenu.fadeIn(); }$("div.sub_menu:visible").not(submenu).hide();$("#nicemenu img.arrow").not(this).attr('src','/img/arrow.png');});$("#nicemenu img.arrow").click(function(){ $("span.head_menu").removeClass('active');submenu = $(this).parent().parent().find("div.sub_menu");if($(submenu).css('marginLeft') =="0px"){mleft = $(this).parent().parent().find("span.head_menu").width() + 9;$(submenu).css({marginLeft:+mleft+'px'})}if(submenu.css('display')=="block"){$(this).parent().removeClass("active"); submenu.hide(); $(this).attr('src','/img/arrow_hover.png');}else{$(this).parent().addClass("active"); submenu.fadeIn(); $(this).attr('src','/img/arrow_hover.png');}$("div.sub_menu:visible").not(submenu).hide();$("#nicemenu img.arrow").not(this).attr('src','/img/arrow.png');}).mouseover(function(){$(this).attr('src','/img/arrow_hover.png'); }).mouseout(function(){ if($(this).parent().parent().find("div.sub_menu").css('display')!="block"){$(this).attr('src','/img/arrow.png');}else{$(this).attr('src','/img/arrow_hover.png');}});$("#nicemenu span.head_menu").mouseover(function(){ $(this).addClass('over')}) .mouseout(function(){ $(this).removeClass('over') });$("#nicemenu div.sub_menu").mouseover(function(){ $(this).fadeIn(); }) .blur(function(){$(this).hide();$("span.head_menu").removeClass('active');});$(document).click(function(event){ var target = $(event.target);if (target.parents("#nicemenu").length == 0) {$("#nicemenu span.head_menu").removeClass('active');$("#nicemenu div.sub_menu").hide();$("#nicemenu img.arrow").attr('src','/img/arrow.png');}});tip_id = null;if($('.main_ul .movie_list li #tooltip').length) {tip_id= ".main_ul .movie_list li, .primary #tooltip_r";}else{if($('.primary #tooltip_r').length) {tip_id = ".primary #tooltip_r";}}if(tip_id){$(tip_id).each(function(){if($(this).find('#tooltip').html()){bwidth = Math.round($(window).width() / 2) - 15;bleft = Math.round($(this).position().left);bright = Math.round($(this).position().right);content_r = 'rightMiddle';content = 'leftMiddle';if(bwidth < bleft){content = 'rightMiddle';content_r = 'leftMiddle';}$(this).qtip({content: { text: $(this).find('#tooltip').html(), title: { text: $(this).find('a').text() }}, position: {corner: { tooltip: content, target: content_r } }, show: {when: false,ready: true,solo: true,effect: 'slide' }, show: 'mouseover', hide: 'mouseout', style: {width: 300,background: '#cecece',color: 'black',border: { width: 3, radius: 3, color: '#ddd'},padding: 10, textAlign: 'left',tip: true,name: 'light'}});}});}$('.subnav #menu_subselect').each(function(){$(this).click(function(){ return false; });$(this).qtip({ content: {url: '/index-f.php',data: { menu: $(this).attr('get') },method: 'get' }, position: {corner: {target: 'bottomMiddle',tooltip: 'topRight'} }, show: {when: false,ready: true,solo: true, }, show: { when: { event: 'click' } },hide: { when: { event: 'inactive' }, delay: 2000 }, style: {width: 350,background: '#000',border: { width: 3, radius: 3, color: '#ddd'},padding: 10, textAlign: 'left',tip: true,name: 'light'}});}); });