// do not delete this line.
var $j = jQuery.noConflict();

$j(function(){
	$j('<div id="ajax-loading">Please Wait...</div>').prependTo('body').css('opacity',0);
	$j('<div id="ajax-error"><span>Error...</span> - <a onclick="$j(\'#ajax-error\').fadeTo(200,0);">Close</a></div>').prependTo('body').css('opacity',0).hide();
	$j("#ajax-loading").ajaxStart(show_ajax);
	$j("#ajax-loading").ajaxStop(hide_ajax);
	$j("#ajax-error").ajaxError(function(e, xhr, settings, exception){
		if(xhr.status==400) {
			$j('#ajax-loading').hide();
			$j('#ajax-error span').html(xhr.responseText);
			$j('#ajax-error').show().fadeTo(200,.8);
			}
		});
	$j('form').submit(show_ajax);
});
function show_ajax(){$j('#ajax-error').hide();$j('#ajax-loading').css('opacity',0).show().fadeTo(500,.8);}
function hide_ajax(){$j('#ajax-loading').fadeTo(500,0,function(){$j(this).html('Please Wait...').hide();});}
/*****************************
*********** helpers **********
*****************************/

/**
* Ajax request
*
* @params: 
* params: object
*
*/

//~ function do_ajax(params)
//~ {	
//~ var data = '';
//~ 
//~ for (i in params.data)
//~ {
//~ data += i + "='" + params.data[i] + "'";
//~ //(indexOf(params.data) != params.data.length - 1) ? data += '&' : '';
//~ }
//~ 
//~ alert(data);return false;
//~ $j.ajax({
//~ type: params.type,
//~ url: params.url,
//~ data: data,
//~ success: function(result){
//~ if(params.reload)
//~ {
//~ window.location.reload();
//~ }
//~ else if(params.json)
//~ {
//~ return eval ('+result+');
//~ }
//~ }
//~ });
//~ }

/**
* toggle 2 blocks
*
* the 2 blocks should have the same id or class concatenated with _v for visible block
* and _h for the hidden block.
*
* if dynamic ids or classes the id_or_class_name will be id_<num>, class_<num>
*
* @params: 
* id_or_class_name: the id or class of the 2 blocks without _h or _v
* type            : the type of the selector('#', '.')
*
* TODO: extra parameter for effects. 
*
*/

function toggle_blocks(type, id_or_class_name)
{
    $j(type+id_or_class_name+'_v, '+type+id_or_class_name+'_h').toggle();
}

/*****************************
*********** scripts **********
*****************************/

function createNewLink(ma_id, url) {
    if (confirm('Are you sure you want to create new link?')) {
        $j('#create_link').after('<img src="/images/ajax-loader.gif" />');
        $j.ajax({
            type: 'get',
            url: url,
            data: 'ma_id='+ma_id,
            success: function(result){
                window.location.reload();
            }
        });
    }
}

function retireLink(ma_id, link_id, url) {
    if (confirm('Are you sure you want to retire this link?')) {
        $j('#retire_link_'+link_id).after('<img src="/images/ajax-loader.gif" />');
        $j.ajax({
            type: 'get',
            url: url,
            data: 'link_id='+link_id+'&ma_id='+ma_id,
            success: function(result){
                window.location.reload();
            }
        });
    }
}

function invite_friends() {
    $j.ajax({
        type: 'post',
        url: '/fb_invite_friends',
        success: function(result){
            my_json = eval ('('+result+')');
            if (my_json.result == 1) {
                var html = '';
                html += '<div style="width:100%;height:650px;opacity:0.7;position:absolute;top:0;left:0;z-index:100;background-color:#000;"></div>';
                html += '<div style="width:486px;position:absolute;top:75px;left:130px;z-index:101;">';
                html += my_json.content;
                html += '</div>';
                $j('#tips').after(html);
            }
        }
    });
}

/**
 * moderators actions in QA pages.
 * delete and unflag questions and articles.
 * 
 * @params int id: the id of the Q or A
 * string type: Q or A
 * string action: delete or unflag.
 */
function moderators_actions(id, type, action) {
    if (confirm('please confirm your action, are you sure?')) {
        $j.ajax({
            type: 'post',
            dataType: 'json',
            url: '/qa_moderators_actions',
            data: {
                'id'     : id,
                'type'   : type,
                'action' : action
            },
            success: function(json){
                if (json.result == 1) {
                    window.location.reload();
                }
            }
        });
    }
}
/**
 * lifeline.
 * vote a provider among providers to help your FB friend choose a bidder.
 * @params string type: the type of the vote(up,down).
 * the rest of the params are clear by the names.
 */
