var oldSelected = -1;
var oldFont = -1;

// DarkGreen = #006400
// LightGreen = #90ee90
// LightYellow = #ffffe0
// Black = #000000

function mouseover(elmID)
{
	var x = document.getElementById(elmID);

	if (x.className == 'selected')
	{
		return;
	}
	
	x.className = 'rollover';
}

function mouseout(elmID)
{
	var x = document.getElementById(elmID);

	if (x.className == 'selected')
	{
		return;
	}

	x.className = 'normal';
}

function mouseclick(elmID, fontID, aURL, aURLDestination)
{
	var x = document.getElementById(elmID);
	
	if (x.className == 'selected') 
	{
		return;
	}

	if (aURLDestination == 'new')
	{
		window.open(aURL);
		return;
	}

	if (oldSelected != -1)
	{
		var y = document.getElementById(oldSelected);
		
		y.className = 'normal';
		
		y = document.getElementById(oldFont);
		y.className = 'menuitem';
				
		x.className = 'selected';
		
		x = document.getElementById(fontID);
		x.className = 'menuselect';
		
		oldSelected = elmID;
		oldFont = fontID
	}
	else
	{
		x.className = 'selected';
		
		x = document.getElementById(fontID);
		x.className = 'menuselect';	
		
		oldSelected = elmID;
		oldFont = fontID		
	}
		
	window.parent.main.location.href = aURL;
	
	if (aURL == 'core.html')
	(
	    img = 'images/Contacts_32x32.png'
    )
    else if (aURL == 'ads.html')
	(
    	img = 'images/Advertising_32x32.png'
    )
    else if (aURL == 'books.html')
	(
    	img = 'images/BooksProducts_32x32.png'
    )
    else if (aURL == 'subs.html')
	(
    	img = 'images/Subscription_32x32.png'
    )
    else if (aURL == 'readerenq.html')
	(
    	img = 'images/ReaderEnquiry_32x32.png'
    )
    else if (aURL == 'web.html')
	(
    	img = 'images/Web_32x32.png'
    )
    else
    (    	
	    img = 'images/Taskbar_32x32.png'
	)
	
	if (window.parent.frames(1).contentDocument)
	{
	    window.parent.frames(1).contentDocument.images(0).src = img
	}
	else
	{
    	window.parent.frames(1).document.images(0).src = img
    }
	
}

function imageclick(aURL)
{
	
	window.parent.main.location.href = aURL;

	if (oldSelected != -1)
	{
		var y = document.getElementById(oldSelected);
		
		y.className = 'normal';
		
		y = document.getElementById(oldFont);
		y.className = 'menuitem';
				
		oldSelected = -1;
		oldFont = -1
		
	}
}

function imageover(elmID)
{
	var x = document.getElementById(elmID);
	
	x.className = 'imageover';
}

function imageout(elmID)
{
	var x = document.getElementById(elmID);
	
	x.className = 'imagenormal';
}