function toggle(id)
{
    $('#'+id).slideToggle('fast');
}
function doAction(command, param)
{
    $('#_action_command').val(command);
    $('#_action_param').val(param);
    $('#aspnetForm')[0].submit();
}

$.fn.extend(
{
    defaultTo : function(original) 
    {
        var org = original;
        return this.each(function() {
            $(this).bind('focus',function() {Handler($(this));});
	    })

        function Handler(object)
        {
            if (object.val()=='' && org.val()!='')
            {
                object.val(org.val());
                object.selectAll();
            }
        }
    },

    selectAll : function ()
    {
        var len = this.val().length;
        o = this[0];
        if (o.createTextRange)
        {
            var r = o.createTextRange();
            r.moveStart("character", 0);
            r.moveEnd("character", len);
            r.select();

        } 
        else if (o.setSelectionRange)
        {
            o.setSelectionRange(0, len);
        }
    }

})


$(function()
{
    $('table.cList1 tbody tr:even').removeClass('alt');
    $('table.cList1 tbody tr:odd').addClass('alt');
    $('.idet-pane tbody tr').hover(function() { $(this).addClass('alt'); }, function() { $(this).removeClass('alt'); })
    
    $('.cLightBox').lightBox({
       	overlayBgColor: '#414141',
       	containerResizeSpeed: 200,
       	imageLoading: 'lib/lightbox/images/lightbox-ico-loading.gif',
       	imageBtnClose: 'lib/lightbox/images/btn-close.gif',
       	imageBlank: 'lib/lightbox/images/lightbox-blank.gif',
       	txtImage:'Obrázek',
       	txtOf:'z'	
    });
    $('.ucs-shoppingcart')
        .click(function() { window.location = $('a', this).attr("href"); })
        .hover(function() { $(this).addClass('cart-hover'); },
            function() { $(this).removeClass('cart-hover'); })

		$('#inputSearch').watermark('Barum 185/60R14');
});

