jQuery.noConflict();

function setDirectionStr()
{
	    jQuery("#otherDirectionWindow").fadeOut("fast");
	    jQuery("#TB_overlay").remove();
	    var str="";
	    var count=0;
	    var ids="0";
	    jQuery(".popupDirForm input").each(
		    function() {
			    if (jQuery(this).attr("checked")){
				ids += ","+this.value;
				if(count<3) {str=str+jQuery(this).next("label").text()+", ";}
				count++;
			    }
			    
		    }
	    );
	    if (str.length>2)
	    {
		    str=str.substring(0,str.length-2);
		    jQuery("#directions").val(ids);
	    }
	    else
	    { 
		    str="на всем направлении";
		    jQuery("#otherDirectionHellip").css("display","none");
	    };

	    if (count>3) str+="&hellip;";
	    jQuery("#otherDirection i").replaceWith("<i>"+str+"</i>");
	    if (jQuery.browser.msie && jQuery.browser.version == 6) {
		    jQuery(".otherDirectionArr").css("top","50%");
	    }
	    return false;
}

jQuery(document).ready(function(){


    //direction Window

    jQuery("#clearFilter").click(function(){
	    jQuery(".popupDirForm input").attr("checked","");
	    jQuery("#otherDirection i").replaceWith("<i>на всем направлении</i>");
	    jQuery("#otherDirectionHellip").css("display","none");
	    jQuery("#otherDirection").removeClass("noBack");
	    if (jQuery.browser.msie && jQuery.browser.version == 6) {
		    jQuery(".otherDirectionArr").css("top","8px");
		    }
	    return false;
    });

    jQuery("#choseDir").click(setDirectionStr);





});




