$(function() {
    $('.phone-me-link').click(function() { return false; });
    $('.phone-me-link').qtip({
       content: $('#phone-popup').html(),
       show: 'click',
       hide: 'mouseout',
       style: { name: 'green', tip: 'bottomLeft', width: { min: 350, max: 350 } },
       position: {
           corner: {
               target: 'topMiddle',
               tooltip: 'bottomLeft'
           }
       }
    });                
});

$(function() {
    if ($('#imagesslide').length > 0) {
        $('#imagesslide').cycle({ timeout: 8000, speed: 2000, height: '190px', sync: 1}) }
    }
);

$(function() {
    if ($('#show-products').length > 0) {
        $('#show-products').click(function() {
            $('#produkte').slideToggle();
            return false;
        });
    }
});


$(function() {
    if ($('#show-side-content').length > 0) {
        $('#show-side-content').click(function() {
            $('#side-content').slideToggle();
            return false;
        });
    }
});

$(function() {
    if ($(".datepicker").length > 0) {
        $(".datepicker").each(function(index) {
            var format = $(this).attr("data-format") || 'yy-mm-dd';
            $(this).datepicker({dateFormat: format});
        });
    };
});

function quickRedReference() {
    window.open( 
        "http://redcloth.org/hobix.com/textile/quick.html",
        "redRef",
        "height=600,width=550,channelmode=0,dependent=0," +
        "directories=0,fullscreen=0,location=0,menubar=0," +
        "resizable=0,scrollbars=1,status=1,toolbar=0"
    );
}

