 
var Disclaimer =
{
    destination: null,
    declineURL: null,
    
    Accept: function()
    {
        $("speed-bump").style.display = "none";
        var path = "/";
        var value = "yes" ;
        if(this.destination != null)
        {
			   //alert("Accept: destination: " + this.destination + " " + this.destination.search( /individualinvestors/i));
            
             if (this.destination.search( /individualinvestors/i) > 0)
             {
			    // alert("Accept destination CLEARBRIDGE_INDIVIDUALSITE_DISCLAIMER: ");
                var c_name = "CLEARBRIDGE_INDIVIDUALSITE_DISCLAIMER";
                document.cookie = c_name+ "=" + escape(value)+    ((path) ? "; path=" + path : "");
             }
             else
             {
				 //alert("Accept destination CLEARBRIDGE_SITE_DISCLAIMER: "  );
                var c_name = "CLEARBRIDGE_SITE_DISCLAIMER";
                document.cookie = c_name+ "=" + escape(value)+    ((path) ? "; path=" + path : "");
             }
             window.location = this.destination;
        }
    },
    
    AcceptScholarChoice: function()
    {
        $("speed-bumpSC").style.display = "none";
        
        if(this.destination != null)
        {
          var newWindow = window.open(this.destination, '_blank');
          newWindow.focus();
        }
    },
    
    Decline: function()
    {
       
       $("speed-bump").style.display = "none";               
        window.location = this.declineURL;
       
         
    },
    
    Show: function(destination,declineURL)
    {
          this.destination = destination;
          this.declineURL = declineURL;
                  
        var INDsite = Cookie.get("CLEARBRIDGE_INDIVIDUALSITE_DISCLAIMER") || null; 
        var CBsite = Cookie.get("CLEARBRIDGE_SITE_DISCLAIMER") || null;   
        
              
        if (  INDsite == null )
         {

                var layer = $("speed-bump");
                var bump = $$("#speed-bump .window")[0];
                $$("#speed-bump .shade")[0].setOpacity(0.5);
                layer.style.height = $(document.body).getSize().size.y + "px";
                bump.style.top = Window.getScrollTop() + 145 + "px";
                layer.style.display = "block";  
                 
         }
         
        else if (  CBsite == null )
        {
          if (this.destination.search( /individualinvestors/i) < 0)
           {
                var layer = $("speed-bump");
                var bump = $$("#speed-bump .window")[0];
                $$("#speed-bump .shade")[0].setOpacity(0.5);
                layer.style.height = $(document.body).getSize().size.y + "px";
                bump.style.top = Window.getScrollTop() + 145 + "px";
                layer.style.display = "block";    
          }  
          else 
          {
            window.location = this.destination;
           }
       }  
      else 
      {
            window.location = this.destination;
      }

    },
    
    ShowScholarChoice: function(destination,declineURL)
    {
        this.destination = destination;
        this.declineURL = declineURL;
        var layer = $("speed-bumpSC");
        var bump = $$("#speed-bumpSC .window")[0];
        $$("#speed-bumpSC .shade")[0].setOpacity(0.5);
        layer.style.height = $(document.body).getSize().size.y + "px";
        bump.style.top = Window.getScrollTop() + 145 + "px";
        layer.style.display = "block";
    }        
};


