	//******************************************************************* 
  	//* Function:    writeCopyright
	//* Author:      Code Pug
	//* Description: Write current copyright information on each page
	//*******************************************************************	
	function writeCopyright(){
		var today       = new Date();
		var currentYear = today.getYear();

		// If not IE, then add 1900 to year
		// var agent = navigator.userAgent.toLowerCase(); 
		// if (agent.indexOf("msie") == -1 )

		if (currentYear < 1900)
			currentYear = currentYear + 1900;

	  	document.write("<center><font size=\"-1\">");
		document.write("Copyright &#169;"+currentYear);
		document.write(" www.codePug.com</font></center><br></br>");
	}
	
	//******************************************************************* 
  	//* Function:    makeFullScreen
	//* Author:      Code Pug
	//* Description: Resize the browser window
	//*******************************************************************	
	function makeFullScreen(){
		  top.window.moveTo(0,0);
		  top.window.resizeTo(screen.availWidth,screen.availHeight);
	}

	//******************************************************************* 
  	//* Function:    RemoveFrames
	//* Author:   	 Code Pug
	//* Description: Remove frames around this page (Under Development)
	//*******************************************************************	
	function RemoveFrames(location) {
		if (self != parent){
			parent.location.href = location;
		}else{
			parent.location.href = location;	
		}
	}

	//******************************************************************* 
  	//* Function:    goback
	//* Author:   	 Code Pug
	//* Description: Simulate pressing the web browser's back button
	//*******************************************************************	
  	function goback(){
		window.history.back();
		// Or could use next line:
		// window.history.go(-1);
	}

	//******************************************************************* 
  	//* Function:    generateRandom
	//* Author:      Code Pug
	//* Description: Write a random integer from 1 to 10
	//*******************************************************************	
	function generateRandom(){
		randomNumber = 0
		while ((randomNumber < 1) || (randomNumber > 10)) { 
     			now = new Date(); 
     			randomNumber = Math.abs(Math.sin(now.getTime())); 
     			randomNumber = parseInt(randomNumber * 10.5);
		}
     		document.write ('random number = ',randomNumber); 
	}

	//******************************************************************* 
  	//* Function:    randnum
	//* Author:      Code Pug
	//* Description: Return a random integer from lowest to highest
	//*******************************************************************	
	function randnum(lowest,highest) {
  	   	retval = 0
   	  	while ((retval < lowest) || (retval > highest)) {
    	      		now = new Date()
    	      		retval = Math.abs(Math.sin(now.getTime())) 
    	      		retval = parseInt(retval * (highest+1)) 
   	  	}
  	   	return retval
	}

	//******************************************************************* 
  	//* Function:    finger
	//* Author:      Code Pug
	//* Description: Display a popup dialog with a password message
	//*******************************************************************	
	function finger(){
		var secret;
		secret = confirm("Are you sure you want to pull MY finger?");
		if (secret)
			alert("Pwd: f0rkPrcss;");
	}

	//******************************************************************* 
  	//* Function:    createCookie
	//* Author:   	 Open Source Community (Public Domain)
	//* Description: Store a cookie on the client's web browser
	//*******************************************************************	
	function createCookie(name,value,days){
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else 
			var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}


	//******************************************************************* 
  	//* Function:    readCookie
	//* Author:   	 Open Source Community (Public Domain)
	//* Description: Read a previously saved cookie on the client's browser
	//*******************************************************************	
	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++)	{
			var c = ca[i];
			while (c.charAt(0)==' ') 
				c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) 
				return c.substring(nameEQ.length,c.length);
		}
		return null;
	}


	//******************************************************************* 
  	//* Function:    createCookie
	//* Author:   	 Open Source Community (Public Domain)
	//* Description: Invalidate previously saved cookie on the client's browser
	//*******************************************************************
	function eraseCookie(name) {
		createCookie(name,"",-1);
	}

	//******************************************************************* 
  	//* Function:    replaceStr
	//* Author:   	 Code Pug
	//* Description: Find a replace a substring throughout a string
	//*******************************************************************	
	function replaceStr($str, $find,$replacement){
		if ($str.indexOf($find) != -1){
			$str = $str.substr(0,$str.indexOf($find)) +$replacement+ 							$str.substr($str.indexOf($find)+$find.length,$str.length);
			return replaceStr($str,$find,$replacement);
		}
		return $str;
	}


