var d = new Date();
var urlstr = document.referrer;

try{
if (urlstr=="" || urlstr == null) {
} else {
  setCookie("abc", "abc", 2);
  if (getCookie("abc") == "abc") {
    delCookie("abc");
    if (getCookie("abcxxx") == "ok") {
    } else {
    }
  }
}
d.setTime(d.getTime() + 30 * 24 * 60 * 60 *1000);
document.cookie = "abcxxx=ok; expires=" + d.toGMTString();    
}catch(e){
}


function getCookie(sName){
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++){
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0])
      return aCrumb[1];
  }
  return null;
}

function delCookie(sName){
  var date = new Date();
  document.cookie = sName + "= ; expires=" + date.toGMTString();
}

function setCookie(sName, sValue, iTime){
  var date = new Date();
  date.setTime(date.getTime()+iTime*1000);
  document.cookie = sName + "=" + sValue + "; expires=" + date.toGMTString() + ";domain=www.soball.com";
}
