

function Get_Cookie( check_name ) {
         // first we'll split this cookie up into name/value pairs
         // note: document.cookie only returns name=value, not the other components
         var a_all_cookies = document.cookie.split( ';' );
         var a_temp_cookie = '';
         var cookie_name = '';
         var cookie_value = '';
         var b_cookie_found = false; // set boolean t/f default f

         for ( i = 0; i < a_all_cookies.length; i++ )
         {
                // now we'll split apart each name=value pair
                a_temp_cookie = a_all_cookies[i].split( '=' );


                // and trim left/right whitespace while we're at it
                cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

                // if the extracted name matches passed check_name
                if ( cookie_name == check_name )
                {
                        b_cookie_found = true;
                        // we need to handle case where cookie has no value but exists (no = sign, that is):
                        if ( a_temp_cookie.length > 1 )
                        {
                                cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
                        }
                        // note that in cases where cookie is initialized but no value, null is returned
                        return cookie_value;
                        break;
                }
                a_temp_cookie = null;
                cookie_name = '';
         }
         if ( !b_cookie_found )
         {
                return null;
         }
}

var mpp_cookie = Get_Cookie("mypath.user.userId");
var swf_name;

if(mpp_cookie != null)
{
         swf_name = "http://www.mypath.com/MyPath2/JiveHeaderReg";
}
else
{
         swf_name = "http://www.mypath.com/MyPath2/JiveHeaderUnreg";
}

/* "OLD" method of flash detection CK 11.23.2009 */
var flashVars = "mypath_env=prod";
//name of swf,swf obj id, width, height, bgColor, alignment, wmode, allowScriptAccess, flashVars, cssClass
var headerFlashObj = new Flashwrapper(swf_name,'headerSWF','100%','240','','middle','transparent','always',flashVars,'manpower-flash-header');


/*if(mpp_cookie != null)
{
         swf_name = "http://www.mypath.com/MyPath2/JiveHeaderReg.swf";
}
else
{
         swf_name = "http://www.mypath.com/MyPath2/JiveHeaderUnreg.swf";
}
 
 
var flashvars = {  
                mypath_env:    "prod"
};
 
 
var params = {  
         align:                         "middle",
         name:                          "MyPath",
         wmode:                         "transparent",
         "class":                       "manpower-flash-header",
         allowScriptAccess:             "always"
};

var attributes = {
         wmode:                         "transparent",
         "class":                       "manpower-flash-header",
         allowScriptAccess:             "always"
};

swfobject.embedSWF(
         swf_name, 
         "JiveHeader", 
         "100%", 
         "240", 
         "9.0.0",
         "http://www.mypath.com/MyPath2/swfobject/expressinstall.swf", 
         flashvars, 
         params, 
         attributes);*/