function getCookieVal (offset) {  
	var endstr = document.cookie.indexOf (";", offset);  
	if (endstr == -1)    
		endstr = document.cookie.length;  
	return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (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 SetCookie (name, value) {  // can include other arguments
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;
	// set expires (in days ) to proper form
	if (expires != null) {
		var expDays = expires;  // expires in days
		var expDate = new Date();
		expDate.setTime(expDate.getTime() +  (24 * 60 * 60 * 1000 * expDays));  
	}
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" +expDate.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}

function entry(value,value2){
	var name = "dermtracker";
	if (GetCookie(name) == null) // only set  when entering 
		SetCookie(name,value);
	var name = "firststop";
	if (GetCookie(name) == null) // only set  when entering 
		SetCookie(name,value2);

	}

function order() {
	  var destination = "go.asp?blankdest=https://Secure15.prohosting.com/~a0012572/ordercgi.htm";
          var title = "Online order";
          var orderpage = "?";
	  orderpage = orderpage + GetCookie("dermalert");
	  if(GetCookie("dermalert") == null) orderpage = "";
          document.write('<a target="_blank" href="'+destination+orderpage+'">');
          document.write(title+'</a>');
}

function now() {
	day = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
   	month = new Array("Jan.","Feb.","March","April","May","June","July","August","Sept.","Oct.","Nov.","Dec.")	
   	var Today = new Date();
   	var str;
   	str = day[Today.getDay()] + " "; 
   	str += month[Today.getMonth() ] + " ";
   	str += Today.getDate() + ", ";
   	str += Today.getFullYear();
   	document.write(str);
}

function daysleft(){
	var Today = new Date();
	var str=0;

	str = 31 - Today.getDate();
	if(str >15 ) str2 = " ";
	if(str == 0) str2 = "limited time: last day of sale!!";
	if(str < 15){
		str2 = "limited time: only ";
		str2 += str;
		str2 +=" days left!";
	}
	document.write(str2);
}



//  End -->
