<!-- Begin
//set path string
var here = document.URL;
if (here.match("file://"))
{var path = "file:///D:/wadeware/"}
	else
	{var path = "http://wadeware.com/"}
//
//
var screenwidth = screen.availWidth;
var screenxcenter = screenwidth / 2;
var screenheight= screen.availHeight;
var screenycenter = screenheight / 2;
var imagex = 0;
var mouseon = 0;
var x = screenwidth + 1;
var y = screenheight + 1;
var xi = 0;
var yi = 0;
var l = 0;
var curleft = 0;
var curtop = 0;

var cometsrc = new Array();
cometsrc[1] = "gif/ufo.gif";
cometsrc[2] = "gif/casino.gif";
cometsrc[3] = "gif/space_ship.gif";
cometsrc[4] = "gif/ufo1.gif";
cometsrc[5] = "gif/ufo2.gif";
cometsrc[6] = "gif/ufo3.gif";
cometsrc[7] = "gif/ufo4.gif";
cometsrc[8] = "gif/klingon6.gif";
cometsrc[9] = "gif/klingon5.gif";


// Detect browser and version 
var ua=navigator.userAgent
var version=parseInt(navigator.appVersion)
var browser="unknown"
var browsercompatible="Microsoft"

if (ua.match("Mozilla"))
{
browser="Mozilla";
browsercompatible="Netscape"
}

if (ua.match("SeaMonkey"))
{
browser="Mozilla/Sea Monkey";
browsercompatible="Netscape"
}
if (ua.match("MSIE"))
{
browser="Microsoft Internet Explorer";
browsercompatible="Microsoft"
}
if (ua.match("Avant Browser"))
{
browser="Avant Browser";
browsercompatible="Microsoft"
}
if (ua.match("Opera"))
{
browser="Opera";
browsercompatible="Microsoft"
}
if (ua.match("Netscape"))
{
browser="Netscape";
browsercompatible="Netscape"
}
if (ua.match("Firefox"))
{
browser="Firefox";
browsercompatible="Netscape"
}
// end of browser detect

// Alternate browser check
function whichBrowser() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("webtv") != -1) return 'WebTV';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("seamonkey") != -1) return 'SeaMonkey';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("avant") != -1) return 'Avant';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}
// end of alternate browser check


var divtext=new Array(10)
divtext[1]='Your one stop source for Turn Key web site solutions!'
divtext[7]='Have the proof you need and the peace of mind you deserve.'
divtext[6]='WoW!  Dial up for Only $8.95 per month!'
divtext[9]='Phone numbers, address, e-mails, web forms, ect.'
divtext[0]='Return to the WadeWare.com entrance page.'
divtext[2]='CNC and the Machine Tool Industry.'
divtext[5]='Local and World Weather!'
divtext[4]='North Florida News and Events!'



function dropMenu(menuNo)
{
document.getElementById('div1').innerHTML=divtext[menuNo];
};

function dropMenuoff()
{
document.getElementById('div1').innerHTML=('Diversified Services for North Florida and the World!');
}

// Display clock
var d=new Date()
var weekday=new Array(7)
weekday[0]="Sunday"
weekday[1]="Monday"
weekday[2]="Tuesday"
weekday[3]="Wednesday"
weekday[4]="Thursday"
weekday[5]="Friday"
weekday[6]="Saturday"
var month=new Array(12)
month[0]="January"
month[1]="Febuary"
month[2]="March"
month[3]="April"
month[4]="May"
month[5]="June"
month[6]="July"
month[7]="August"
month[8]="September"
month[9]="October"
month[10]="November"
month[11]="December"
function startTime()
{
var today=new Date()
var h=today.getHours()
var m=today.getMinutes()
var s=today.getSeconds()
var dayname=weekday[d.getDay()]
var monthname=month[today.getMonth()]
var datename=today.getDate()
var yearname=today.getFullYear()
var ampm="AM"
var greeting="Good morning"
if (h>11)
	{greeting="Good afternoon"}
if (h>17)
	{greeting="Good evening"}
if (h>11)
	{ampm="PM"}
if (h>12)
	{h-=12}
if (h==0)
	{h=12}
h=checkTime(h)
m=checkTime(m)
document.getElementById('clock').innerHTML=(greeting + " it&#39;s " +  dayname + " " + monthname + " " + datename +  ", " + yearname + " - " + h + ":" + m + " " + ampm)
t=setTimeout('startTime()',50)
}
function checkTime(i)
{
if (i<10) 
  {i="0" + i}
  return i
}

