// JavaScript Document
// Fadet alle .Elemente in einem "block" ein: fadeInMultipleElements($("#small_object_pictures .roundedCorners:first")​);​	
function fadeInMultipleElements(elem,fnCallback) {
	elem.fadeIn(500, function() {
		if ($(this).next().length > 0) {
			fadeInMultipleElements($(this).next(),fnCallback);
		} else {
			fnCallback();
		}
	}); 
}


// Fadet eine Liste von Elemente ein: fadeInElements(['el1','el2','el3'],200);​	

function fadeInElements(arrIDs, speed, fnCallback){
  if(arrIDs.length > 0){
    $("#"+arrIDs[0]).fadeIn(speed, function(){
      fadeInElements(
        $.map(
          arrIDs,
          function(elementOfArray, indexInArray){
            return ((indexInArray==0)? null: elementOfArray);
          }
        ),
        fnCallback
      );
    });
  }else{
    fnCallback();
  }
}

function fnFx(arrIDs, strAnimFn, speed, fnCallback){
  if(arrIDs.length > 0){
    $("#"+arrIDs[0])[strAnimFn](speed, function(){
      fnFx(
        $.map(
          arrIDs,
          function(elementOfArray, indexInArray){
            return ((indexInArray==0)? null: elementOfArray);
          }
        ),
        strAnimFn,
        fnCallback
      );
    });
  }else{
    if (document.fnCallback) {
		fnCallback();
	}
  }
}


function animateMultipleElements(animation,elem,speed) {
	elem[animation](speed,function(){animateMultipleElements(animation,$(this).next());}); 
}


/*
function refreshTextContent(href) {
	$.ajax({
	  type: "POST",
	  url: 'http://w006fa4e.dd18032.kasserver.com/js/wp/ajax/getContent.php',
	  data: 'action=getNewContent&url='+href,
	  success: displayContent
	});	
}

function displayContent(content) {
	$("#content_area").fadeOut('fast',function(){
		$("#content_area").html(content);
		$("#content_area").fadeIn('fast');
	});	
}

function refreshAll(linkData,href) {
	refreshTopnavi(linkData);
	//refreshSubnavi(href);
	refreshTextContent(href);
}

function refreshTopnavi(linkData) {
	alert(linkData.name);
	alert(linkData.id);
	alert(linkData);
}*/


function showSeachThumbList(el) {
	$(el).addClass("swap_switcher");
	$("#listView_hiddenField").val("SMALL");
	$("ul.display").fadeOut("fast", function() {
		$(this).fadeIn("fast").addClass("thumb_view");
	});		
}

function showSearchTextList(el) {
	$(el).removeClass("swap_switcher");
	$("#listView_hiddenField").val("BIG");
	$("ul.display").fadeOut("fast", function() {
		$(this).fadeIn("fast").removeClass("thumb_view");
	});				
}

