   var startDate = new Date("11/22/2010");
	   var endDate = new Date("12/27/2010");
	   var finalEndDate = new Date("01/01/2011"); 
	   var today = new Date();	   
	    
   	 
	function setCookieInfo (name,value,expires) {
		document.cookie = name + "=" + escape (value) +
		((expires) ? "; expires=" + expires.toGMTString() : "");
	}	

	function getCookieVal (offset) {
	  var endstr = document.cookie.indexOf (";", offset);
	  if (endstr == -1) { endstr = document.cookie.length; }
	  return unescape(document.cookie.substring(offset, endstr));
	}
	 
	function read_querystring()
   {
   var a_out = new Object();
   var s_loc = String(location.href);
	
   if(s_loc.indexOf('?')>0)
     {
     var p;
     var s_query = s_loc.substr(s_loc.indexOf('?')+1);
     var a_query = s_query ? s_query.split('&') : new Array();

     for(var i=0; i<a_query.length; i++)
       {
       p = a_query[i].split('=');
       a_out[p[0]] = p[1].replace(/\+/g, ' ');
       }
     }
   return a_out;
   }
   
   function createLightBox(){
		var rand_no = Math.random();
		rand_no = rand_no * 100;
		rand_no = Math.ceil(rand_no);

		if(rand_no%2 == 0) { 
			var lightBoxWin = "/HEARTORG/common/lightBox2.jsp?site=Heart&keepThis=true&TB_iframe=true&height=555&width=755";
		} else {
			var lightBoxWin = "/HEARTORG/common/lightBox2.jsp?site=Heart&keepThis=true&TB_iframe=true&height=555&width=755";
		}
		
		tb_show(lightBoxWin); 
	}
	function getCookieInfo(name) {
	  var arg = name + "=";
	  var alen = arg.length;
	  var clen = document.cookie.length;
	  var i = 0;
	while (i < clen) {
		
	    var j = i + alen;
	    if (document.cookie.substring(i, j) == arg) {
	      return getCookieVal (j);
	      }
	    i = document.cookie.indexOf(" ", i) + 1;
	    if (i == 0) break; 
	    }
	  return null;

	}
	function showLightBox(){
		
	  if (today >= startDate  && today <= endDate){
		if (getCookieInfo('firstHit') == null) {
		  setCookieInfo('firstHit', 'true', endDate);
		  createLightBox();
		}
	  }else if(today > endDate  && today<= finalEndDate){
		if (getCookieInfo('aftEndDate') == null) {
		  document.cookie="aftEndDate=JavaScript Kit" 
		  createLightBox();
		}
	  }  
	}
	   
	   

