function depressionVideo(targetId) {
    /* DIMENSIONS of the SWF object 
    - will be also the dimensions of the player inside the swf if the flash vars 
    playerWidth and playerHeight are not defined when used as single video player;
    - will be also the dimensions of the video inside the player if the flash vars 
    playerWidth, playerHeight, and the attributes videoMetadataWidth and videoMetadataHeight
    (in the XML file) are not defined and the video being played also doesn't have metadata.*/
    var stageW = 640;
    var stageH = 363;
    
    /** PARAMS **/
    var params = {};
    params.bgcolor = '#efefef';
    params.allowfullscreen = 'true';
    params.wmode = 'transparent';
    
    /** FLASH VARS **/
    var flashVars = {};
    
    /* player information only if used as SINGLE VIDEO PLAYER(if videoSinglePath is defined) */
    
    // dimensions of the player inside the swf object(in this case, the same as the SWF)
    flashVars.playerWidth = stageW; //320; // javascript vars or numeric values
    flashVars.playerHeight = stageH; //240;

    // video information if used as single video player
    flashVars.videoSinglePath = 'http://c0158561.cdn.cloudfiles.rackspacecloud.com/kesterson_individual_final_cut_no_kp-h.flv';
    //flashVars.videoSingleStreamer = 'rtmp://domain.com/';
    //flashVars.previewSinglePath = 'previews/preview.jpg';
    flashVars.videoMetadataWidth = '';
    flashVars.videoMetadataHeight = '';
    flashVars.videoMetadataDuration = '';
    
    // player settings instead of XML values
    flashVars.autoStart = 'false';
    flashVars.playContinuous = 'false';
    flashVars.disableCenterButton = 'false';
    flashVars.controllerAutoHide = 'true';
    flashVars.autoHideTime = '2';
    flashVars.bufferTime = '3';
    flashVars.initialVolumeProcentage = '50';
    //
    flashVars.controllerBackgroundColor = '0x333333';
    flashVars.buttonsBackgroundColor = '0x000000';
    flashVars.buttonsSignColor = '0xFFFFFF'; // this will be also for the timer's text color
    flashVars.buttonsSignOverColor = '0x009D43'; //'0x0033FF'; // this will be also for the progress of the volumeBar and playingBar, and the scrub's interior
    flashVars.loadingBarColor = '0x27D865'; //'0x4f76e7'; // this also for the backbar inside volume bar
    flashVars.barsBackgroundColor = '0x000000';
    
    /* player information only if used as MULTI VIDEO PLAYER */
    // XML path with settings
    //flashVars.xmlPath = 'files/xml/settings.xml';
    
    attributes = {};
    
    /** EMBED THE SWF OBJECT **/
    swfobject.embedSWF('/assets/flash/preview.swf', targetId, stageW, stageH, '9.0.0', '/js/swfobject/expressInstall.swf', flashVars, params, attributes);
}

