/*************************
Copyright: Vadim, Jacobi
Internet: www.exhib.de
*************************/

$.dff='';
$.flo='';
$.nload='';
$.nreload=false;

function toggleContent(cID){
	if ($.nload != cID){return toggleContent($.nload);}
	if ($.dff != 'a' + cID || $.nreload){
		$.dff = 'a' + cID;
		
		if ($.nreload){
			if(ie6()===false){
				$('#qlCC').removeShadow();
				$.tpos=$('#qlCCt').position();
				if (jQuery.browser.msie){$.ofsL=2; $.ofsT=6;}
				else{$.ofsL=4; $.ofsT=8;}
				jQuery('#qlCC').animate({ 
					left: ($.tpos['left']+$.ofsL) + 'px', 
					top: ($.tpos['top']+$.ofsT) + 'px' 
				},'fast');
			}
		}
		
		
		$.nreload = false;
		$(function(){
			if (jQuery.browser.opera) {
				$('#qlCC').removeShadow();
				$('#qlCC').css('visibility','hidden');
			}
			$('#qlC').fadeOut('fast',function(){ 
				if ($.nload != cID){return toggleContent($.nload);}
				$('#qlC').html('');
				$('#qlCB').css('background-image','url(/content/pic/layout/ajax-loader-lite.gif)');
				$("#qlC").load("lc.php?cid=" + cID +'','',function(){
					if ($.nload != cID){return toggleContent($.nload);}
					divC = $("#qlC").html();
					if (divC != ''){
						
						$('#qlCC').fadeIn('fast',function(){
							if ($.nload != cID){return toggleContent($.nload);}
							if(ie6()===false){
								$('#qlCC').removeShadow();
								$('#qlCC').dropShadow({left: 0.3, top: 0.5, opacity: 0.5, blur: 1, color: '#000000'});
							}
						});
						$('#qlCC').css('visibility','visible');

						$('#qlC').fadeIn('fast',function(){
							$('#qlCB').css('background-image','none');
							if ($.nload != cID){return toggleContent($.nload);}
							$('#qlC').css('overflow','auto');
							$('#qlC').css('overflowX','hidden');
							$('#qlC').jScrollPane({showArrows:true});
						});							
					}else{
						if ($.nload != cID){return toggleContent($.nload);}
						if(ie6()===false){$('#qlCC').removeShadow();}
						$('#qlC').fadeOut('fast');
						$('#qlCC').fadeOut('fast');
					}
				});
			});
		})
	}
}
function closeContent(){
	if(ie6()===false){$('#qlCC').removeShadow();}
	$('#qlCC').fadeOut('fast');$.dff='';$.flo=1;
}
function closeContentF(){
	if(ie6()===false){$('#qlCC').removeShadow();}
	$('#qlCC').css('visibility','hidden');
}