/*-------------------------------------------------------------------------------------------------------*/
jQuery(document).ready(function($){
	/*-----------------------------------------------------------------------------------------------*/
	$("a[rel*=lightbox]").lightBox({
		imageLoading: ico_imageLoading,
		imageBtnClose: btn_imageClose,
		imageBtnPrev: btn_imagePrev,
		imageBtnNext: btn_imageNext,
		imageBlank: btn_imageBlank,
		txtImage: 'Bild',
		txtOf:'von'
	});
	/*-----------------------------------------------------------------------------------------------*/
	var $btnShow = $("#btnShow");
	var $btnHide = $("#btnHide");
	var $mainCanvas = $("div.box");
	var isLeft = ($('div.right').length) ? false : true;
	var boxw = $mainCanvas.outerWidth() - 42;
	var boxh = $mainCanvas.outerHeight() - 42;
	var boxrpx;
	var pos;
	/*-----------------------------------------------------------------------------------------------*/
	$btnShow.find('a').click(
		function(){
			$btnShow.hide();
			if (isLeft) {
				$mainCanvas.animate({top:pos.top+"px",left:pos.left+"px",width:boxw+"px",height:boxh+"px",padding:"20px"}, 300, function() {$btnHide.show();})
			} else {
				$mainCanvas.animate({top:pos.top+"px",right:boxrpx,width:boxw+"px",height:boxh+"px",padding:"20px"}, 300, function() {$btnHide.show();})
			}
      return false;
		}
	) //end click
	$btnHide.find('a').click(
		function(){
			pos = $mainCanvas.position();
			boxrpx = ($mainCanvas.css('right'));
			$btnHide.hide();
			if (isLeft) {
				$mainCanvas.animate({top:"0px",left:"0px",width:"19px",height:"19px",padding:"0px"}, 400, function() {$btnShow.show();})
			} else {
				$mainCanvas.animate({top:"0px",right:$(window).width()+"px",width:"19px",height:"19px",padding:"0px"}, 400, function() {$btnShow.show();})
			}
      return false;
		}
	) //end click
	/*-----------------------------------------------------------------------------------------------*/
	$('a').focus(function(){$(this).attr("hideFocus", "hidefocus");});
	/*-----------------------------------------------------------------------------------------------*/
});
/*-------------------------------------------------------------------------------------------------------*/