function vote_and_recommend_provider(need_id, type, offering_id, bid_id) {
    $j('#fb_votes_counter_'+bid_id).html('<img style="padding-top:5px;" src="/images/ajax-loader.gif" />');
    $j.ajax({
        type: 'post',
        dataType: 'json',
        url: '/vote_and_recommend_provider',
        data: {
            'need_id'     : need_id,
            'type'        : type,
            'offering_id' : offering_id
        },
        success: function(json){
            if (json.result == 1) {
                $j('#fb_votes_counter_'+bid_id).html(json.votes_count);
                FB.ensureInit(function() {
                    FB.Connect.streamPublish('', json.attachment, null, json.owner_fb_id);
                });
            }
        }
    });
}

function user_favorite_question(question_id) {
    var searchStr = $j('#favorite_link_'+question_id+' img').attr('src');
    var searchResult = searchStr.search("small");
    
    $j.ajax({
        type: 'post',
        datatype: 'json',
        url: '/favorite-user-question',
        data: {
            'question_id': question_id
        },
        success: function(jsonData) {
            var data = eval("(" + jsonData + ")");
            if(data) {
                if(data.error){
                    alert(data.error);
                } else {
                    if(data.is_favorite){
                        if( searchResult != -1){
                            $j('#favorite_link_'+question_id+' img').attr('src','/images/small-yellow-star.gif');
                        } else {
                            $j('#favorite_link_'+question_id+' img').attr('src','/images/big-yellow-star.gif');
                        }
                        $j('#favorite_link_'+question_id).attr('title','Remove From Favorites');
                    } else {
                        if( searchResult != -1){
                            $j('#favorite_link_'+question_id+' img').attr('src','/images/small-blue-star.gif');
                        } else {
                            $j('#favorite_link_'+question_id+' img').attr('src','/images/big-blue-star.gif');
                        }
                        $j('#favorite_link_'+question_id).attr('title','Add To Favorites');
                    }
                }
            }
        }
    });
}

$j(document).ready(function(){
    // primary drop down menu.
    $j('.header-menu-li').hover(
        function() {
            $j(this).children('ul').show();
            $j(this).addClass('header-menu-hover');
        },
        function() {
            $j(this).children('ul').hide();
            $j(this).removeClass('header-menu-hover');
        }
    );
        
    /* rendering rounded blocks.
     *
     * add class rounded to the rounded block and it'll be rendered rounded automatically.
     * 
     */
    if ($j('.rounded').length > 0) {

        /*var properties = $j('.rounded').attr('class').split(' ');
        var expr = 'var x = {';
        for(i=0;i<properties.length;i++) {
            var q = properties[i].split('_');
            if(q[1]) {
                expr += ("'"+q[0] + "':" + q[1] + ",");
            }
        }
        expr = expr.substr(0,expr.length-1) + '};';
        eval(expr);

        var border = RUZEE.ShadedBorder.create(x);
        border.render($j('.rounded'));
        $j('.rounded').show();*/

        $j('.rounded').each(function() {
            var properties = $j(this).attr('class').split(' ');
            var expr = 'var x = {';
            for(i=0;i<properties.length;i++) {
                if (properties[i] == 'rounded') {
                    continue;
                }
                var q = properties[i].split('__');
                if(q[1]) {
                    expr += ("'"+q[0] + "':'" + q[1] + "',");
                }
            }
            expr = expr.substr(0,expr.length-1) + '};';
            eval(expr);

            var border = RUZEE.ShadedBorder.create(x);
            border.render($j(this));
            $j(this).show();
        });
        
        /*$j('.rounded .content').each(function() {
            $j(this).before('<div style="background: url(/images/corners/lt_white.gif) no-repeat;height: 7px;width: 7px;float: left"></div><div style="background: url(/images/corners/rt_white.gif) no-repeat;height: 7px;width: 7px;float: right"></div>');
            $j(this).after('<div style="background: url(/images/corners/lb_white.gif) no-repeat;height: 7px;width: 7px;float: left"></div><div style="background: url(/images/corners/rb_white.gif) no-repeat;height: 7px;width: 7px;float: right"></div>');
        });*/
    }

});

