				var $j = jQuery.noConflict();

				$j(window).load(function() {

						$j('#gallery').not(':empty').liquidCanvas(
										"[shadow{color:rgba(64, 64, 64, 0);width:25;shift:0;} border{color:#7a4315;width:1;}] => roundedRect{radius:10}"
						);

						$j('#homer li').not(':empty').liquidCanvas(
										"[shadow{color:rgba(64, 64, 64, 0);width:25;shift:0;} border{color:#7a4315;width:1;}] => roundedRect{radius:10}"
						);

						$j('#buttons li').not(':empty').liquidCanvas(
										"[shadow{color:rgba(64, 64, 64, 0.2);width:2;shift:2;} gradient{from:#cc6600; to:#cc9933;} border{color:#7a4315;width:1;}] => roundedRect{radius:10}"
						);
						$j('.menu a').not(':empty').liquidCanvas(
										"[border{color:#7a4315;width:1;}] => roundedRect{radius:5}"
						);
						$j('#text li').has('h5').not(':empty').liquidCanvas(
										"[border{color:#7a4315;width:1;}] => roundedRect{radius:10}"
						);
						$j('#text h5').not(':empty').liquidCanvas(
										"[gradient{from:#cc6600; to:#cc9933;} border{color:#7a4315;width:1;}] => roundedRect{radius:10}"
						);
						$j('.news_list li').not(':empty').liquidCanvas(
										"[border{color:#7a4315;width:1;}] => roundedRect{radius:10}"
						);

				});


			$j(document).ready(function($) {

      $('.preload').each(function(){
	      $(this).after('<img src="'+$(this).attr('href')+'" alt="'+$(this).attr('title')+'" />');
	     });
	     $('.home .preload').remove();
	     $('.preload').removeClass('preload').addClass('vlightbox');

						$(".palette a").append("<em></em>");
						$(".palette a").hover(function() {
								$("em", this).text($(this).attr("title"));
								$("em", this).animate({opacity: "show", right: "+140"}, "slow");
								$(this).animate({right: "+140"}, "slow").liquidCanvas("[border{color:#000;width:1;} gradient{from:#7a4315; to:#d77922;}] => roundedRect{radius:5}");
						}, function() {
								$("em", this).animate({opacity: "hide", right: "-140"}, "slow");
								$(this).animate({right: "0"}, "slow").prev('canvas').remove();
						});

						var a = $('a.external').attr('target','_blank');
						a.each( function() {$(this).attr('title', $(this).attr('title') +' (open in a new window)')});

						$('.accordion ul').accordion({
							animated: 'bounceslide',
							fillSpace: true,
							event: 'click'
						});

						$('h2').not(':empty').wrap('<div class="reflect"></div>');
						$('.reflect h2').FontEffect({mirror: true, mirrorOffset:-10, mirrorHeight:130, mirrorDetail:1, mirrorTLength:20});
//
      $('#q1').not(':empty').cycle({timeout: 14000, speed: 2500, delay: -10000}); //
      $('#q2').not(':empty').cycle({timeout: 20000, speed: 2500, delay: -4000}); //
      $('#q3').not(':empty').cycle({timeout: 17000, speed: 2500, delay: -5000}); //
    		$('#q4').not(':empty').cycle({timeout: 12000, speed: 2500, delay: -2500}); //

//     		$j('.slideshow').not(':empty').cycle({
//     		fit: 1,
//     		prev: '#prev',
//     		next: '#next',
//     		timeout: 8000,
//     		speed: 2500,
//     		pause: true,
//     		before: onBefore
//     });
// //
//     function onBefore() {
//         $j('#title').html(this.alt);
//     }
     		$j('#title').html($j('.slideshow img').attr('alt'));

			});


var Common =
{
    baseUrl: null

    , setBaseUrl: function(url)
    {
        Common.baseUrl = url || $j('script[src$=drank.js]')
            .attr('src')
            .replace(/assets\/templates\/drank\/drank\.js$/,'');
    }

    , url: function(url)
    {
        return this.baseUrl+url.replace(/^\/+/, '');
    }
}

Common.setBaseUrl();

function gallerize (docid, folder, randomize) {
     if (typeof(folder)=='undefined') var folder = '';
     if (typeof(randomize)=='undefined') var randomize = true;
     $j('#vlightboxer, #vlightbox').remove();
     var _base = Common.url('');
					var pars = {
							q: 'assets/snippets/gallerize/gallerize.php',
							docid: docid,
							folder: folder,
							randomize: randomize
					};
					$j('body').append($j('<div id="vlightbox"></div>').load(_base+'index-ajax.php', pars, function() {
						$j('a.vlightbox').hide();
						$j.getScript(_base+'assets/templates/drank/vlightbox/visuallightbox.nop.min.js', function() {
							$j('a.vlightbox:first').click();
						});
					}));

			  return true;
    }



