// Title: Menu Iterno
// Description:
// URL:
// Version: 1.0
// Date: 22-11-2004 (mm-dd-yyyy)
// Tech. Support:
// Notes:
// --------------------------------------------------------------------------------
function MouseOverMenu(id) {
var str = "" + id;
if (str.substring(0, 1) != "p") {
//document.getElementById("parent_" + id + "a").className="a_hover";
document.getElementById("parent_" + id).className="MenuOver";
} else {
document.getElementById(id + "a").className="a_hover";
document.getElementById(id).className="MenuOver";
}
}
// --------------------------------------------------------------------------------
function MouseOverSubMenu(id) {
var str = "" + id;
if (str.substring(0, 1) != "c") {
document.getElementById("childs_" + id + "a").className="a_hover_submenu";
document.getElementById("childs_" + id).className="Sub_Seccion_li_Over";
} else {
document.getElementById(id + "a").className="a_hover_submenu";
document.getElementById(id).className="Sub_Seccion_li_Over";
}
}
// --------------------------------------------------------------------------------
function MouseOutSubMenu(id){
var str = "" + id;
if (str.substring(0, 1) != "c") {
document.getElementById("childs_" + id + "a").className="a_submenu";
document.getElementById("childs_" + id).className="Sub_Seccion_li";
} else {
document.getElementById(id+"a").className="a_submenu";
document.getElementById(id).className="Sub_Seccion_li";
}
}
// --------------------------------------------------------------------------------
function MouseOutMenu(id){
var str = "" + id;
if (str.substring(0, 1) != "p") {
//document.getElementById("parent_" + id + "a").className="a";
document.getElementById("parent_" + id).className="Menu";
} else {
document.getElementById(id+"a").className="a";
document.getElementById(id).className="Menu";
}
}
// --------------------------------------------------------------------------------
function MM_clearTimeoutChange() {
if (mmShowMenuTimer) {
clearTimeout(mmShowMenuTimer);
}
mmShowMenuTimer = null;
mmDSFlag = false;
}
function MM_startTimeChange(valor) {
//alert(valor);
//if( window.ActiveMenu ) {
mmStart = new Date();
mmDSFlag = true;
mmShowMenuTimer = setTimeout("mmDoShow(" + valor + ")", hideTimeout);
//}
}
function mmDoShow(valor) {
//if (!mmDHFlag || !window.ActiveMenu) return;
if (!mmDSFlag) {
return;
}
var elapsed = new Date() - mmStart;
//alert(elapsed);
var timeout = hideTimeout;
//alert(timeout);
if (elapsed < timeout) {
mmShowMenuTimer = setTimeout("mmDoShow(" + valor + ")", timeout + 100 - elapsed);
return;
}
mmDSFlag = false;
ChangeProp(valor, false);
//window.ActiveMenuItem = 0;
}
// --------------------------------------------------------------------------------
function MM_clearTimeout() {
if (mmHideMenuTimer) {
clearTimeout(mmHideMenuTimer);
}
mmHideMenuTimer = null;
mmDHFlag = false;
}
function MM_startTimeout(valor) {
//alert(valor);
//if( window.ActiveMenu ) {
mmStart = new Date();
mmDHFlag = true;
mmHideMenuTimer = setTimeout("mmDoHide(" + valor + ")", hideTimeout);
//}
}
function mmDoHide(valor) {
//if (!mmDHFlag || !window.ActiveMenu) return;
if (!mmDHFlag) {
return;
}
var elapsed = new Date() - mmStart;
var timeout = hideTimeout;
if (elapsed < timeout) {
mmHideMenuTimer = setTimeout("mmDoHide(" + valor + ")", timeout + 100 - elapsed);
return;
}
mmDHFlag = false;
ChangeProp(valor, true);
//window.ActiveMenuItem = 0;
}
// --------------------------------------------------------------------------------
function ChangeProp(valor, bol_timer){
var identificador;
var identificador = new Array();
//alert('val ' + valor);
for (i = 0; i < aitems_global.length; i++) {
//alert(i);
identificador[i] = document.getElementById("childs_" + aitems_global[i])
//alert(identificador[i]);
}
for (j = 0; j < identificador.length; j++) {
if (identificador[j] != null) {
//alert('id ' + identificador[j].style.display + ' j ' + j + ' val ' + valor + ' aitems_global[j] ' + aitems_global[j]);
if (aitems_global[j] == valor /*&& identificador[j].style.display == 'none'*/) {
if (bol_timer) {
identificador[j].style.display = 'none';
} else {
identificador[j].style.display = 'block';
}
} else {
identificador[j].style.display = 'none';
}
}
}
}
// --------------------------------------------------------------------------------
function menu_int_onclick (n_id) {
// don't go anywhere if item has no link defined
return Boolean(this.a_index[n_id].a_config[1]);
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
// global collection containing all menus on current page
var A_MENUS_INT = [];
var aitems_global = new Array();
// --------------------------------------------------------------------------------
// menu class
function menu_int (a_items, timeOut) {
// browser check
if (!document.body || !document.body.style)
return;
// store items structure
this.a_config = a_items;
// get menu id
this.n_id = A_MENUS_INT.length;
// declare collections
this.a_index = [];
this.a_children = [];
this.o_root = this;
this.n_depth = -1;
// Time Out for hide childs items
hideTimeout = timeOut;
mmHideMenuTimer = null;
mmShowMenuTimer = null;
// init items recursively
document.write('
');
//Make header graphic
document.write (
''
+ ' | '
+ ' '
);
document.write (
'');
//Make footer graphic
document.write (
''
+ ' | '
+ ' '
);
document.write(' |
');
// register self in global collection
A_MENUS_INT[this.n_id] = this;
// make root level no visible
for (var n_order = 0; n_order < this.a_children.length; n_order++) {
//this.a_children[n_order].e_oelement.style.visibility = 'hidden';
}
}
// --------------------------------------------------------------------------------
// menu item Class
function menu_int_item (o_parent, n_order) {
// store parameters passed to the constructor
this.n_depth = o_parent.n_depth + 1;
this.a_config = o_parent.a_config[n_order + (this.n_depth ? 3 : 0)];
// return if required parameters are missing
if (!this.a_config) return;
// store info from parent item
this.o_root = o_parent.o_root;
this.o_parent = o_parent;
this.n_order = n_order;
// register in global and parent's collections
this.n_id = this.o_root.a_index.length;
this.o_root.a_index[this.n_id] = this;
o_parent.a_children[n_order] = this;
// calculate item's coordinates
var o_root = this.o_root;
// generate item's HMTL
if (o_parent.n_id == 0) {
this.id_child = this.n_id;
} else {
this.id_child = o_parent.n_id + '' + this.n_id;
}
document.write (
' '
);
this.b_visible = !this.n_depth;
// no more initialization if leaf
if (this.a_config.length < 4)
return;
// node specific methods and properties
this.a_children = [];
// init downline recursively
for (var n_order = 0; n_order < this.a_config.length - 3; n_order++) {
new menu_int_item(this, n_order);
}
}
// --------------------------------------------------------------------------------
// menu root Class
function menu_int_parent_item (o_parent, n_order) {
// store parameters passed to the constructor
this.n_depth = o_parent.n_depth + 1;
this.a_config = o_parent.a_config[n_order + (this.n_depth ? 3 : 0)];
// return if required parameters are missing
if (!this.a_config) return;
// store info from parent item
this.o_root = o_parent.o_root;
this.o_parent = o_parent;
this.n_order = n_order;
this.real_parent = o_parent;
// register in global and parent's collections
this.n_id = this.o_root.a_index.length;
aitems_global[n_order] = this.n_id;
//alert('n_order ' + n_order + ' nid ' + this.n_id + ' aitems_global ' + aitems_global[n_order]);
this.o_root.a_index[this.n_id] = this;
o_parent.a_children[n_order] = this;
// calculate item's coordinates
var o_root = this.o_root;
// generate item's HMTL
document.write (
''
);
this.b_visible = !this.n_depth;
// no more initialization if leaf
if (this.a_config.length < 4) {
return;
}
// node specific methods and properties
this.a_children = [];
// generate header item's HMTL for childs
document.write (
''
);
// init downline recursively
for (var n_order_f = 0; n_order_f < this.a_config.length - 3; n_order_f++) {
new menu_int_item(this, n_order_f);
}
// generate footer item's HMTL for childs
document.write (
'
'
);
}
// --------------------------------------------------------------------------------
// that's all folks