$(document).ready(function() { $('.checkRequiredNoMCE').submit(function(){ var reqarr = $(this).find(".required"); var error = false; reqarr.each(function(i,req) { //alert($(req).attr('name')+" : "+$(req).val()); $(req).val($(req).val().trim()); if (!$(req).val() || $(req).val() == '0') { $(req).css({border:'1px red solid'}); error = true; } else { $(req).css({border:'1px #aaa solid'}); } }); if (error) { $(this).find("#form_check_msg").html("Заполните обязательные поля"); return false; } }); $('#prod_add_strings_btn').click(function(){ $('#cloneTR').clone().appendTo('#prod_table'); }); $('.uord_invalid2valid_link').click(function(){ $(this).load("/index.php?section=buy&act=orders_ajax&subact=orders_validate&uord_id="+$(this).attr('uord_id'),function(){ $(this).removeClass('uord_invalid2valid_link'); $(this).addClass('uord_turned2valid_link'); }); }); $('.click2showtitle').click(function(){ //alert($(this).attr('title')); //$(this).hide(); $(this).parent().html($(this).attr('title')); //$(this).after($(this).attr('title')); }); $('#mmq_counter').load('/index.php?section=massmail&act=massmail_ajax&subact=mmq_counter&comp_id='+$('#mmq_counter').attr('comp_id')); var refreshId = setInterval(function() { $('#mmq_counter').html(""); $('#mmq_counter').load('/index.php?section=massmail&act=massmail_ajax&subact=mmq_counter&comp_id='+$('#mmq_counter').attr('comp_id')); }, 5000); /** * Showing teasers block */ var teaserElArr = $('.teaser_block'); teaserElArr.each(function(i,teaserEl){ //alert(i+": "+$(teaserEl).attr("count")); $(teaserEl).load("/index.php?section=teaser&act=teaser_ajax&subact=get_teaser_block&count="+$(teaserEl).attr("count"),function(){ $(teaserEl).append("Как разместить здесь тизер?"); }); }); // Top teasers var teaserElArr = $('.teaser_top'); teaserElArr.each(function(i,teaserEl){ //alert(i+": "+$(teaserEl).attr("count")); $(teaserEl).load("/index.php?section=teaser&act=teaser_ajax&subact=get_teaser_top&top_pos="+$(teaserEl).attr("teaser_top_pos")); }); /** * end of teasers block */ });