/* CSA 08180 Talk to a Pro 2009 scripts | Creative Services */
/* (C)2009 Charles Schwab & Co., Inc. */


// Tab switcher
////////////////////////////////////////////////////////////////////////////////
function cs_furl(cs_num) {
  var tabs = document.getElementById('tabs');
  var uls = document.getElementsByTagName("ul");
  var ul_id = "video_tab" + cs_num;
  var ul = document.getElementById(ul_id);

  for (i=0; i<uls.length; i++) {
    if (uls[i].className == 'video_tab') {
      uls[i].style.display = "none";
    }
  }

  ul.style.display = "block";
  tabs.className = "view_tab" + cs_num;

}


// Title HTML
////////////////////////////////////////////////////////////////////////////////

function loadVideoContent() {
  var url = window.location.href;
  var url_array1 = url.split('video_ext=flash/Movies/');
  var url_array2 = url_array1[1].split('.flv');
  var short_title = url_array2[0].toLowerCase();
  
  switch (short_title) {

    case "teetip":
      current_video_title = 'Hank and Ray: "Hit Away From Trouble"';
      current_video_length = "1:20";
      category = 3;
    break;

    case "waggle":
      current_video_title = 'Hank and Ray: "The Waggle"';
      current_video_length = "1:28";
      category = 3;
    break;

	case "alignment":
      current_video_title = '"Proper alignment"';
      current_video_length = "1:34";
      category = 2;
    break;

	case "body_turn":
      current_video_title = 'Hank and Ray: "The Body Turn"';
      current_video_length = "0:53";
      category = 3;
    break;
    
    case "change_plan":
      current_video_title = '"Revisit the plan"';
      current_video_length = "1:22";
      category = 1;
    break;
    
    case "course_management":
      current_video_title = '"Course management off the tee"';
      current_video_length = "1:25";
      category = 2;
    break;
    
    case "emotions":
      current_video_title = '"Control your emotions"';
      current_video_length = "1:24";
      category = 1;
    break;
    
    case "enough_club":
      current_video_title = '"Enough club?"';
      current_video_length = "1:19";
      category = 2;
    break;

    case "flop_shot":
      current_video_title = 'Hank and Ray: "The Flop Shot"';
      current_video_length = "0:48";
      category = 3;
    break;
    
    case "grip":
      current_video_title = '"Grip"';
      current_video_length = "1:47";
      category = 2;
    break;
    
    case "lag_putting":
      current_video_title = '"Lag putting"';
      current_video_length = "1:35";
      category = 2;
    break;
    
    case "plan":
      current_video_title = '"Formulate a plan"';
      current_video_length = "1:28";
      category = 1;
    break;

	case "putt_whenever":
      current_video_title = 'Hank and Ray: "Putt Whenever You Can"';
      current_video_length = "1:36";
      category = 3;
    break;

    case "reading_green":
      current_video_title = "'Reading the green'";
      current_video_length = "1:15";
      category = 2;
    break;

    case "reverse_loop":
      current_video_title = 'Hank and Ray: "The Reverse Loop"';
      current_video_length = "1:43";
      category = 3;
    break;

     case "swing_line":
      current_video_title = "'Swing line'";
      current_video_length = "1:27";
      category = 2;
    break;

    case "swing_plane":
      current_video_title = 'Hank and Ray: "The Swing Plane"';
      current_video_length = "1:29";
      category = 3;
    break;
    
    case "system":
      current_video_title = "'Believe in a system'";
      current_video_length = "1:16";
      category = 1;
    break;
    
    case "trust":
      current_video_title = "'Trust'";
      current_video_length = "1:00";
      category = 1;
    break;
    
    default:
  }
  cs_furl(category);
  document.getElementById('video_title').innerHTML = current_video_title;
  document.getElementById('video_length').innerHTML = "&nbsp;" + current_video_length;

 return false;

}


//Global: Date (Year)
var d = new Date();
var global_year = d.getFullYear();

//Global: Job
var global_job = "CS12269-04 (0410-1994)&nbsp;&nbsp;ELC49938-01 (06/10)";
