var ie = (document.all) ? true : false;
var ns = (document.layers) ? true : false;
var dom = (!document.all && document.getElementById) ? true : false;


//Company
preload('Sempresa_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sempresa_on.gif');
preload('Sempresa_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sempresa_off.gif');
preload('Squienessomos_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Squienessomos_on.gif');
preload('Squienessomos_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Squienessomos_off.gif');
preload('Squehacemos_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Squehacemos_on.gif');
preload('Squehacemos_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Squehacemos_off.gif');
preload('Smision_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Smision_on.gif');
preload('Smision_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Smision_off.gif');
preload('Scultura_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Scultura_on.gif');
preload('Scultura_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Scultura_off.gif');
preload('Scontactenos_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Scontactenos_on.gif');
preload('Scontactenos_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Scontactenos_off.gif');
preload('contact_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/contact_on.gif');
preload('contact_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/contact_off.gif');

//Services
preload('Sservicios_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sservicios_on.gif');
preload('Sservicios_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sservicios_off.gif');
preload('Scompra_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Scompra_on.gif');
preload('Scompra_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Scompra_off.gif');
preload('Sexportaciones_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sexportaciones_on.gif');
preload('Sexportaciones_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sexportaciones_off.gif');
preload('enterprise_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/enterprise_on.gif');
preload('enterprise_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/enterprise_off.gif');
preload('connect_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/connect_on.gif');
preload('connect_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/connect_off.gif');

//Afiliations
preload('Safiliaciones_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Safiliaciones_on.gif');
preload('Safiliaciones_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Safiliaciones_off.gif');
preload('Sdistribuidores_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sdistribuidores_on.gif');
preload('Sdistribuidores_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sdistribuidores_off.gif');
preload('Svendedores_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Svendedores_on.gif');
preload('Svendedores_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Svendedores_off.gif');
preload('websharing_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/websharing_on.gif');
preload('websharing_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/websharing_off.gif');
preload('zcr_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/zcr_on.gif');     
preload('zcr_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/zcr_off.gif'); 

//Products
preload('Sproductos_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sproductos_on.gif');
preload('Sproductos_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sproductos_off.gif');
preload('Sproductosusados_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sproductosusados_on.gif');
preload('Sproductosusados_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sproductosusados_off.gif');
preload('Sproductosnuevos_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sproductosnuevos_on.gif');
preload('Sproductosnuevos_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Sproductosnuevos_off.gif');

//News
preload('Snoticias_on','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Snoticias_on.gif');
preload('Snoticias_off','file:///C:/Documents and Settings/vlad/My Documents/My Web Sites/LATRUS7/images/nav/Snoticias_off.gif');

function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}
function chgImg(imgField,newImg) {
	if (ns) {eval('document.images[imgField].src = '+newImg+'.src')}
	if (ie) {document[imgField].src = eval(newImg+'.src')}
	if (dom) {document.images[imgField].src = eval(newImg+'.src');}
}

// css menus: http://www.alistapart.com/articles/dropdowns

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("navCompanyMenu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}

		navRoot = document.getElementById("navServicesMenu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}

		navRoot = document.getElementById("navAfiliationsMenu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}

		navRoot = document.getElementById("navProductsMenu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}

		navRoot = document.getElementById("navNewsMenu");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}

	}
}
window.onload=startList;

