// JavaScript

$(document).ready(function() { 
	$('ul.sf-menu').superfish(); 
	
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded'});
	
	$("#immobiliensucheLink").click(function(){		
		if ($("#immobiliensucheWrapper").css('display') == 'none') {
			$("#immobiliensucheWrapper").show("slow")
			//$("#immobiliensucheWrapper").css("display","true");
		} else {
			//$("#immobiliensucheWrapper").css("display","none");
			$("#immobiliensucheWrapper").hide("slow")
		}
	});	
	
	//$("img.immoImage").fadeTo("fast", 0.5);
    
    $("img.immoImage").mouseover(function () {
      $(this).fadeTo("fast", 0.5);
	  $("#immoname").html($(this).attr('alt'));
    });      
    
    $("img.immoImage").mouseout(function () {
      $(this).fadeTo("fast", 1);
    });

	
	$("tr:nth-child(odd)").addClass("odd");		
	
	$("a[rel^='myFaehnchen']").mouseover(function () {
		myid = $(this).attr('id');
		$("#"+myid+"i").attr("src", "upload/corporate/" + myid + "i_on.jpg");													   	
		$("#"+myid+"f").css("display", "block");											
    });  
	$("a[rel^='myFaehnchen']").mouseout(function () {
		myid = $(this).attr('id');
		$("#"+myid+"i").attr("src", "upload/corporate/" + myid + "i.png");													   	
		$("#"+myid+"f").css("display", "none");												
    });  		
});  

(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)
