/* functions for search box */
function submitForm(formId) {
 document.getElementById(formId).submit();
}

function clearquery(id,text) {
 if(!document.getElementById(id)) return false;
 if (document.getElementById(id).value == text) {
	document.getElementById(id).value = "";
 }
}

/* stripe table rows */
$(document).ready(function(){
$("table tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
$("table tr:even").addClass("alt");
});

// show and hide the left and right tab functions
$(document).ready(function() {
   
   // if user has js, then default to show left tab
	$('.vt_tc_r1').hide();
 	$('.vt_tc_l1').show();
	$("div[@name='rightTabNav1']").hide();
					   
   // left tab group, do this when clicked
   $('.vt_ltab_1, .vt_ltab_2').click(function(){
     $('.vt_tc_l1').show();
	 $('.vt_tc_r1').hide();
	 $("div[@name='rightTabNav1']").hide();
	 $("div[@name='leftTabNav1']").show();	 
	});
   
   // right tab group
    $('.vt_rtab_1,.vt_rtab_2').click(function(){
     $('.vt_tc_l1').hide();
	 $('.vt_tc_r1').show();
	 $("div[@name='rightTabNav1']").show();
	 $("div[@name='leftTabNav1']").hide();	
   	});
	
	
 });

// slide down for quicklinks
$(document).ready(function() {
   // show quicklinks
   $('#vt_ql_link').css('display', 'block');
   
   // left tab grup this when clicked
   $('#vt_ql_link').click(function(){
     $('#vt_ql_list').slideToggle('fast'); 
	});
	
});
/* equalizes columns */
(function($) {
  $.fn.equalizeCols = function(children){
    var child = Array(0);
    if (children) child = children.split(",");
    var maxH = 0;
    this.each(
      function(i) 
      {
        if (this.offsetHeight>maxH) maxH = this.offsetHeight;
      }
    ).css("height", "auto").each(
      function(i)
      {
        var gap = maxH-this.offsetHeight;
        if (gap > 0)
        {
          t = document.createElement('div');
          $(t).attr("class","fill").css("height",gap+"px");
          if (child.length > i)
          {
            $(this).find(child[i]).children(':last-child').after(t);
          } 
          else 
          {
            $(this).children(':last-child').after(t);
          }
        }
      }  
    );
    
  }
})(jQuery);