function physicalActivityVideo(targetId) {
    /* DIMENSIONS of the SWF object 
    - will be also the dimensions of the player inside the swf if the flash vars 
    playerWidth and playerHeight are not defined when used as single video player;
    - will be also the dimensions of the video inside the player if the flash vars 
    playerWidth, playerHeight, and the attributes videoMetadataWidth and videoMetadataHeight
    (in the XML file) are not defined and the video being played also doesn't have metadata.*/
    //var stageW = 735;
    //var stageH = 490;
    var stageW = 460;
    var stageH = 307;
    
    /** PARAMS **/
    var params = {};
    params.bgcolor = '#efefef';
    params.allowfullscreen = 'true';
    params.wmode = 'transparent';
    
    /** FLASH VARS **/
    var flashVars = {};
    
    /* player information only if used as SINGLE VIDEO PLAYER(if videoSinglePath is defined) */
    
    // dimensions of the player inside the swf object(in this case, the same as the SWF)
    flashVars.playerWidth = stageW; //320; // javascript vars or numeric values
    flashVars.playerHeight = stageH; //240;

    // video information if used as single video player
    flashVars.videoSinglePath = 'http://c0158561.cdn.cloudfiles.rackspacecloud.com/murray_ava.flv';
    //flashVars.videoSingleStreamer = 'rtmp://domain.com/';
    //flashVars.previewSinglePath = 'previews/preview.jpg';
    flashVars.videoMetadataWidth = '';
    flashVars.videoMetadataHeight = '';
    flashVars.videoMetadataDuration = '';
    
    // player settings instead of XML values
    flashVars.autoStart = 'false';
    flashVars.playContinuous = 'false';
    flashVars.disableCenterButton = 'false';
    flashVars.controllerAutoHide = 'true';
    flashVars.autoHideTime = '2';
    flashVars.bufferTime = '3';
    flashVars.initialVolumeProcentage = '50';
    //
    flashVars.controllerBackgroundColor = '0x333333';
    flashVars.buttonsBackgroundColor = '0x000000';
    flashVars.buttonsSignColor = '0xFFFFFF'; // this will be also for the timer's text color
    flashVars.buttonsSignOverColor = '0x009D43'; //'0x0033FF'; // this will be also for the progress of the volumeBar and playingBar, and the scrub's interior
    flashVars.loadingBarColor = '0x27D865'; //'0x4f76e7'; // this also for the backbar inside volume bar
    flashVars.barsBackgroundColor = '0x000000';
    
    /* player information only if used as MULTI VIDEO PLAYER */
    // XML path with settings
    //flashVars.xmlPath = 'files/xml/settings.xml';
    
    attributes = {};
    
    /** EMBED THE SWF OBJECT **/
    swfobject.embedSWF('/assets/flash/preview.swf', targetId, stageW, stageH, '9.0.0', '/js/swfobject/expressInstall.swf', flashVars, params, attributes);

}

function stressManagementVideo(targetId) {
    /* DIMENSIONS of the SWF object 
    - will be also the dimensions of the player inside the swf if the flash vars 
    playerWidth and playerHeight are not defined when used as single video player;
    - will be also the dimensions of the video inside the player if the flash vars 
    playerWidth, playerHeight, and the attributes videoMetadataWidth and videoMetadataHeight
    (in the XML file) are not defined and the video being played also doesn't have metadata.*/
    //var stageW = 735;
    //var stageH = 490;
    var stageW = 320;
    var stageH = 213;
    
    /** PARAMS **/
    var params = {};
    params.bgcolor = '#efefef';
    params.allowfullscreen = 'true';
    params.wmode = 'transparent';
    
    /** FLASH VARS **/
    var flashVars = {};
    
    /* player information only if used as SINGLE VIDEO PLAYER(if videoSinglePath is defined) */
    
    // dimensions of the player inside the swf object(in this case, the same as the SWF)
    flashVars.playerWidth = stageW; //320; // javascript vars or numeric values
    flashVars.playerHeight = stageH; //240;

    // video information if used as single video player
    flashVars.videoSinglePath = 'http://c0158561.cdn.cloudfiles.rackspacecloud.com/deepbreathing_shortclip.flv';
    //flashVars.videoSingleStreamer = 'rtmp://domain.com/';
    //flashVars.previewSinglePath = 'previews/preview.jpg';
    flashVars.videoMetadataWidth = '';
    flashVars.videoMetadataHeight = '';
    flashVars.videoMetadataDuration = '';
    
    // player settings instead of XML values
    flashVars.autoStart = 'false';
    flashVars.playContinuous = 'false';
    flashVars.disableCenterButton = 'false';
    flashVars.controllerAutoHide = 'true';
    flashVars.autoHideTime = '2';
    flashVars.bufferTime = '3';
    flashVars.initialVolumeProcentage = '50';
    //
    flashVars.controllerBackgroundColor = '0x333333';
    flashVars.buttonsBackgroundColor = '0x000000';
    flashVars.buttonsSignColor = '0xFFFFFF'; // this will be also for the timer's text color
    flashVars.buttonsSignOverColor = '0x009D43'; //'0x0033FF'; // this will be also for the progress of the volumeBar and playingBar, and the scrub's interior
    flashVars.loadingBarColor = '0x27D865'; //'0x4f76e7'; // this also for the backbar inside volume bar
    flashVars.barsBackgroundColor = '0x000000';
    
    /* player information only if used as MULTI VIDEO PLAYER */
    // XML path with settings
    //flashVars.xmlPath = 'files/xml/settings.xml';
    
    attributes = {};
    
    /** EMBED THE SWF OBJECT **/
    swfobject.embedSWF('/assets/flash/preview.swf', targetId, stageW, stageH, '9.0.0', '/js/swfobject/expressInstall.swf', flashVars, params, attributes);

}

