// Copyright 2001 AdTCreative. All rights reserved.
// JavaScript Document.

function adt_menuSwap(imageName) { //v 1.51
	
	//This function changes the menu images and the display of sub menus
	//array for the sub menu names
	arrMenus = new Array('whatsNew','','','autoYokeSub','','efxPlus','dryIce','','','','lightAcc','movingLightAcc','','','','','','catalog','','','SHODMXSUB');
	//array for the image names
	arrImages = new Array('wNewImg','WDSImg','kineticsImg','autoYokeImg','VSFX3Img','efxPlusImg','dryIceImg','lightwrightImg','VectorWorksImg','breakawaysImg','lightAccImg','movLightAccImg','candleLiteImg','tapesImg','customImg','techbulletinsImg','dealersImg','reqCatImg','jobs','contactCityTImg','SHODMX');
	//array for the images on url
	arrImagesURLOn = new Array('menu-whatsNew-on.gif','menu-wds-on.gif','menu-kinetics-on.gif','menu-autoYoke-on.gif','VSFX3Red.gif','menu-efxPlus-on.gif','menu-dryIceFog-on.gif','menu-lightwright5-on.gif','vectorworksspotlightred.gif','menu-breakaways-on.gif','menu-lightingAcc-on.gif','menu-movLightingAcc-on.gif','menu-candleLiteUnlimited-on.gif','menu-tapes-on.gif','custom-on.gif','techbulletins-on.gif','menu-ctiDealers-on.gif','menu-requestCatalog-on.gif','jobs-on.gif','menu-contactCityT-on.gif','menu-SHoWDMX-on.png');
	//array for the images off url
	arrImagesURLOff = new Array('menu-whatsNew-off.gif','menu-wds-off.gif','menu-kinetics-off.gif','menu-autoYoke-off.gif','VSFX3Blue.gif','menu-efxPlus-off.gif','menu-dryIceFog-off.gif','menu-lightwright5-off.gif','vectorworksspotlightblue.gif','menu-breakaways-off.gif','menu-lightingAcc-off.gif','menu-movLightingAcc-off.gif','menu-candleLiteUnlimited-off.gif','menu-tapes-off.gif','custom-off.gif','techbulletins-off.gif','menu-ctiDealers-off.gif','menu-requestCatalog-off.gif','jobs-off.gif','menu-contactCityT-off.gif','menu-SHoWDMX-off.png');
	//array for the link URLs
	arrLinkURL = new Array('whatsnew.htm','wds_info.htm','ck.htm','rcyoke.htm','VSFX3.htm','efx.htm','fog3300.htm','lightwright.html','VWSpotlight.htm','breakaways.htm','act-mlh.htm','mla_avl.htm','ga_1_info.htm','bt_1_info.htm','custom.htm','techbulletins.htm','dealers.htm','','jobs.htm','contact_cityt.htm','ShowDMX1.htm');
	var i=0;
	//loop to handle the image and menu changes
	do {
		objMenu=arrMenus[i];
		objImg=arrImages[i];
		objImgOn=arrImagesURLOn[i];
		objImgOff=arrImagesURLOff[i];
		objMenu=arrMenus[i];
		objURL=arrLinkURL[i];
		if(document.layers) {  //Netscape 4
			//THIS FUNCTIONALITY DOES NOT WORK ON NETSCAPE 4
			//USERS WILL BE ASKED TO UPGRADE OR USE ANOTHER BROWSER
			if(objImg == imageName){
				alert('Netscape 4 is not supported, please upgrade or use another browser');
				parent.main.location = 'http://channels.netscape.com/ns/browsers/download.jsp';
			}
		} else if(document.all) {  //Internet Explorer
			if(objImg == imageName) {
				strSource = eval(objImg + ".src");
				intClipStart = strSource.indexOf('images/');
				intClipLength = strSource.length - intClipStart;
				strClippedSource = new String(strSource.substr(intClipStart, intClipLength));
				strOnSource = 'images/menu/' + objImgOn;
				if(strClippedSource == strOnSource && objMenu){
					eval(objImg + ".src = 'images/menu/" + objImgOff + "'");
					if(objMenu){
						eval(objMenu + ".style.display='none'");
					}
					parent.main.location = 'home.htm';
				} else {
					eval(objImg + ".src = 'images/menu/" + objImgOn + "'");
					if(objMenu){
						eval(objMenu + ".style.display=''");
					}
					if(objURL){
						parent.main.location = objURL;
					} else {
						parent.main.location = 'home.htm';
					}	
				}
			} else {
				eval(objImg + ".src = 'images/menu/" + objImgOff + "'");
				if(objMenu){
					eval(objMenu + ".style.display='none'");
				}
			}
		} else if(document.getElementById) {  //Netscape 6,7 and Mozilla
			if(objImg == imageName) {
				strSource = document.getElementById(objImg).src;
				intClipStart = strSource.indexOf('images/');
				intClipLength = strSource.length - intClipStart;
				strClippedSource = new String(strSource.substr(intClipStart, intClipLength));
				strOnSource = 'images/menu/' + objImgOn;
				if(strClippedSource == strOnSource && objMenu){
					document.getElementById(objImg).src = 'images/menu/' + objImgOff;
					if(objMenu){
						document.getElementById(objMenu).style.display='none';
					}
					parent.main.location = 'home.htm';
				} else {
					document.getElementById(objImg).src = 'images/menu/' + objImgOn;
					if(objMenu){
						document.getElementById(objMenu).style.display='';
					}
					if(objURL){
						parent.main.location = objURL;
					} else {
						parent.main.location = 'home.htm';
					}	
				}
			} else {
				document.getElementById(objImg).src = 'images/menu/' + objImgOff;
				if(objMenu){
					document.getElementById(objMenu).style.display='none';
				}
			}
		}
		i+=1;
	} while(i<22);
}