// JavaScript Document
$(window).load(function() {
//$("#tornpaper").hide();
	$(document).pngFix(); 
	$(".slideit").hide();
// $("#tornpaper").fadeIn("slow");
	$(".slideit").fadeIn("slow");
	$('ul#submenu').hide();
});
// basic show and hide
 $(document).ready(function() {
   $('#theco').click( function() {
    $('ul#submenu').toggle('slow');
   });
	$(".slideit").jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		circular: true,
		visible: 5,
		auto: 0.1,
		scroll: 2,
		speed: 2500
	});
	// thumbnails hover effects
	$('.slideit ul li').hover(function() {
			$(this).not('.active').fadeTo('fast',1);
			$(this).not('.active').css('position', 'relative').css('left', 0).css('top', 0); // Fixes Safari 2 rendering issue
		}, function() {
			$(this).not('.active').fadeTo('fast',0.4);
		}
	);
});
/* IE PNG fix multiple filters */
(function ($) {
    if (!$) return;
    $.fn.extend({
        fixPNG: function(sizingMethod, forceBG) {
                if (!($.browser.msie)) return this;
                var emptyimg = "/assets/js/transparent.gif"; //Path to empty 1x1px GIF goes here
                sizingMethod = sizingMethod || "scale"; //sizingMethod, defaults to scale (matches image dimensions)
                this.each(function() {
                        var isImg = (forceBG) ? false : jQuery.nodeName(this, "img"),
                                imgname = (isImg) ? this.src : this.currentStyle.backgroundImage,
                                src = (isImg) ? imgname : imgname.substring(5,imgname.length-2);
                        this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + sizingMethod + "')";
                        if (isImg) this.src = emptyimg;
                        else this.style.backgroundImage = "url(" + emptyimg + ")";
                });
                return this;
        }
    });
})(jQuery);