
<!--

var visits = '';

function GetCookie(CookieName){
  var allcookies=document.cookie;
  if (allcookies=='') {
    return '';
  }    
  else {
      allcookies=unescape(allcookies);
      CookieName=CookieName + "=";      
      alpha=document.cookie.indexOf(CookieName); //beginning of cookie name
      if (alpha != -1 ){  //does exist.   
			alpha += CookieName.length; // beginning of cookie value
      	omega=document.cookie.indexOf(":", alpha); // searches for ":" starting at char # alpha  
      	if (omega==-1)  {
			   omega=document.cookie.length} // if no : is found, goto the end ...   
      	CookieValue=document.cookie.substring(alpha, omega);      
      	CookieValue=unescape(CookieValue);
  		return CookieValue;
      } //end if alpha exists 
      return ""; //since alpha doesnot exist, no cookie match	
  }  // end else
}  //end GetCookie


function IncrementCookie(){
 //// this has to fixed so that it won't increment internally... use this IDEA!!!!
/* function wherefrom() {
    if (document.referrer=="file:///D|/ALL_FYLS/WWW/sworigmi.htm" || document.referrer=="http://www.happymagpie.com/sworigmi.htm") {
      
  */
 
     if (visits) {
    	if (visits==null ||  visits==undefined){
	        visits=0;
        }
    visits++;
    }
    else {
       visits=1;
    }
}   


function SetCookie() {
   var expiration = new Date();
   expiration.setFullYear(expiration.getFullYear() + 1);
   expiration=expiration.toGMTString();
   var howold=this.document.lastModified;    
	
   var cookieTotal = 'visits=' + escape(visits);
	cookieTotal += ':version=' + escape(NewVer);
	cookieTotal += ':version2=' + escape(howold);
        cookieTotal += ':expires=' + escape(expiration); // ";version=" + escape(document.lastModified) +   
                                               //  ";expires=" + expiration;
   this.document.cookie = cookieTotal;
  
//this.document.cookie='visits=9;version=9;expires=Fri, 02-Jan-1970 00:00:00 GMT';
}

function CheckIfNew(version) {
	
     if (NewVer == version) {
	return "UpToDate"		
     }
     else {
        return "bad";
     }
}

function CheckIfNew2(version2) {
     var NewVer2 = this.document.lastModified;
        
     if (NewVer2 == version2) {
	return "UpToDate";		
     }
     else {
        return "bad";
     }
}

function RemoveCookie(){
    var expired='visits=;version=;expires=Fri, 02-Jan-1970 00:00:00 GMT';            
    this.document.cookie=expired;
    alert(document.cookie);
} 


/*
function WhatDay() {
   var WeekDays = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");    
   var Months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");

   var greeting;
   var today = new Date();
   var todaysHour = today.getHours();
   var todaysDay = today.getDay();
   var todaysMonth = today.getMonth(); 
   var todaysDate = today.getDate();
   var todaysYear = today.getFullYear();
    
     if (todaysHour < 5) {
        greeting = "Go to bed! It's late!"
     }
     else if (5 <= todaysHour && todaysHour < 12) {
        greeting = "Good Morning";
     }
     else if (12 <= todaysHour && todaysHour < 17) {
        greeting = "Good Afternoon";
     }
     else if (17 <= todaysHour) {
        greeting = "Good Evening";
     }

    
    document.write(greeting + "<br>");
    document.write("Today is: " + WeekDays[todaysDay] + ", <br>");
    document.write(Months[todaysMonth] + " " + todaysDate + ", " + todaysYear);

}

//end WhatDay */



visits=GetCookie("visits");
expires=GetCookie("expires");
version=GetCookie("version");
version2=GetCookie("version2");
var UpToDate = CheckIfNew(version);  //so versionis the new.htm
var UpToDate2 = CheckIfNew2(version2); //version2 is the current page

IncrementCookie();



SetCookie();




function openme2(ship) {
  var success=false;
	 if (ship==undefined) 
       {ship="notes.html?nowwhat"}
   else {
     var ship = "notes.html?" + ship;}
  success=window.open (ship, "notes", 
    "toolbar=no," +
    "location=no," +
    "directories=no," +
    "status=no," +
    "menubar=no," +
    "scrollbars=yes," +
    "resizable=no," +
    "width=300," +
    "height=300"
    );
	return success;
}

function openme(ship) { //switches the return value... due to popup-blockers need to go to *noj.page
  if(openme2(ship)==false){
	  return true} 
	else {
	  return false};
}	

//-->