/**
 * lightBox effect
 * displays dimmed background with a big centered loader.
 *
 * used in register and login using facebook connect.
 */
function light_box(block, width) {
    if ($j('#backgroundOverlay').length < 1) {
        var arrayPageSize = [document.body.offsetWidth+document.documentElement.scrollLeft, document.body.offsetHeight+document.documentElement.scrollTop];
        var loaderTop  = 260;
        if (width) {
            var loaderLeft = (arrayPageSize[0]-width)/2;
        } else {
            var loaderLeft = (arrayPageSize[0]-220)/2;
        }
        var html = '<div id="backgroundOverlay" class="dimmed" style="position: absolute; top: 0px; left: 0px; z-index: 190;';
        html += 'width: '+arrayPageSize[0]+'px; height: '+arrayPageSize[1]+'px; background-color: rgb(0, 0, 0); display:none;">';
        if(!block) {
            html += '<img id="ajax-loader-big" src="/images/ajax-loader-big.gif" style="position:absolute;top:'+loaderTop+'px;left:'+loaderLeft+'px;z-index:191;" />';
        }
        html += '</div>';
        if (block) {
            html += '<div id="light_box_content" style="position:absolute;top:'+loaderTop+'px;left:'+loaderLeft+'px;z-index:191;">' + block + '</div>';
        }

        $j('body').append(html);
    }
    $j('#ajax-loader-big').show();
    $j('#backgroundOverlay').show();
}

/**
 * displaying a bid on need detail page in a certain spot on a certain page.
 * @ajax
 * @params array data
 */
function bid_on_spot(data) {

    $j.ajax({
        type: 'post',
        dataType: 'json',
        url: '/bid_on_spot',
        data: data,
        success: function(jsonData) {
            if (jsonData.result == 0) {
                light_box(jsonData.block);
                $j('#current_bid').html(jsonData.current_bid);
                var border = RUZEE.ShadedBorder.create({corner:8,shadow:0,border:0,bg:'FFB784'});
                border.render($j('#outbid-message'));
            }
        }
    });
}

function changeForumStatus(forumId,status) {
    if (confirm('Are you sure you want to '+status+' this forum topic?')) {
         $j.ajax({
           type: "POST",
           url: "my_forums",
           data: "forum_id="+forumId+"&status="+status+"&ajax=1",
           success: function(data){
               if(data == 1){
                    window.location.reload();
               }
           }
         });
    }
}


function changeSpot(num) {
   $j('#spot-container-left .remove-spot-div').removeClass('selected-spot');
   $j('#spot-container-left #spot-div-'+num).addClass('selected-spot');

   $j('#spots-pager a').removeClass('active');
   $j('#spots-pager a#spot-'+num).addClass('active');
   
   $j('.bid-opacity').removeClass('opacity-full');
   $j('.dimmed').removeClass('opacity-full');

   $j('#bid-'+num).addClass('opacity-full');
   $j('#spot-div-'+num).addClass('opacity-full');
   
   var slideTop = 0;
//   switch (num){
//        case 1:
//            slideTop = "0";
//            break;
//        case 2:
//            slideTop = "-220px";
//            break;
//        case 3:
//            slideTop = "-310px";
//            break;
//        case 4:
//            slideTop = "0";
//            break;
//        case 5:
//            slideTop = "-30px";
//            break;
//        case 6:
//            slideTop = "-60px";
//            break;
//        default :slideTop = "-" + ((num - 7) *120) + "px";
//    }

    switch (num){
        case 1:
            slideTop = "0";
            break;
        case 2:
            slideTop = "-220px";
            break;
        case 3:
            slideTop = "-310px";
            break;
        default :slideTop = 0+"px";
    }
   $j("#slide-div").animate({top: slideTop}, 1000 );



}

function changeSpotCheck(num, membership) {
//   $j('.spot-selection-button').css({display: "none"});
//   $j('#spot-selection-button-'+num).css({display: "block"});
   $j('.spot-selection-button').attr('style', "display: none");
   $j('#spot-selection-button-'+num).attr('style', "display: block");
   //$j('input#spot_'+num).val(num);
   $j('input#spot_'+num+':radio').attr("checked","checked");
   $j('#membership_type').val(membership);
   //$j("input[name*='spot_id']:radio").val(num);
   changeSpot(num);
}