function participantProfileVideo(targetId) {
    /* DIMENSIONS of the SWF object 
    - will be also the dimensions of the player inside the swf if the flash vars 
    playerWidth and playerHeight are not defined when used as single video player;
    - will be also the dimensions of the video inside the player if the flash vars 
    playerWidth, playerHeight, and the attributes videoMetadataWidth and videoMetadataHeight
    (in the XML file) are not defined and the video being played also doesn't have metadata.*/
    //var stageW = 735;
    //var stageH = 490;
    var stageW = 600;
    var stageH = 340;
    
    /** PARAMS **/
    var params = {};
    params.bgcolor = '#efefef';
    params.allowfullscreen = 'true';
    params.wmode = 'transparent';
    
    /** FLASH VARS **/
    var flashVars = {};
    
    /* player information only if used as SINGLE VIDEO PLAYER(if videoSinglePath is defined) */
    
    // dimensions of the player inside the swf object(in this case, the same as the SWF)
    flashVars.playerWidth = stageW; //320; // javascript vars or numeric values
    flashVars.playerHeight = stageH; //240;

    // video information if used as single video player
    flashVars.videoSinglePath = 'http://c0158561.cdn.cloudfiles.rackspacecloud.com/Participant_Profile_1st_Cut.flv';
    //flashVars.videoSingleStreamer = 'rtmp://domain.com/';
    //flashVars.previewSinglePath = 'previews/preview.jpg';
    flashVars.videoMetadataWidth = '';
    flashVars.videoMetadataHeight = '';
    flashVars.videoMetadataDuration = '';
    
    // player settings instead of XML values
    flashVars.autoStart = 'false';
    flashVars.playContinuous = 'false';
    flashVars.disableCenterButton = 'false';
    flashVars.controllerAutoHide = 'true';
    flashVars.autoHideTime = '2';
    flashVars.bufferTime = '3';
    flashVars.initialVolumeProcentage = '50';
    //
    flashVars.controllerBackgroundColor = '0x333333';
    flashVars.buttonsBackgroundColor = '0x000000';
    flashVars.buttonsSignColor = '0xFFFFFF'; // this will be also for the timer's text color
    flashVars.buttonsSignOverColor = '0x009D43'; //'0x0033FF'; // this will be also for the progress of the volumeBar and playingBar, and the scrub's interior
    flashVars.loadingBarColor = '0x27D865'; //'0x4f76e7'; // this also for the backbar inside volume bar
    flashVars.barsBackgroundColor = '0x000000';
    
    /* player information only if used as MULTI VIDEO PLAYER */
    // XML path with settings
    //flashVars.xmlPath = 'files/xml/settings.xml';
    
    attributes = {};
    
    /** EMBED THE SWF OBJECT **/
    swfobject.embedSWF('/assets/flash/preview.swf', targetId, stageW, stageH, '9.0.0', '/js/swfobject/expressInstall.swf', flashVars, params, attributes);

}

function introVideo(targetId) {
    var stageW = 684;
    var stageH = 358;
    
    /** PARAMS **/
    var params = {};
    params.bgcolor = "#efefef";
    params.allowfullscreen = "true";
    
    /** FLASH VARS **/
    var flashVars = {};
    flashVars.playerWidth = stageW; 
    flashVars.playerHeight = stageH;
    flashVars.linkOutVar = "/our-programs.html?src=intro";
    flashVars.opensIn = "_blank";
    flashVars.videoSinglePath = "http://c0158561.cdn.cloudfiles.rackspacecloud.com/MySelfHelp ShortCut_F8_768K_New.flv";
    flashVars.videoMetadataDuration = "100";
    
    attributes = {};
    
    /** EMBED THE SWF OBJECT **/
    swfobject.embedSWF('/assets/flash/msh8.swf', targetId, stageW, stageH, '9.0.124', '/js/swfobject/expressInstall.swf', flashVars, params, attributes);
}

