$(document).ready(function() {

	/* Wert für E-Mail im subscription form setzen */
	var old1 = "";
	$("#techstory").focus(function(){
		if($(this).attr("value") == "Your e-mail address"){
			old1 = $(this).attr("value");
			$(this).attr("value","");
		}
	});
	$("#techstory").blur(function(){
		if($(this).attr("value") == ""){
			$(this).attr("value", old1);
		}
	});

/* Wert für Username setzen */
var old = "";
$("#username").focus(function(){
	if($(this).attr("value") == "Your username"){
		old = $(this).attr("value");
		$(this).attr("value","");
	}
});
$("#username").blur(function(){
	if($(this).attr("value") == ""){
		$(this).attr("value", old);
	}
});


/*var image = new Image();
jQuery(image).load(function () {
$("#lade").fadeOut(function(){
		$(".riesenbild, #imagebild input, #imagebild select, #imagebild a").fadeIn("slow");
		$("#imagebild").css("background","transparent")
});


  }).error(function () {
  }).attr('src', "images/twentyfeet-animation.gif");


$("a").each(function(){
	if($(this).attr("href") == ""){
		$(this).click(function(){
			if($(this).attr("id") != "survey"){
				if($("#layer").css("display") == "none"){
					$("#layer").toggle();
					$("#underCons").toggle("20");
					if ($.browser.msie && $.browser.version.substr(0,1)<7) {
						$("html").css({"overflow":"hidden"});
					}
					return false;
				}
				else {
					$("#underCons").toggle("20",function(){
									$("#layer").toggle();
					});
					if ($.browser.msie && $.browser.version.substr(0,1)<7) {
						$("html").css({"overflow":"auto"});	
					}
					return false;
				}

			}
		});
	}	
});*/

// Bugfix fuer IEx bei Hintergrund-Bildern
	try {
		document.execCommand('BackgroundImageCache', false, true);
	} catch (e) {}

$(".collapseList a").click(function(){
	$(this).css("background-image") ==  "url(http://twentyfeet.com/images/close_button.gif)" || $(this).css("background-image") ==  "url(http://www.twentyfeet.com/images/close_button.gif)" ? $(this).css("background-image","url(/images/open_button.gif)") : $(this).css("background-image","url(/images/close_button.gif)");	
	$(".collapseListDiv").toggle();
});

// Display function for metrics logos
  $('area').hover(
    function(){
      var obj = $($(this).attr('href'));
      obj.css("opacity", "1");
      obj.stop(true);
      obj.fadeIn("fast");
    }, 
    function() {
      var obj = $($(this).attr('href'));
      obj.css("opacity", "1");
      obj.stop(true);
      obj.fadeOut("fast");
  });
  
  $('area').click(
    function(){
      return false;
  });
  
  $('.fade_image').hover(
    function(){
      $(this).stop();
    },
    function() {
      $(this).fadeOut("fast");
  });
  
});