function changeSpotPage(page, need_id) {
    $j('#spot-container').html('');
    $j('#spot-container').append('<div align="center" style="padding:200px 0;"><img src="images/loader.gif" alt="" /></div>');
     $j.ajax({
       type: "POST",
       url: "/spot_page/"+need_id+"/"+page+"/",
       success: function(msg){
         //alert( "Data Saved: " + msg );
        $j('#spot-container').html(msg);
        $j("#spot-container-left input:radio:first").click();
        var checked_value1 = $j("#spot-container-left input[type='radio']:checked ").attr('id');
        change_total_cost(checked_value1);
        $j("#spot-container-left input:radio").change(function(){
            var selector = $j(this).attr('id');
            change_total_cost(selector);
        });
        
        
        //checked_value2
       }
     });
}

function toggleDivById(divId, speed) {
   $j('#'+divId).not('#sort-list').toggle();
}

function changeNeedDetailArrow(id) { 
    $j("#"+id+" span.text").toggleClass("need-right-arrow");
}

function changeNeedDetailBackground(id) {
    $j("#"+id).toggleClass("unselected");
}

function show_extra_text(selector_id, link_id) {
//    $j('#'+selector_id).toggle(function () {
//        $j('#'+link_id).html('more');
//        if($j(this).css("display") == 'block'){
//          $j(this).attr('style','display: inline;');
//          $j('#'+link_id).html('less');
//        }
//    });
//    $j('#'+selector_id).toggleClass(function() {
//        $j('#'+link_id).html('more');
//        if($j(this).css("display") == 'block'){
//          $j(this).attr('style','display: inline;');
//          $j('#'+link_id).html('less');
//        }
//    });
    if(!$j('#'+selector_id).hasClass('display-none')) {
        $j('#'+link_id).html('less');
        $j('#'+selector_id).attr('style','display: inline;');
        $j('#'+selector_id).toggleClass('display-none');
    } else {
        $j('#'+link_id).html('more');
        $j('#'+selector_id).attr('style','display: none;');
        $j('#'+selector_id).toggleClass('display-none');
    }
}

/*function fill_service_profile_data(bid_id, type, t_id) {
    //light_box();
    $j.ajax({
        type: "POST",
        data: {'bid_id' : bid_id,
               'type'   : type,
               't_id'   : t_id},
        url: "/fill_service_profile",
        success: function(html) {
            $j('#light_box_content').remove();
            $j('#backgroundOverlay').remove();
            //light_box(html, 550);
        }
     });
}*/

/*function save_service_profile_data(bid_id, t_id, form_serialize) {

    $j.ajax({
        type: "POST",
        dataType: 'json',
        data: {'bid_id' : bid_id,
               't_id'   : t_id,
               'data'   : form_serialize},
        url: "/fill_service_profile/",
        success: function(jsonData) {
            if (jsonData.reload) {
                //window.location.reload();
            } else if(jsonData.error) {
                alert(jsonData.error);
            }
        }
     });
}*/

function addNewRow(id) {json
    var html = '<tr><td><input type="text" name="title['+id+']" /></td>';
    html += '<td><textarea name="description['+id+']"></textarea></td>';
    html += '<td><a class="underlined" href="javascript:;" onclick="$j(this).parents(\'tr\').remove();">delete</a></td></tr>'

    $j('#add-more').attr('onClick', 'addNewRow('+(id+1)+')');
    $j('#dialog-table').append(html);
}

function upload_photo(type, offering_id) {
    //alert($j('#file').val());return false;
    $j.ajax({
        type: "POST",
        contentType: 'multipart/form-data',
        data: $j('#uplaod_form').serialize(),
        url: "/entry_"+type+"s/"+offering_id,
        success: function(jsonData) {
            if (jsonData.reload) {
                //window.location.reload();
            } else if(jsonData.error) {
                alert(jsonData.error);
            }
        }
     });
}

function log_actions(type, action, id) {
    $j.ajax({
        type: "POST",
        url: "log_actions",
        data: "type="+type+"&action="+action+"&id="+id,
        success: function(msg){
            
        }
    });
}

function log_actions_need_details(type, action, id, selector_id, link_id) {
    var link_class = $j('#'+link_id).attr("class");
    if(link_class == 'more') {
        $j.ajax({
            type: "POST",
            url: "log_actions",
            data: "type="+type+"&action="+action+"&id="+id,
            success: function(msg){
                show_extra_text(selector_id, link_id);
                $j('#'+link_id).toggleClass('more');
            }
        });
    } else {
        show_extra_text(selector_id, link_id);
        $j('#'+link_id).toggleClass('more');
    }
}

