﻿$(document).ready(function () {
    
    var titleText = $("title").html();
    var newTitle = "Stephens Inc. : About Stephens Inc. : " + titleText.trim();
    parent.document.title = newTitle;
    var previousSlide;
    var currentSlide;
    $('div.it-button').click(function(){
        $current = $(this);
        $currentId = $(this).attr('id');
		currentSlide = $currentId.split(/-/)[1];
		
       if(!$('#panel-' + currentSlide).is(':visible')){
        $('ul.it-navigation LI').removeClass('current');
        
        if(previousSlide > 0) {
		    $('#panel-' + previousSlide).slideUp();
		}
        $current.parent().addClass('current');
		$('#panel-' + currentSlide).slideDown('normal', function() {
               $("#video1").show();
               $("#video2").show();
               $("#video3").show();
               $("#video4").show();
               $("#video5").show();
               $("#movie-container1").html('');
               $("#movie-container2").html('');
               $("#movie-container3").html('');
               $("#movie-container4").html('');
               $("#movie-container5").html('');	
          });
		previousSlide = currentSlide;
       }	
       if($currentId == "btn-1") {
        $("#bottomContent").css("height", "680px");
       }	
       if($currentId == "btn-2") {
        $("#bottomContent").css("height", "710px");
       }	
       if($currentId == "btn-3") {
        $("#bottomContent").css("height", "840px");
       }	
       if($currentId == "btn-4") {
        $("#bottomContent").css("height", "810px");
       }	
       if($currentId == "btn-5") {
        $("#bottomContent").css("height", "860px");
       }
       if($currentId == "btn-6") {
        $("#bottomContent").css("height", "810px");
       }
    });
	
    $('div.it-button').mouseover(function(){
        $current = $(this);	
        $current.addClass('over-blue');
    });
	
    $('div.it-button').mouseout(function(){
        $current = $(this);	
        $current.removeClass('over-blue');
    });
           
   $("#video1").click(function() {
        $("#video1").hide();
        var s2 = new SWFObject("/video/new_venture.swf", 'player', '204', '173', '9', '#000000');
        s2.addParam('allowfullscreen', 'true');
        s2.addParam('allowscriptaccess', 'always');
        s2.addVariable('autoplay', 'false');
        s2.write('movie-container1');
        s2 = null;
      });
    $("#video2").click(function() {
        $("#video2").hide();
        var s2 = new SWFObject("/video/building_prosperity.swf", 'player', '204', '173', '9', '#000000');
        s2.addParam('allowfullscreen', 'true');
        s2.addParam('allowscriptaccess', 'always');
        s2.addVariable('autoplay', 'false');
        s2.write('movie-container2');
        s2 = null;
      });
    $("#video3").click(function() {
        $("#video3").hide();
        var s2 = new SWFObject("/video/invest_future.swf", 'player', '204', '173', '9', '#000000');
        s2.addParam('allowfullscreen', 'true');
        s2.addParam('allowscriptaccess', 'always');
        s2.addVariable('autoplay', 'false');
        s2.write('movie-container3');
        s2 = null;
      });
    $("#video4").click(function() {
        $("#video4").hide();
        var s2 = new SWFObject("/video/growing_our_clients.swf", 'player', '204', '173', '9', '#000000');
        s2.addParam('allowfullscreen', 'true');
        s2.addParam('allowscriptaccess', 'always');
        s2.addVariable('autoplay', 'false');
        s2.write('movie-container4');
        s2 = null;
      });
    $("#video5").click(function() {
        $("#video5").hide();
        var s2 = new SWFObject("/video/capitalizing.swf", 'player', '204', '173', '9', '#000000');
        s2.addParam('allowfullscreen', 'true');
        s2.addParam('allowscriptaccess', 'always');
        s2.addVariable('autoplay', 'false');
        s2.write('movie-container5');
        s2 = null;
      }); 		 
});