function homePageIntroVideo(targetId, stageW, stageH) {
    //var stageW = 718;
    //var stageH = 350;
   
    /** PARAMS **/
    var params = {};
    params.bgcolor = "#ffffff";
    params.allowfullscreen = "true";
    params.allowScriptAccess = "sameDomain";
    
    /** FLASH VARS **/
    var flashVars = {};
    flashVars.playerWidth = stageW; 
    flashVars.playerHeight = stageH;
    flashVars.linkOutVar = "/our-programs.html?src=intro";
    flashVars.opensIn = "_blank";
    flashVars.videoSinglePath = "http://c0158561.cdn.cloudfiles.rackspacecloud.com/MySelfHelp ShortCut_F8_768K_New.flv";
    flashVars.videoMetadataDuration = "100";
       
    attributes = {};
    
    /** EMBED THE SWF OBJECT **/
    swfobject.embedSWF('/assets/flash/msh8_landing.swf', targetId, stageW, stageH, '9.0.124', '/js/swfobject/expressInstall.swf', flashVars, params, attributes);

}

function participantVideo(targetId) {
    /* DIMENSIONS of the SWF object 
    - will be also the dimensions of the player inside the swf if the flash vars 
    playerWidth and playerHeight are not defined when used as single video player;
    - will be also the dimensions of the video inside the player if the flash vars 
    playerWidth, playerHeight, and the attributes videoMetadataWidth and videoMetadataHeight
    (in the XML file) are not defined and the video being played also doesn't have metadata.*/
    var stageW = 480;
    var stageH = 272;
    
    /** PARAMS **/
    var params = {};
    params.bgcolor = '#efefef';
    params.allowfullscreen = 'true';
    params.wmode = 'transparent';
    
    /** FLASH VARS **/
    var flashVars = {};
    
    /* player information only if used as SINGLE VIDEO PLAYER(if videoSinglePath is defined) */
    
    // dimensions of the player inside the swf object(in this case, the same as the SWF)
    flashVars.playerWidth = stageW; //320; // javascript vars or numeric values
    flashVars.playerHeight = stageH; //240;
    
    // video information if used as single video player
    flashVars.videoSinglePath = 'http://c0158561.cdn.cloudfiles.rackspacecloud.com/myselfhelp_2nd_cut_1.flv';
    //flashVars.videoSingleStreamer = 'rtmp://domain.com/';
    //flashVars.previewSinglePath = 'previews/preview.jpg';
    flashVars.videoMetadataWidth = '';
    flashVars.videoMetadataHeight = '';
    flashVars.videoMetadataDuration = '';
    
    // player settings instead of XML values
    flashVars.autoStart = 'false';
    flashVars.playContinuous = 'false';
    flashVars.disableCenterButton = 'false';
    flashVars.controllerAutoHide = 'true';
    flashVars.autoHideTime = '2';
    flashVars.bufferTime = '3';
    flashVars.initialVolumeProcentage = '50';
    //
    flashVars.controllerBackgroundColor = '0x333333';
    flashVars.buttonsBackgroundColor = '0x000000';
    flashVars.buttonsSignColor = '0xFFFFFF'; // this will be also for the timer's text color
    flashVars.buttonsSignOverColor = '0x009D43'; //'0x0033FF'; // this will be also for the progress of the volumeBar and playingBar, and the scrub's interior
    flashVars.loadingBarColor = '0x27D865'; //'0x4f76e7'; // this also for the backbar inside volume bar
    flashVars.barsBackgroundColor = '0x000000';
    
    /* player information only if used as MULTI VIDEO PLAYER */
    // XML path with settings
    //flashVars.xmlPath = 'files/xml/settings.xml';
    
    attributes = {};
    
    /** EMBED THE SWF OBJECT **/
    swfobject.embedSWF('/assets/flash/preview.swf', targetId, stageW, stageH, '9.0.0', '/js/swfobject/expressInstall.swf', flashVars, params, attributes);

} 


Shadowbox.init(
    {
        players: ['img', 'swf', 'html', 'iframe']
    }
);

$(document).ready(function() {
    $('#main_bg_images').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});
	
	
//$(".rcorner").corner("11px");

  settings = {
          tl: { radius: 10 },
          tr: { radius: 10 },
          bl: { radius: 10 },
          br: { radius: 10 },
          antiAlias: true,
          autoPad: true,
          validTags: ["div"]
      }

  $('.rcorner').corner(settings);
	
	
});