function log_action_need_details_open_close(selector_id,type, action, id) {
    if($j('#'+selector_id).hasClass("opened-container")) {
        $j.ajax({
            type: "POST",
            url: "log_actions",
            data: "type="+type+"&action=close&id="+id
        });
        $j('#'+selector_id).removeClass('opened-container');
        $j('#'+selector_id).addClass('closed-container');
    } else if($j('#'+selector_id).hasClass("closed-container")) {
        $j.ajax({
            type: "POST",
            url: "log_actions",
            data: "type="+type+"&action=open&id="+id
        });
        $j('#'+selector_id).removeClass('closed-container');
        $j('#'+selector_id).addClass('opened-container');
    }
}

function getSpotSort(sort, need_url, page, call_ff) {
//    $j(".pp_pic_holder").remove();
//    $j(".pp_overlay").remove();
//    $j(".ppt").remove();
    //$j('#my_ppt_Wrapper').remove();
    if(call_ff == 1) {
        page = $j('.sort-li-bids a').attr('page');
    } else {
        $j('.sort-li-bids a').attr('page', page);
    }
    $j('#bids-spots-container').html('');
    $j('#bids-spots-container').html('<div align="center" style="padding: 100px 0;"><img src="images/loader.gif" alt="" /></div>');
    $j.ajax({
        type: "POST",
        url: need_url,
        data: "bids_sort="+sort+"&page="+page,
        success: function(html) {
            $j('#bids-spots-container').html(html);
            load_pretty_photo();
        }
    });
}

function log_action_need(type, action, id) {
    $j.ajax({
        type: "POST",
        url: "log_actions",
        data: "type="+type+"&action="+action+"&id="+id
    });
}

