$(document).ready(function() { 
   var liactive = $("a.main_nav_active").parent();
   $(liactive).addClass("li_main_active");

   //$("#content li").each(
         // function() {
             //var theIndex = $(this).index();
            // $(this).wrap('<a href="#'+ theIndex +'"></a>');
        //  }
   // );

function getPlayer(gid) {
	if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[gid];
	} else {
		return document[gid];
	}
};

$("ul#subcategory_mission").insertAfter("li.kkc_article_list:eq(0) a");

$("ul#subcategory_program").insertAfter("li.kkc_article_list:eq(1) a");

var currentArticle = $("h2").text();
//alert(currentArticle);
$("li a:contains('"+currentArticle+"')").addClass("sidebar_link_active");

$("li li:contains('Mission')").hide();
$("li li:contains('Program')").hide();
$("li li:contains('Focus')").show();

//createplayer('/kkc/media/Fox_2-2.flv', false);

//var player = getPlayer('ply');

$('#home_slide_show').innerfade({
    speed: 'slow',
    timeout: 4000,
    type: 'sequence',
    containerheight: '235px'
}); 

$('#login_label').click(function() {
    $('#loginbox').toggle();
});

$('body#stress-switch').ready(function () {
      createMirandaplayer('/media/mirandas_power.flv', false);
}); 

//if (thanks) {alert('give thanks man');}



}); //end doc ready 

function createplayer(theFile, go) {
	var s = new SWFObject("/media/player.swf","ply","320","234","9","#FFFFFF");
	s.addParam("allowfullscreen","true");
	s.addVariable("file",theFile);
	s.addVariable("displayheight","225");
	s.addVariable("overstretch","fit");
	s.addVariable("autostart","true");
	s.write("video_player");
}

function createMirandaplayer(theFile, go) {
	var s = new SWFObject("/media/player.swf","ply","475","350","9","#FFFFFF");
	s.addParam("allowfullscreen","true");
	s.addVariable("file",theFile);
	s.addVariable("displayheight","316");
	s.addVariable("overstretch","fit");
	s.addVariable("autostart","false");
	s.write("video_stress-switch");
}