function startExactTime()
{
var today=new Date()
var h=today.getHours()
var m=today.getMinutes()
var s=today.getSeconds()
var dayname=weekday[d.getDay()]
var monthname=month[today.getMonth()]
var datename=today.getDate()
var yearname=today.getFullYear()
var ampm="AM"
var greeting="Good morning"
if (h>11)
	{greeting="Good afternoon"}
if (h>17)
	{greeting="Good evening"}
if (h>11)
	{ampm="PM"}
if (h>12)
	{h-=12}
if (h==0)
	{h=12}
h=checkTime(h)
m=checkTime(m)
s=checkTime(s)
document.getElementById('clock').innerHTML=(greeting + " it&#39;s " +  dayname + " " + monthname + " " + datename +  ", " + yearname + " - " + h + ":" + m + ":" + s + " " + ampm)
t=setTimeout('startExactTime()',50)
}

// end of clock

// start off midi player

var midi = new Array()
midi[0] = "Player_Off.mid";
midi[1] = "Grab_bag.mid";
midi[2] = "In_Hiding.mid";
midi[3] = "Taking_Names.mid";
midi[4] = "Nmoes1.mid";
midi[5] = "PhantasyStar4.mid";
midi[6] = "mymidi4.mid";
midi[7] = "Plasma.mid";
midi[8] = "Water_World.mid";
midi[9] = "Decent006.mid";
midi[10] = "retro2000.mid";
midi[11] = "bounces.mid";
midi[12] = "pianoflute.mid";
midi[13] = "Stalker.mid";
midi[14] = "taker2.mid";
midi[15] = "KillerInstinct.mid";
midi[16] = "intro.mp3";

//

function playerOff()
{
document.getElementById('midiplayer').innerHTML=("<embed  align='center' src='http://wadeware.com/midi/top_midi/" + midi[0] + "'hidden=true autostart=false volume=0%>");
document.getElementById('nowplaying').innerHTML=("<br />Player Stopped");
}

function playerOn()
{
i = parseInt((Math.random()*15)+1);
document.getElementById('midiplayer').innerHTML=("<embed  align='center' src='http://wadeware.com/midi/top_midi/" + midi[i] + "'hidden=true autostart=true volume=60%>");
document.getElementById('nowplaying').innerHTML=("Now Playing #" + i + "<br />" + midi[i]);
}

function playMidi(form,i)
{
document.getElementById('midiplayer').innerHTML=("<embed  align='center' src='http://wadeware.com/midi/top_midi/" + midi[i] + "'hidden=true autostart=true volume=60%>");
document.getElementById('nowplaying').innerHTML=("Now Playing #" + i + "<br />" + midi[i]);
}
function playerInit(i)
{
document.getElementById('midiplayer').innerHTML=("<embed  align='center' src='http://wadeware.com/midi/top_midi/" + midi[i] + "'hidden=true autostart=true volume=60%>");
document.getElementById('nowplaying').innerHTML=("Now Playing #" + i + "<br />" + midi[i]);
}
// end of midi player

