//============================= c_mls01.js ==============================================
function getCookie(name){
  var cname = name + "=";
  var dc = document.cookie;
  if (dc.length > 0) {
    begin = dc.indexOf(cname);
    if (begin != -1) {
      begin += cname.length;
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
        return unescape(dc.substring(begin, end));
    }
  }
  return null;
}

function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) +
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}

function delCookie (name,path,domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// In 01 lv_h is set to 'home', in 02 lv_h is set to 'mmind'
function checkAssoc(longaid) {
  lv=getCookie('LongAID')
  if (lv==null) {
    setCookie('LongAID', longaid, expiration, '/', '.magiclearning.com');
    setCookie('LongAID', longaid, expiration, '/', 'www.magiclearning.com');
//    window.location.href="http://magiclearning.com/cgi/count.pl?uvis";
//    window.location.replace("http://magiclearning.com");
  }
}

//set expiration date 10 years ahead
var expiration = new Date();
expiration.setTime(expiration.getTime() + 315360000000);

var src_loaded = true;

//<!-- Start CBClicks.com modal exit pop code -->

//function cbclicksMexit(){
//   cb_1 = "l=1&n=6&w=160&h=600&bo=%23CCCCCC&ba=%23FFFFFF&ti=%230000FF&ac=%23000000&top=education%20homeschool&cat=60&cid=magiclearn";
//or  cb_1 = "l=1&n=6&w=160&h=600&bo=%23CCCCCC&ba=%23FFFFFF&ti=%230000FF&ac=%23000000&top=&cat=&cid=magiclearn";
//   cb_2 = 'dialogHeight:634px;dialogWidth:168px;help:no;resizable:yes;scroll:no;status:no;';
//   cb_3 = 'height=600,width=160,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no';
//   cb_u = "http://www.cbclicks.com/showM.php?" + cb_1;
//   if (document.all){showModalDialog(cb_u, "", cb_2);}
//   else{window.open(cb_u, "CBClicks", cb_3);}
//}
//window.onunload=cbclicksMexit;

//<!-- End CBClicks.com code -->

//========================= end c_mls01.js ==============================================
