
$('#moreInfo').insertAfter($('#crumbs'));
$('#displayMode').bind('change', function(){
    switch (this.value){
        case '0':
        default:
            document.getElementById('resultsContainer').className = 'results';

            $('#resultsContainer li').removeClass('even');

            $('#resultsContainer li img').each(function(){
                this.src = this.src.replace('/50/', '/100/');
            });

            break;

        case '1':
            document.getElementById('resultsContainer').className = 'resultsThumbs';

            $('#resultsContainer li').removeClass('even');

            $('#resultsContainer li img').each(function(){
                this.src = this.src.replace('/50/', '/100/');
            });

            break;
        case '2':
            document.getElementById('resultsContainer').className = 'resultsList';

            var counter = 0;
            $('#resultsContainer li').each(function(){
                if (counter % 2){
                    $(this).addClass('even');
                }
                counter++;
            });

            $('#resultsContainer li img').each(function(){
                this.src = this.src.replace('/100/', '/50/');
            });

            break;
    }

    $.cookie('Hkv_displayMode', this.value, {
        path : '/'
    });
}).each(function() {

    var mode = $.cookie('Hkv_displayMode');

    if(mode == null) {
        mode = 0;
    }

    var i, option;

    for(i = 0; option = this.options[i]; i++) {
        if(option.value == mode) {
            option.selected = true;
            break;
        }
    }
}).trigger('change');

$('.showMore').bind('click', function() {
    $(this).hide();
    $(this).parent().find('div.cattext').removeClass('hidden');
});
$(document).ready(function(){
    $('.slide').click(function(){
        if($(this).parent().children("ul").css("display") == "none") {
            $(this).parent().children("ul").slideDown(100);
            $(this).children().html("- ");
            return false;
        }else {
            $(this).parent().children("ul").slideUp(100);
            $(this).children().html("+ ");
            return false;
        }
        
    });
    
      
    
});
$("#refThumbs a").click(
	function() {
		var img = $(this).attr('href');
		$("#chimg").css('background', 'url("' + img + '") no-repeat scroll center center transparent');
		$("#refThumbs li").removeClass("active");
		$(this).parent().addClass("active");
		return false;
	}
); 
    $("#btnCloseModal").live("click",
    function() {
        $.closeDialog();
        return false;
    }
    );
 $('#keywords').blur(function() {
      var getvalue = $(this).attr('rel');
     if($(this).val()==""){$(this).val(getvalue);
     $(this).addClass('grey');}
 });
$('#keywords').focus(function() {
     var getvalue = $(this).attr('rel');

    // if($(this).hasClass('grayedOut')) $(this).val('').removeClass('grayedOut');
    if($(this).val() == getvalue){
        $(this).val("");
      if($(this).hasClass('grey')){$(this).removeClass('grey');}}
});

