// Alt-O-Matic (c) Christian Heilmann
// Version 1.0 
// finished on 19.08.1999
// requires 4.x browser, older browsers will not execute the code
//
// For contact refer to: http://www.onlinetools.org and email me at info@onlinetools.org
// Free of charge with this copyright notice
// Gives you the opportunity to create Alt Message for Textlinks. This may sound bogus in the first place,but
// can save you a lot of space on your page.
//
// USAGE:
// Insert the code as src-link or direct in the html head, 
// Call the init-routine with <BODY onload="initalt()">
// Call the alt-routine via mouseover 
// <a href="" onmouseover="doalt('your message')" onmouseout="realt()">Link</A>
// You can use any html you want as your message, so this could also be used for some 
// Menus...
//
function initalt()
	{
// Variables
								altback="yellow" // Alt-Message background color
								altborder="black"// Alt-Message border color
								altfont="arial"  // Alt-Message Font
                altfontcolor="black"// Alt-Message Font color
								altfontsize="2" // Alt-Message Font Size
								altoffx=5 // Alt-Message horizontal offset from mouse-position
								altoffy=15 // Alt-Message vertical offset from mouse-position
								altwidth=10 // Alt-Message width, will be expanded by your message
								altheight=10 // Alt-Message height, will be expanded by your message
// end of Variables
								document.onmousedown = sniff
                document.onmousemove = sniff
                document.onmouseup = sniff
                if (document.layers) 
								{ //NS
								document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
								document.layers['altmessage'] = new Layer(altwidth)
								document.layers['altmessage'].left = 0
								document.layers['altmessage'].top = 0
								document.layers['altmessage'].height = altheight
								document.layers['altmessage'].bgColor = altback
								document.layers['altmessage'].visibility = "hidden"
								document.layers['altmessage'].borderStyle = "solid"
								document.layers['altmessage'].borderColor = altborder
								document.layers['altmessage'].borderWidth = 1
																}
								else if (document.all)
								{ //IE
								document.body.insertAdjacentHTML("BeforeEnd",'<DIV ID="altmessage" STYLE="z-index:200;position:absolute;width:'+altwidth+';height:'+altheight+';left:0;top:0;visibility:hidden;background:'+altback+';border-style:solid;border-width:1;border-color:'+altborder+'"></DIV>')
								}
	}

function sniff(e) {

// Variables
								altback="yellow" // Alt-Message background color
								altborder="black"// Alt-Message border color
								altfont="arial"  // Alt-Message Font
                altfontcolor="black"// Alt-Message Font color
								altfontsize="2" // Alt-Message Font Size
								altoffx=5 // Alt-Message horizontal offset from mouse-position
								altoffy=15 // Alt-Message vertical offset from mouse-position
								altwidth=10 // Alt-Message width, will be expanded by your message
								altheight=10 // Alt-Message height, will be expanded by your message
// end of Variables
								document.onmousedown = sniff
                document.onmousemove = sniff
                document.onmouseup = sniff
                if (document.layers) 
								{ //NS
								document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
								document.layers['altmessage'] = new Layer(altwidth)
								document.layers['altmessage'].left = 0
								document.layers['altmessage'].top = 0
								document.layers['altmessage'].height = altheight
								document.layers['altmessage'].bgColor = altback
								document.layers['altmessage'].visibility = "hidden"
								document.layers['altmessage'].borderStyle = "solid"
								document.layers['altmessage'].borderColor = altborder
								document.layers['altmessage'].borderWidth = 1
																}
								else if (document.all)
								{ //IE
								document.body.insertAdjacentHTML("BeforeEnd",'<DIV ID="altmessage" STYLE="z-index:200;position:absolute;width:'+altwidth+';height:'+altheight+';left:0;top:0;visibility:hidden;background:'+altback+';border-style:solid;border-width:1;border-color:'+altborder+'"></DIV>')
								}

// GETS Mouseposition
                if (document.layers) {var mousex=e.pageX; var mousey=e.pageY;document.layers['altmessage'].left = mousex+altoffx;document.layers['altmessage'].top = mousey+altoffy}
                else if (document.all) {var mousex=event.x; var mousey=event.y+document.body.scrollTop;altmessage.style.top=mousey+altoffy;altmessage.style.left=mousex+altoffx}
									}
function doalt(message)
{

//The main routine
								content='<font>'+message+'</FONT>'						
								if (document.layers) {
												with (document.layers['altmessage'].document)
                        {
												open()
                        write(content)
                        close()
                				}
												document.layers['altmessage'].visibility = "show"
												}
								else if (document.all) { 
												document.all['altmessage'].innerHTML = content
												document.all['altmessage'].style.visibility = "visible"
												}
}
function realt(){
								if (document.layers)document.layers['altmessage'].visibility = "hidden";
								else if (document.all) document.all['altmessage'].style.visibility = "hidden";
}