function load_pretty_photo() {
//    var preatyVal = $j("#bids-spots").find('<div class="my_carousel">');
//    alert(preatyVal);
    $j('#my_ppt_Wrapper').remove();
    $j("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
//    $j("#pretty_photo_viewer a[rel^='prettyPhoto']").prettyPhoto({
//        animationSpeed: 'noraml',
//        padding: 40,
//        opacity: 0.35,
//        showTitle: true,
//        allowresize: true,
//        counter_separator_label: '/',
//        theme: 'facebook'
//    });
    
}

function goto_need_detail() {
	$j('form').append('<input type="hidden" name="cancel" value="1">');
	$j('form').submit();
}

function fadein_element(id, background_color) {
    $j('#'+id).fadeIn(3000, function() {
        $j(this).css('background', '#'+background_color);
    });
}


function get_category_specialities(categoty_id, className) {    
    $j('.'+className+'-specialty').html('<option>Loading...</option>');
    $j('.'+className+'-specialty').attr('disabled', 'true');
    $j.ajax({
        type: 'POST',
        url: '/admin/index.php',
        data: 'action=templates&step=get_category_speciality&CID='+categoty_id,
        dataType : "json",
        success: function(result) {
            if(result) {
                var html = '';
                for (x in result) {
                    if(result[x]['sp']) {                        
                        html += '<option value="'+result[x]['av_id']+'">'+result[x]['sp']+'</option>';
                    }
                    //console.log(html);
                    $j('.'+className+'-specialty').html(html);
                    $j('.'+className+'-specialty').removeAttr("disabled");
                }
            } else {
                    $j('.'+className+'-specialty').html('<option value="0">No Specialities</option>');
                    $j('.'+className+'-specialty').removeAttr("disabled");
            }
        },
        error:function(){               
            $j('.'+className+'-specialty').html('<option>Error</option>');
            $j('.'+className+'-specialty').removeAttr("disabled");
        }
    });
}
/*************jcarousel***********/

/************************ General Javascript functions ******************************/
/*
 *How to use:
 *
 *-by creating any new function it should be a general function where we can use it anywhere
 *-it should not be a specific funcion for a specific purpose
 *-use the name: newjs_'function' for any new function
 *
 */


/*this function is for removing the default values of any input or textarea
 *you have to give that input/textarea the class DefaulText
 *and the submit which follows the form the class removeDefault
 *
 **/
    $j(document).ready(function()
{
    $j(".defaultText").focus(function()
    {
        if ($j(this).val() == $j(this).attr("title"))
        {
            $j(this).removeClass("defaultTextActive");
            $j(this).val("");
        }
    });

    $j(".defaultText").blur(function()
    {
        if ($j(this).val() == "" || $j(this).val() == $j(this).attr("title"))
        {
            $j(this).addClass("defaultTextActive");
            //$j(this).val($j(this).attr("title"));
            $j(this).val($j(this)[0].title);
        }
    });

    $j(".defaultText").blur();

    $j(".removeDefault").click(function(){

    $j(".defaultText").each(function() {
                if($j(this).val() == $j(this).attr("title")) {
                $j(this).val("");
                }
            });
    });
});

              $j(document).ready(function(){


            $j("#need_header").hover(function(){

$j("#in_Div").css('backgroundPosition' , '215px 7px') }, function() {

$j("#in_Div").css('backgroundPosition' , '128% 72%');
            });
      });

         $j(document).ready(function(){


            $j("#service_header").hover(function(){

$j("#in_Div").css('backgroundPosition' , '332px 7px') } ,function() {

$j("#in_Div").css('backgroundPosition' , '128% 72%');

            });
      });
    $j(document).ready(function(){


            $j("#community_header").hover(function(){

$j("#in_Div").css('backgroundPosition' , '446px 7px') } ,function() {


$j("#in_Div").css('backgroundPosition' , '128% 72%');

            });
      });


 $j(document).ready(function(){


            $j("#account_header").hover(function(){

$j("#in_Div").css('backgroundPosition' , '562px 7px') } ,function() {

$j("#in_Div").css('backgroundPosition' , '128% 72%');

});

      });











/*

$j(document).ready(function(){


if($j("#account_header").hasClass('selected')){
        $j("#out_Div").css('backgroundPosition' , '636px 23px');
    }
});
$j(document).ready(function(){


if($j("#community_header").hasClass('selected')){
        $j("#out_Div").css('backgroundPosition' , '520px 23px');
    }
});
$j(document).ready(function(){


if($j("#service_header").hasClass('selected')){
        //$j("#out_Div").css('backgroundPosition' , '404px 23px');
    }
});


$j(document).ready(function(){


if($j("#need_header").hasClass('selected')){
        $j("#out_Div").css('backgroundPosition' , '288px 23px');
    }


});
*/

/*************************Jcarousel ****************/


/*************************browse categories****************/


 $j(document).ready(function(){

$j('div.form-header-steps2 div:last-child').css({backgroundImage : "none"});

            $j(".cat-block").click(function(){

             $j('.cat-block h3').css('color' ,'#0099CC');
    $j('.cat-block h3').css('background' ,'none');
 
              $j('.sublink_img').attr("src","../images/new_home_page/browse_arrow.png");





             $j('.sublinks').hide();

 $j(this).find(".sublinks").css('display','none');

   $j(this).find(".sublinks").toggle();

  $j(this).find(".sublink_img").css('display','none');
 $j(this).find("h3").css('color' ,'#294e6b');
  


$j(this).click(function(){

 $j(this).find(".sublinks").toggle();
  $j('.sublink_img').attr("src","../images/new_home_page/browse_arrow.png");
}

);


});
 $j('.cat_list_item').hover (function(){
$j(this).find('.sublinks').css('display' ,'block');
$j(this).css('z-index' ,'1000');
$j(this).css('backgroundImage' ,'url(../images/new_home_page/browse_cat_selected.png)');
 $j(this).find("h3").css('backgroundColor' ,'#E5F4FB');

      $j(this).find("h3").css('z-index' ,'1000');
 $j(this).find("h3").css('width' ,'201px');
 $j(this).find("h3").css('color' ,'#294e6b');
  $j(this).find("h3").css('border-bottom' ,'solid');
  $j(this).find("h3").css('border-bottom-width' ,'1px');
  $j(this).find("h3").css('border-bottom-color' ,'#9fbfcc');
},function(){


$j(this).find(".sublinks").toggle();


 $j(this).find("h3").css('backgroundColor' ,'transparent');
$j('.cat_list_item').css('z-index' ,'1');
$j(this).css('backgroundImage' ,'url(../images/new_home_page/browse_cat_default.png)');
$j('.cat_list_item').find('.sublinks').css('display' ,'none');
 $j('.cat_list_item').find("h3").css('color' ,'#0099CC');
});

      });


$j(document).ready(function(){     


});