function open_win(url, wwidth, wheight, wtop, wleft, resize)
{
playerOff();
if (resize)
{
window.open(url,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=" + wwidth +", height=" + wheight + ", top=" + wtop + ",left=" + wleft)
}
else
{
window.open(url,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=" + wwidth +", height=" + wheight + ", top=" + wtop + ",left=" + wleft)
}
}

// grows image
function growImage(iwidth)
{
imagex++
document.animimage.width = parseInt(imagex);
changeOpac(imagex*(100/imagex), 'animimage')
if (imagex > iwidth){
ztimer = setTimeout()
}
x=iwidth
ztimer=setTimeout('growImage(x)',50)
}

function imageOff()
{
document.animimage.width = (0)
}

function imageOn()
{
document.animimage.width = (80)
}

// bounces on screen boundry
function floatImage()
{
if (x <= 0)
{
xi = 1;
x=0
}

if (x > screenwidth)
{
xi = -1;
x=screenwidth
}

if (y <= 0)
{
yi = 1;
y=0
}

if (y > screenheight)
{
yi = -1;
y=screenheight
}

x = x + xi;
y = y + yi;
document.animimage.width = parseInt(y*.175);
document.animimage.style.left = parseInt(x);
document.animimage.style.top = parseInt(y);
//window.status= x +", " + y + ", " + xi + ", " + yi;
ztimer=setTimeout('floatImage()',50)
}

// streak obeject across screen
function doComet()
{
	if (browser == "Microsoft Internet Explorer")
	{
x = x + xi;
y++;

if (y > screenheight-75 || x > screenwidth-75)
{
randomNumber(9);
imageno=l
document.animimage.src = cometsrc[l];
randomNumber(screenwidth);
x=l;
randomNumber(10);
xi = l / 10;

if (x > [screenwidth / 2])
{xi = -xi};
y=0;
}
x = x + xi;
y = y + 1

document.animimage.style.visibility = "visible";
document.animimage.width = parseInt(y*.175);
document.animimage.style.left = parseInt(x);
document.animimage.style.top = parseInt(y);
comettimer=setTimeout('doComet()',30);
	}
}


function randomNumber(i)
{
l = parseInt((Math.random()*i)+1);
return l
}



function findPos(obj) {
	curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}

	
	//return [curleft, curtop];
	

}

// Image opacity

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 

function shiftOpacity(id, millisec) {
    //if an element is invisible, make it visible, else make it ivisible
    if(document.getElementById(id).style.opacity == 0) {
        opacity(id, 0, 99, millisec);
    } else {
        opacity(id, 99, 0, millisec);
    }
} 

function blendimage(divid, imageid, imagefile, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;
    
    //set the current image as background
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
    
    //make image transparent
    changeOpac(0, imageid);
    
    //make new image
    document.getElementById(imageid).src = imagefile;

    //fade in image
    for(i = 0; i <= 99; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
}

function currentOpac(id, opacEnd, millisec) {
    //standard opacity is 100
    var currentOpac = 99;
    
    //if the element has an opacity set, get it
    if(document.getElementById(id).style.opacity < 100) {
        currentOpac = document.getElementById(id).style.opacity * 100;
    }

    //call for the function that changes the opacity
    opacity(id, currentOpac, opacEnd, millisec)
} 


// End image opacity

//pre load images

function loadimgs()
{
if (document.images)
{
var imgary = document.images;
var preimg = new Array(imgary.length);
imgarylength = imgary.length;

for (k=0; k<imgarylength; k++)
	{
preimg[k] = new Image(); 
preimg[k].src=imgary[k].src; 
	}
}
}
//end image pre load


// display browser mode
function displayLoader()
{
document.getElementById('txt').innerHTML=('Browser identified as:<br />' +  browser + ' ver. ' + version +'.0+.<br />Page is running in '+ browsercompatible + ' compatible mode.<br /><br />' + ipstring + '<br />current URL ' + document.URL)
}

// MSagent character
function initMerlin() {
if (browser=="Microsoft Internet Explorer") {
	AgentControl.Connected = true;
	var characterpath = "Merlin.acs";
	var charactername = characterpath.replace(/.acs/,"");
	AgentControl.Characters.Load("merlin", characterpath);
	
	Merlin = AgentControl.Characters.Character("merlin");
	Merlin.MoveTo(135,300);
	Merlin.Show();
	Merlin.speak("Welcome! To WadeWare dot com.");
	document.getElementById('merlintxt').innerHTML=("<a href='javascript: PlayMerlin()'>Click here to learn more about Merlin!</a><br />Note: If your using Windows XP and can not hear Merlin speak you may need the SAPI 4.0 Text to Speach engine from Microsoft. <a href='http://download.microsoft.com/download/speechSDK/Install/4.0a/WIN98/EN-US/spchapi.EXE'>Click here to get it.</a>");
}
else {
document.getElementById('merlintxt').innerHTML=("We have detected that you are using a browsers that is not IE compatible. Although we work hard to maintain compatibility between various browsers you are missing many of the best features of this site. We suggest you try visiting the site using Microsoft Internet Explorer version 4.0 or higher.");
}
}

function PlayMerlin() {

	
	
	Merlin.Show();
	//Merlin.speak(navigator.userAgent);
	//Merlin.Play("Surprised");
	Merlin.speak("Hello!!!!");

	Merlin.Play("Wave");
		
	Merlin.Play ("GetAttention");
	Merlin.Play ("GetAttentionContinued");
	Merlin.speak("My name is Merlin. I am one of the Microsoft Agent characters that are already installed on your computer.");
	Merlin.play("GetAttentionReturn");
	Merlin.speak("If you can not hear me speak. You may need to download. And install the sapi 4.0 text to speach engine from Microsoft.");
	Merlin.Play("Search");
	Merlin.MoveTo(500,300);
	
	Merlin.speak("The webmaster at Wade Ware has incorporated me into the web page to make the site more informative and user friendly.");
	Merlin.MoveTo(500,200);
	Merlin.Play("Announce");
	Merlin.speak("I can do many things. Like help you navigate the web site, give you help and instructions or emphasize special topics.");  	
	Merlin.speak("I can even do magic!!!!!!");
	Merlin.Play("Congratulate");
	Merlin.Play("DoMagic1");
	Merlin.Play("DoMagic2");
	Merlin.Hide();
	Merlin.MoveTo(150,200);
	Merlin.Show();
	Merlin.Play("Explain");
	Merlin.Speak("As you can see! I am very versatile. And I can be adapted to any web site.");
	Merlin.Play("Sad");
	Merlin.speak("Currently however. I am only available for Microsoft Internet Explorer users.");
	Merlin.Play("Alert");
	Merlin.speak("But were working on that.");
	Merlin.MoveTo(135,300);
	
	Merlin.Play("Pleased");
	Merlin.speak("Thank you for visiting the site. We hope you'll come back often.");
	Merlin.Play("Think");
	Merlin.speak("If you need me. I'll be waiting!");
	
	//Merlin.Hide();
	
	}

function MerlinHelp0() {
	if (mouseon == 0){
	mouseon = 1;
	Merlin.Play("GestureLeft");
	Merlin.speak("Try the new Midi player. Select one of the 15 tracks or click the play random button.");
xtimer = setTimeout('mouseon = 0', 5000);
}
}


function MerlinHelp1() {
	if (mouseon == 0){
	mouseon = 1;
	Merlin.Play("Suggest");
	Merlin.speak("Wade Ware is your one stop source for turn key web site solutions.");
xtimer = setTimeout('mouseon = 0', 5000);
}
}

function MerlinHelp2() {
	if (mouseon == 0){
	mouseon = 1;
	Merlin.Play("Surprised");
	Merlin.speak("Dial up service only $8 and  95 cents per month!");
xtimer = setTimeout('mouseon = 0', 5000);
}
}

function MerlinHelp3() {
	if (mouseon == 0){
	mouseon = 1;
	Merlin.Play("GestureRight");
	Merlin.speak("Click here for information on CNC programming and the machine tool industry.");
xtimer = setTimeout('mouseon = 0', 5000);
}
}

function MerlinHelp4() {
	if (mouseon == 0){
	mouseon = 1;
	Merlin.Play("Pleased");
	Merlin.speak("Contact us today! We'll be glad to hear from you.");
xtimer = setTimeout('mouseon = 0', 5000);
}
}

function MerlinHelp5() {
	if (mouseon == 0){
	mouseon = 1;
	Merlin.Play("Explain");
	Merlin.speak("Return to the Wade Ware dot com home page.");
xtimer = setTimeout('mouseon = 0', 5000);
}
}
// End of Merlin



//  End -->


