// JavaScript Document //


/*** JS Functions ***/
function getThumbPath(path) {
  var replaced = path.replace(".jpg","_thumb.jpg");
  return replaced;
}

function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}


/*** Document Ready Functions ***/
$(function(){

  /************* DropDown ***************/
    $("ul.dropdown li").hover(function(){
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    }, function(){
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    });
    //$("ul.dropdown li ul li:has(ul)").find("a:first").append(" >> ");

  /************** Cycle **************/
/*
  try {
    $('#sliderHome').before('<ul id="navigator" class="round">').cycle({
      fx:     'fade',
      speed:  'slow',
      next: '.next',
      pager:  '#navigator',
      slideExpr: 'img',
      pagerAnchorBuilder: function(idx, slide) {
        return '<li><a href="#"> </a></li>';
      }
    });
  } catch(e) {}
*/   
  /************* Tabs *****************/
  
  try {
    $( "#tabmain" ).tabs();
    $( "#tabfund" ).tabs();
    $( "#tabgroup" ).tabs();
    
    /*** Handle Tab Margins ***/
    $("#tabfund ul li:nth-child(1)").css("width","130px").css("margin-left","0");
    $("#tabfund ul li:nth-child(2)").css("width","132px").css("margin-left","1px");
    $("#tabfund ul li:nth-child(3)").css("width","132px").css("margin-left","1px");
    $("#tabfund ul li:nth-child(4)").css("width","133px").css("margin-left","1px");

  } catch(e) {}
  
  /*** Bind ClearText function to Search/Subscribe Inputs ***/
  // onFocus="clearText(this)" onBlur="clearText(this)"
  
  /*
  $("#search input.input").bind("focus",function(evt) {
    if (evt.defaultValue == evt.value) evt.value = '';
      else if (evt.value == '') evt.value = evt.defaultValue;
  });
  
  $("#search input.input").bind("blur",function(evt) {
    if (evt.defaultValue == evt.value) evt.value = '';
      else if (evt.value == '') evt.value = evt.defaultValue;
  });
  */
});