$(function() {
    //MSH-61 Internet Explorer has problems rendering superscripted characters in hyperlinks - the underscore line gets moved up, so we will remove the super-scripting.
    if ($.browser.msie) {
        $('a').each(function() {
            var rText = jQuery(this).html();
            if (rText != null && rText != '' && rText.indexOf('<sup>')) {
                rText = rText.replace('<sup>', '').replace('</sup>', '');
                jQuery(this).html(rText);
            }
        });
    }
    
    //MSH-98
    /*$('#home_side_nav a').bind('click', function() {
        $('#link_containers div').hide();
        var target = this.href.substring(this.href.lastIndexOf('#'));
        $(target).show();
        $(target+" div").show();
    });
    $('#home_side_nav a').click(function() {
        return false;
    });*/

    //make all links to PDFs open a new window (p23 and 57)
    $("a[href$=.pdf]").attr("target","_blank");
    $("a[href$=.PDF]").attr("target","_blank");
    $("a[href$=.doc]").attr("target","_blank");
    $("a[href$=.DOC]").attr("target","_blank");
      
    //make all links to PDFs and DOCs call Google Analytics (also requires 4 lines of code above, which open new window, to function properly)
    $("a[href$=.pdf]").attr("onclick","pageTracker._trackPageview($(this).attr('href'));");
    $("a[href$=.PDF]").attr("onclick","pageTracker._trackPageview($(this).attr('href'));");
    $("a[href$=.doc]").attr("onclick","pageTracker._trackPageview($(this).attr('href'));");
    $("a[href$=.DOC]").attr("onclick","pageTracker._trackPageview($(this).attr('href'));");

    //Exit Disclaimer
      $("a[href^=http]").click(function() {
          var href=$(this).attr("href");
          if (href != null && href.indexOf('myselfhelp.com') == -1 && href.indexOf('myselfhelp.kazaamweb.com') == -1 && href.indexOf('healthmedia.com') == -1 && href.indexOf('thawte.com') == -1) {
              jQuery.blockUI({ 
              message: "<div class=\"exitPopup\"><p>Thank you for visiting MySelfHelp.com</p><p>By clicking 'Continue', you will be taken to:<br /><b>" + href + "</b></p><p>This is a Web site to which our Privacy Policy does not apply. You are solely responsible for your interactions with such Web sites.</p><p><a href=\"" + href + "\" target=\"_blank\" onclick=\"closePopup();\">Continue</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href=\"javascript:closePopup();\">Cancel</a></p></div>",
              
              css: {  
                width:          '590px', 
                padding:        '10px', 
                margin:         0,   
                color:          '#333', 
                textAlign:      'left', 
                border:         '1px solid #999', 
                backgroundColor:'#fff', 
                cursor:         'wait' 
              }, 
              
              // styles for the overlay 
              overlayCSS:  {  
                backgroundColor:'#000',  
                opacity:        '0.1'  
              }
                });
              return false;
          }
      });
});

$(document).ready(function() {
	$(".video_link").each(function() {
	   $(this).click(function(event) {
	        event.preventDefault();
	        event.returnValue = false;
	        
	        var sbrel = $(this).attr("sb_rel");
	        var splits = sbrel.split(";");
	        var width = splits[1].split("=")[1];
	        var height = splits[2].split("=")[1];
	        var title = (splits.length > 3) ? splits[3].split("=")[1] : "&nbsp;";

	        // open in shadowbox
	        Shadowbox.open({
	            content:    $(this).attr("href"),
	            player:     "iframe",
	            title:      "<div class=\"sb-title sb-title-with-nav\">"+title+"</div><div id=\"shadowbox_nav\"><a class=\"sb_title_nav_close\" onclick=\"Shadowbox.close()\" title=\"Close\">Close <img src=\"/js/shadowbox-3.0b/resources/close.png\"/></a></div>",
	            width:      width,
	            height:     height
	        });
	        // hide footers, the close button moved to title bar
	        $('#sb-info *').each(function(){$(this).hide();});
	        $('#sb-info').hide();

	        
	        return false;
	   		});
		});
});
