// Extend Array object to include Array#unique method.
Array.prototype.unique = function () {
	var r = new Array();
	o:for(var i = 0, n = this.length; i < n; i++)
	{
		for(var x = 0, y = r.length; x < y; x++)
		{
			if(r[x]==this[i])
			{
				continue o;
			}
		}
		r[r.length] = this[i];
	}
	return r;
}




$(document).ready(function()
{
  //hide the all of the element with class msg_body
  $(".list_body").hide();
  //toggle the componenet with class msg_body
  $(".list_head").click(function()
  {
    $(this).next(".list_body").slideToggle(600);
  });
});

$(document).ready(function(){
  $('HTML').addClass('JS');

  $("#tabs").tabs({ fx: { opacity: 'toggle' } });

  //used to give all tabs the same height
  var maxHeight=0;
  $("#tabs div.fixed").each(function(){
    var myDiv=$(this);
    var isHidden=false;
    if(myDiv.hasClass("ui-tabs-hide")){
      isHidden=true;
      myDiv.removeClass("ui-tabs-hide");
    }
    if((myHeight=myDiv.height())>maxHeight){
      maxHeight=myHeight;
    }else{
      myDiv.height(maxHeight);
    }
    if(isHidden){
      myDiv.addClass("ui-tabs-hide");
    }
  });


  $(".message").append($('<a href="#" title="close" class="close icon icon_close tooltip"></a>').click(function(){
      $(this).parents(".message").hide("fast");return false;
  }));

});

// $(function(){
//   DD_belatedPNG.fix('.ui-tabs, .ui-tabs-nav, .ui-tabs-nav li,.ui-tabs-nav li a,#slide-wrapper .inner, .button, .testimonial, .testimonial .inner, .feature-list img, .download ');
//   $(".ui-tabs-nav li a").click(function(){
//     DD_belatedPNG.fix('.ui-tabs-nav li,.ui-tabs-nav li a');
//   });
// });




$(function(){
  //alert($("form div.required").length);
  //$(".tooltip").tooltip({
  //  showBody: " - ",
  //  showURL:  false
  //});
  // Wrap the tooltip content so we can use sexy backgrounds :)
  //$('#tooltip').children().wrapAll('<div class="sub" />');

  $(".button input, a.button").button();
});

