// SLIDER
$(function() {
	$( "#accordion" ).accordion({
		active:true,
		autoHeight: false,
		collapsible: true,
		navigation: true
	});
});

$(function(){
	positionFooter(); 
	function positionFooter(){
		var margin_top = $("#footer_wrapper").css("margin-top").replace("px", "");
		var page_height = $(document.body).height() - margin_top;
		var window_height = $(window).height();
		var difference = window_height - page_height;
		if (difference < 0) 
			difference = 0;
 
		$("#footer_wrapper").css({
			margin: difference + "px 0 0 0"
		})
	}
 
	$(window)
		.resize(positionFooter)
});

// DROPLIST
$(window).load(function(){
$('.droplist').hover(function() {
    $(this).animate({
        height: '100%'
    }, 0);
},function() {
    $(this).animate({
        height: '19px'
    }, 250);
});
});






// FORMS
function resetFields(whichform) { 
  for (var i=0; i<whichform.elements.length; i++) { 
    var element = whichform.elements[i]; 
    if (element.type == "submit") continue; 
    if (!element.defaultValue) continue; 
    element.onfocus = function() { 
      if (this.value == this.defaultValue) { 
      this.value = ""; this.style.color='#5E5E5E';
      } 
    } 
    element.onblur = function() { 
      if (this.value == "") { 
      this.value = this.defaultValue; this.style.color='#AAA'; 
      } 
    } 
  } 
} 

window.onload = prepareForms;
function prepareForms() { 
  for (var i=0; i<document.forms.length; i++) { 
    var thisform = document.forms[i]; 
    resetFields(thisform); 
  }  
}
