How to check if referrer is specified
<p>I have been stuck on this for over one hour:</p>

<pre><code>   if((document.referrer===undefined)){

  if(url_window_location=='http://www.lhttp://livecas.com/sandbox/andbox/'){
      event_google_analytics_referrer=document.referrer.toString(); 
         log("DOCUMENT REFERRER: cookie is set user_details: "+document.referrer);
        eraseCookie('user_details');
         setCookie('user_details',document.referrer,365); 
   }

    if(url_window_location=='hhttp://livecas.com/sandbox/e')
    {   
        eraseCookie('user_details');
        setCookie('landing_page_ref',"FBLND1",365);
        //   log("Cookie is set"); 
    }
 }

 else{

       if(url_window_location=='http://livecas.com/sandbox/'){
            eraseCookie('user_details');
         setCookie('user_details',"Direct",365); 
          log("Direct cookie is set");

          event_google_analytics_referrer="Direct";
      }
 }
</code></pre>

<p>If document.referrer is set/exists or whatever, i want it to execute the block in the if condition if not I want it the else condition. now it goes to the else condition no matter what</p>
