// JavaScript Document




$(document).ready(function() {
	
$(".toggle_container").hide();

$("h2.trigger").toggle(function(){
$(this).addClass("active");
}, function () {
$(this).removeClass("active");
});

$("h2.trigger").click (function() {
$(this).next ('.toggle_container').toggle('slow');
return true;
});
	

	
$(function() {
$("#progressbar").progressbar({ value: 0 });
setTimeout(updateProgress, 500);
});

function updateProgress() {
  var progress;
  progress = $("#progressbar")
    .progressbar("option","value");
  if (progress < 100) {
      $("#progressbar")
        .progressbar("option", "value", progress + .413);
      setTimeout(updateProgress, 500);
  }
 
}



$(function() {
$("#progressbar-mre").progressbar({ value: 0 });
setTimeout(updateProgressmre, 500);
});

function updateProgressmre() {
  var progressmre;
  progressmre = $("#progressbar-mre")
    .progressbar("option","value");
  if (progressmre < 100) {
      $("#progressbar-mre")
        .progressbar("option", "value", progressmre + .069);
      setTimeout(updateProgressmre, 500);
  }
}




$(function() {
$("#progressbar-ql").progressbar({ value: 0 });
setTimeout(updateProgressql, 500);
});

function updateProgressql() {
  var progressql;
  progressql = $("#progressbar-ql")
    .progressbar("option","value");
  if (progressql < 100) {
      $("#progressbar-ql")
        .progressbar("option", "value", progressql + .08);
      setTimeout(updateProgressql, 500);
  }
}

$("td.heatgenie div.done").css('opacity:0');

});

	

$.fn.abspos = function() {
    var $el;
    return this.each(function() {
        $el = $(this);
        var newDiv = $("<div />", {
                "class": "innerWrapper",
                "css"  : {
                        "height"  : $el.height()+2,
                        "width"   : $el.width()+18,
                        "position": "relative"
                }
        });
        $el.wrapInner(newDiv);
    });
};

        function progressBar_completeHandler(event, ui) {
            $("td.heatgenie").abspos();
			$("td.heatgenie").addClass("finished");
			
			 $("td.heatgenie div.done").fadeIn('fast');
        }
        $(function() {
            // Set the progressbar's initial value to 76%, and define an event listener for the "complete" event.
            $("#progressbar").progressbar({complete:progressBar_completeHandler});
 
            // Set the progressbar's value to 18%.
   
$("ul#menu-criteria li a").hover(function(){
    $(this).find(".criteria-description").animate({opacity: "show"}, "fast");
},
function(){
    $(this).find(".criteria-description").animate({opacity: "hide"}, "fast");
});
     
	 

function activatePlaceholders() {
var detect = navigator.userAgent.toLowerCase();
if (detect.indexOf("safari") > 0) return false;
var inputs = document.getElementsByTagName("input");
for (var i=0;i<inputs.length;i++) {
  if (inputs[i].getAttribute("type") == "text") {
   if (inputs[i].getAttribute("placeholder") && inputs[i].getAttribute("placeholder").length > 0) {
    inputs[i].value = inputs[i].getAttribute("placeholder");
    inputs[i].onclick = function() {
     if (this.value == this.getAttribute("placeholder")) {
      this.value = "";
     }
     return false;
    }
    inputs[i].onblur = function() {
     if (this.value.length < 1) {
      this.value = this.getAttribute("placeholder");
     }
    }
   }
  }
}
}
window.onload=function() {
activatePlaceholders();
}

          
        });



