$(document).ready(function() { jQuery('#go_search').liveSearch({url: '/ajax_search.php?' + '&q='}); if ($.browser.msie && $.browser.version < 8) { $("*:first-child").addClass("first-child") $("*:last-child").addClass("last-child") }; $(".tabs li").click(function() { var li = $(this); var a = li.find("a"); var id = a.attr("href"); li.parents(".tabs-container").find(".tabs li").removeClass("current"); li.addClass("current"); $(id).fadeIn(); $(id).nextAll(".tab-content").hide() $(id).prevAll(".tab-content").hide() return false }); // embed menu $(".embed-selection li").click(function() { var li = $(this); var a = li.find("a"); var id = a.attr("href"); $(".embed-selection li").removeClass("current"); li.addClass("current"); $(id).fadeIn(); $(id).nextAll(".tab-content").hide() $(id).prevAll(".tab-content").hide() return false }); $('#nav ul li').hover( function () { $(this).children('div').fadeIn(); }, function () { $(this).children('div').hide(); } ); }); // gallery carousel function gallery_carousel_initCallback(carousel) { $('#thumbs li').bind('click', function() { carousel.scroll($.jcarousel.intval($(this).index())+1); $(this).addClass('active'); $(this).nextAll('li').removeClass('active'); $(this).prevAll('li').removeClass('active'); return false; }); }; // placeholder $(function(){ $('input[placeholder], textarea[placeholder]').placeholder(); }); var mark_show=new Image; mark_show.src="/images/icon-red-star.gif" var mark_hide=new Image; mark_hide.src="/images/icon-grey-star.gif" function marks(id,type, cur_mark){ for (i=1;i<=id;i++) { if (type=="show") { document.getElementById("mark"+i).src="/images/icon-red-star.gif"; } else if (type=="hide" && i>cur_mark) { document.getElementById("mark"+i).src="/images/icon-grey-star.gif"; } } } function addmark(id, pid){ for (i=1; i<=5; i++){ document.images["mark"+i].src=mark_hide.src; document.images["mark"+i].onmouseout = 'marks('+i+',\'hide\', '+id+'); '; } for (i=1; i<=id; i++){ document.images["mark"+i].src=mark_show.src; document.images["mark"+i].onmouseout = null; } var req = new JsHttpRequest(); req.caching = false; req.onreadystatechange = function() { if (req.readyState == 4) { //document.getElementById('mark_res').innerHTML = req.responseJS.res; } } req.open(null, '/include/ajax/set_program_mark.php', true); req.send( { prid: pid, mark: id } ); }