// Script: Change style(s)
// Version: 1.0
// Last Updated: 10 March 2008
// Author: Paul Hunt
// -----------------------------------------------------------------------------
// Copyright 2008 CustomSUPPORT www.CustomSUPPORT.com
// Use is permitted only with permission of the author
// No part may be reproduced or distributed without permission of the author
// No modifications are permitted without permission of the author
// License is granted if and only if this entire copyright notice is included
// Email: webmaster@CustomSUPPORT.com
// -----------------------------------------------------------------------------
// functions:
// 		_chkDHTML()							See if browser supports DHTML
// 		_getObj(id)							Return an Object Pointer
// 		_navStyleTD(evnt, id, action)		Set Class of ID on Mouseover/Mouseout and Page Load/Unload
// 		_setClass(id, class)				Set Class of ID
// 		_setDisplay(id, flag)				Set Display of ID
// 		_setTextColor(id, color)			Set Text-Color of ID
// 		_setVis(id, flag)					Set Visibility of ID
				
function _chkDHTML() {
 	if (document.getElementById || document.all || !document.layers) {
		return true;
  		}
	else {
		return false;
  		}
	}

function _getObj(id) {
 	if (document.getElementById) {
		o = document.getElementById(id);
  		}
	else if (document.all) {
		o = document.all[id];
		}
	else if (document.layers) {
		o = document.layers[id];
		}
	return o;
	}
	
function _navStyle(id, action) {
	var e = _getObj(id);
	if (action == "load") {
		e.className = "active";
		}
	if (action == "unload") {
		e.className = "link";
		}
	}

function _navStyleTD(evnt) {
	if (!evnt) var evnt = window.event ;
	if (evnt.target) var tg = evnt.target ;
	else if (evnt.srcElement) var tg = evnt.srcElement ;
	while (tg.nodeName != 'TD') { // Safari GRRRRRRRRRR
		tg = tg.parentNode;
		}
	if (evnt.type == "mouseover" && tg.className == "link") tg.className = "hover" ;
	if (evnt.type == "mouseout" && tg.className != "active") tg.className = "link" ;
	}
			
function _setClass(id, newClass) {
	if (_chkDHTML()) {
		var e = _getObj(id);
			e.className = newClass ;
			e.newClass = newClass ;
		}
	}	
		
function _setDisplay(id, flag) {
	if (_chkDHTML()) {
		var o = _getObj(id);
		o.style.display = (flag) ? 'inline' : 'none' ;
		}
	}	
	
function _setTextColor(id, color) {
	if (_chkDHTML()) {
		var o = _getObj(id);
		o.style.color = color ;
		}
	}	
		
function _setVis(id, flag) {
	if (_chkDHTML()) {
		var o = _getObj(id);
		o.style.visibility = (flag) ? 'visible' : 'hidden' ;
		}
	}	