	// Global variables

	window.onerror = null;
	
	var _msg	="© 2002-2006, by Uncle Jims Web Designs"
	var is40	=((navigator.appVersion.indexOf('4')!= -1) ? true : false);
	var isJava	=((navigator.javaEnabled() < 1) ? true : false);
	var pagecntr=0;
	var online	=false;
	var flashing=null
	var xArray="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ,.:;!?/\|@#$%^&*()[]{}<>+=-_«»";

	if (is40){
		self.moveTo((screen.Width-600)/2,110)
		self.resizeTo(600,600)
		}

	// Right click menu disable for IE
	function noRClick(){
		if (event.button == 2 | event.button == 3){
       		alert(_msg);
       		if (navigator.appVersion <= "4.0") location.href="http://jdstiles.com/javamain.html"
       }
    }

	// Right click menu disable for Netscape
	function noClick(e){
    	if (e.which == 3 || e.which == 2){
       		alert(_msg);
    		location.href="http://jdstiles.com/javamain.html"
      	}  
    }

	function encode(xString){
		var xStr="";
    	for(var cntr=0; cntr <= xString.length; cntr++){
       		for(var c=0; c <= xArray.length;  c++){
          		if (xArray.substring(c,c+1) == xString.substring(cntr,cntr+1)){
 					v=c+1; 
					xStr=xStr+xArray.substring(v,v+1);
				}
			}
 		}    
		return (xStr);
     }
    

	function decode(xString){
		var xStr="";
		for(var cntr=0; cntr <=xString.length; cntr++){
			for(var c=xArray.length; c >=0;  c--){
				if (xArray.substring(c,c-1) == xString.substring(cntr,cntr+1)){
					v=c-1 
					xStr=xStr+xArray.substring(v,v-1);
				}
			}
		}    
       return (xStr);
      }


	function scramble(xString){
		var y=""
		for (c=0; c<xString.length; c++) y+="&#"+xString.charCodeAt(c)
		return (y)
		}


   function Hexconv(nValue){
	  /* 
        n denotes the given value diveded by (16 hex)
		n_ denotes the remainder of the value divided by (16 hex)

      */
		var aHex = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F']
		var n =nValue/16
	  	var n_=nValue%16
    	n=parseInt(n)

		n= (n  <= 15) ? aHex[n]  : Hexconv(n)
		n_=(n_ <= 15) ? aHex[n_] : Hexconv(n_)	
		var nhex=n+n_
		return(nhex) 
      }

	function expand(xURL,xWidth,xHeight){
		if (is40){
     		pop=window.open("","",
				"toolbar=no,menubar=no,scrollbars=yes,status=yes,width=100,height=100,dependent=yes")
			pop.moveTo((screen.Width-600)/2,110)
			xWidth=((xWidth <=101) ? screen.availWidth : xWidth);
			xHeight=((xHeight <=101) ? screen.availHeight : xHeight);
			for (var cntr=1; cntr<=xWidth; cntr=cntr+7 ){
				w=100+(cntr)
				h=100+(cntr)
				if (w >= xWidth) w=xWidth;
				if (h >= xHeight) h=xHeight;
				pop.resizeTo(w,h)
			}
			pop.resizeTo(xWidth,xHeight)
			pop.location.href=xURL
		}
		else
			WinOpener("xURL",xWidth,xHeight,0,0,1,0,1,0)				
	}



	// Popup function for page linking 
	function go(xURL,nOption){
    	var xpage='page'+pagecntr++
		if (nOption == 0)
			xpage=window.open(xURL,"",
			"scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no,width=600,height=400");

		if (nOption == 1)
			xpage=window.open(xURL,"",
		"scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes,resizeable=yes,width=600,height=400");

		if (nOption == 2)
			xpage=window.open(xURL,"","scrollbars=yes, toolbar=yes, menubar=yes, location=yes,width=600,height=400");
     }


	function Greeting(){
    	var today = new Date();
    	var nhour = today.getHours();
    	if (nhour < 12){
			mMsg="Top of the mourning to ya!";}
		else if (nhour < 18){
			mMsg="Boy! am I glad you could make it.";}
    	else if (nhour <24){
			mMsg="I'm very happy your here.";}
    	else {
         	mMsg="Good night!  How was your day?";} 
    return (mMsg)
    }


	function Showdate(nOption){
		/* Displays 23 different date styles format options*/

		var today = new Date();
		var xyear = today.getYear().toString()
		var zday = (today.getDate() <= 9) ? "0"+today.getDate() : today.getDate() 
		var zmonth = ((today.getMonth()+1) <= 9) ? "0"+(today.getMonth()+1) : today.getMonth()+1 

		var Day = new Array();	Day  =["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
		var xday  =Day[today.getDay()]

		var Month= new Array()
	Month=["January","February","March","April","May","June","July","August","September","October","November","December"];
 		var xmonth=Month[today.getMonth()]

		var xStyle=new Array()
		xStyle[1]=(xday+", "+xmonth+" "+today.getDate()+" "+today.getYear());
		xStyle[2]=(xday+", "+xmonth.substring(0,3)+" "+today.getDate()+", "+today.getYear());
		xStyle[3]=(xday.substring(0,3)+", "+xmonth+" "+today.getDate()+", "+today.getYear());
		xStyle[4]=(xday.substring(0,3)+", "+xmonth.substring(0,3)+" "+today.getDate()+", "+today.getYear());
		xStyle[5]=(xday.substring(0,3)+" "+xmonth.substring(0,3)+" "+today.getDate()+", "+today.getYear());
		xStyle[6]=(xmonth+" "+today.getDate()+", "+today.getYear());
		xStyle[7]=(xmonth+"."+today.getDate()+"."+today.getYear());
		xStyle[8]=(today.getDate()+" "+xmonth+", "+today.getYear());
		xStyle[9]=(today.getDate()+" "+xmonth+" "+today.getYear());
		xStyle[10]=(xmonth.substring(0,3)+"-"+today.getDate()+"-"+today.getYear());
		xStyle[11]=(today.getDate()+"-"+xmonth.substring(0,3)+"-"+today.getYear());
		xStyle[12]=(xmonth.substring(0,3)+" "+today.getDate()+", "+today.getYear());
		xStyle[13]=((today.getMonth()+1)+'/'+today.getDate()+'/'+today.getYear());
		xStyle[14]=(today.getDate()+'/'+(today.getMonth()+1)+'/'+today.getYear());
		xStyle[15]=(zday+'/'+zmonth+'/'+today.getYear());
		xStyle[16]=(zmonth+'/'+zday+'/'+today.getYear());
		xStyle[17]=((today.getMonth()+1)+'.'+today.getDate()+'.'+today.getYear());
		xStyle[18]=(today.getDate()+'/'+(today.getMonth()+1)+'/'+xyear.substring(2,4));
		xStyle[19]=((today.getMonth()+1)+'/'+today.getDate()+'/'+xyear.substring(2,4));
		xStyle[20]=(zday+'/'+zmonth+'/'+xyear.substring(2,4));
		xStyle[21]=(zmonth+'/'+zday+'/'+xyear.substring(2,4));
		xStyle[22]=(today.getDate()+'.'+(today.getMonth()+1)+'.'+xyear.substring(2,4));
		xStyle[23]=((today.getMonth()+1)+'.'+today.getDate()+'.'+xyear.substring(2,4));
		return (xStyle[nOption])
		}


	function Showtime(){
		var today = new Date();
	    var mTime = ((today.getHours() > 12) ? "p.m." : "a.m.")
		var nhour=((today.getHours() > 12) ? (today.getHours()-12) : today.getHours());
    	var nMins=((today.getMinutes() < 10) ? "0"+today.getMinutes() : today.getMinutes())
	    return(nhour.toString()+':'+nMins.toString()+" "+mTime);
    }

	function implode(closeit){
		if (is40){
			var xWidth=screen.availWidth;
			var xHeight=screen.availHeight
		 	for (var cntr=1; cntr<=xWidth; cntr=cntr+7 ){
				var w=xWidth-(cntr)
				var h=xHeight-(cntr)

				if (w <= 100) w=100;
				if (h <= 100) h=100;
        		self.resizeTo(w,h)
				if (closeit && w==100) self.close();
			}
			self.resizeTo(100,100)
		}
	}


	function explode(){
		if (is40){
			self.moveTo(0,0)
			var xWidth=screen.availWidth;
			var xHeight=screen.availHeight
			for (var cntr=1; cntr<=xWidth; cntr=cntr+7 ){
				var w=100+(cntr)
				var h=100+(cntr)
				if (w >= xWidth) w=xWidth;
				if (h >= xHeight) h=xHeight;
				self.resizeTo(w,h)
				}
		self.resizeTo(xWidth,xHeight)
		}
	} 


	function  WinOpener(xUrl,xWidth,xHeight,isMenu,isTools,isStatus,isLocation,isScroll,isHistory){
		// set the default values if parameters are left blank.
		xWidth		=(xWidth == 0)		 ? screen.availWidth  : xWidth;
		xHeight		=(xHeight == 0)		 ? screen.availHeight : xHeight;
		isMenu		=(isMenu == true)	 ? "yes" : "no";
		isTools		=(isTools == true)	 ? "yes" : "no";
		isStatus	=(isStatus == true)	 ? "yes" : "no";
		isLocation	=(isLocation == true)? "yes" : "no";
		isScroll	=(isScroll == true)	 ? "yes" : "no";
		isHistory	=(isHistory == true) ? "yes" : "no";

		window.open(xUrl,"","menubar="+isMenu+",toolbar="+isTools+",status="+isStatus+",location="+isLocation+",scrollbars="+isScroll+",copyhistory="+isHistory+",width="+xWidth+",height="+xHeight)
	}

	function imgdisp(sImage){
		var aImg = new Image();aImg.src=sImage;
		var w=aImg.width+20; h=aImg.height+10;
		var x=(screen.width-w)/2; y=(screen.height-h)/2
		var popup=window.open("","imgdisp","menubar=yes,width="+w+", height="+h)
		popup.moveTo(x,y)
		d=popup.document;
		d.bgcolor="background"
		d.fgcolor="#000000"
		d.write('<center><img name="img" src="" alt="" border=0><center>');
		d.images["img"].src=aImg.src
	/*	d.write('<script language="javascript">');
		d.write('setTimeout(');  
		d.write('"self.close()');
		d.write(';",30000)'); 
		d.write('</');
		d.write('script>');
	*/
		} 

	function prnpage(){
		var psw = prompt("Enter password:","")
		var mypsw=decode("qsjouju")
		if (psw == mypsw)
			 self.print()
		else
			alert('SORRY! you must have authorization')
	}	
 

	function flash(){
		var rr=parseInt(Math.random()*255)
		var gg=parseInt(Math.random()*255)
		var bb=parseInt(Math.random()*255)
		var xColor='#'+Hexconv(rr)+Hexconv(gg)+Hexconv(bb)
		document.bgColor=xColor
		flashing=setTimeout("flash()",400);
		}

	function makevisible(cur,which){
		if (which==0)
			cur.filters.alpha.opacity=100
		else
			cur.filters.alpha.opacity=15
		}


	function Linkto(form){
		var choice = form.url.options[form.url.selectedIndex].value
		if ( choice != "x") 
			WinOpener(choice,600,400,1,1,1,1,1,1)
		}

	function footer(){
		document.write('<span class="footer" id="legal">© 2002-2006, by ')
		document.write('<a href="http://jdstiles.com"')
		document.write('title="Contact the Designer" onMouseOver="window.status=')
		document.write("'Visit Uncle Jims Web Designs on the web'; return true")
		document.write('" onMouseOut="window.status=_msg; return true">')
		document.write('<span class="footer" id="legal">Uncle Jims Web Designs</span></a>&nbsp;&nbsp;')
		document.write('Updated: '+document.lastModified+'</span>');
		}


	function notice(){
		menutext.style.left=document.body.scrollLeft+event.clientX
		menutext.style.top=document.body.scrollTop+event.clientY
		menutext.style.visibility="visible"
   		return false
  	}

	function hidenotice(){
		menutext.style.visibility="hidden"
	  }
