
/* define local variables */

URLpath = document.location.href;

engonly = "<img src=\"/lae/t/images/engonly.gif\" width=\"70\" alt=\"English Only\" height=\"20\" border=\"0\">";
imgInSpanish = "<img width=\"74\" src=\"/lae/t/1/1a.gif\" alt=\"En Espa&ntilde;ol\" height=\"20\" border=\"0\">";
imgInEnglish = "<img width=\"70\" src=\"/la/t/es/1/b.gif\" alt=\"In English\" height=\"20\" border=\"0\">";

function writeTag(strLink, strImg) {
	if(strImg == null) strImg = engonly;
	if(strLink != null) {
		document.write('<a href="' + strLink + '">' + strImg + "</a>");
	}
	else {
		document.write( strImg );
	}
}


if( URLpath.search("/lae/") != -1) {

	if( URLpath.search("/powermacg4/") != -1 ) {
		writeTag("/la/hardware/powermacg4/", imgInSpanish);
	}
	else if( URLpath.search("/g5processor/") != -1 ) {
		writeTag("/la/g5/", imgInSpanish);
	}
	else if( URLpath.search("/promo/keynote/") != -1 ) {
		writeTag("/la/promo/keynote/", imgInSpanish);
	}
	else if( URLpath.search("/software/logicexpress/") != -1 ) {
		writeTag("/la/software/", imgInSpanish);
	}
	else if( URLpath.search("/soundtrack/") != -1 ) {
		writeTag("/la/soundtrack/", imgInSpanish);
	}
	else if( URLpath.search("/xserve/raid/") != -1 ) {
		writeTag("/la/xserve/raid/", imgInSpanish);
	}
	else if( URLpath.search("/pro/logic/") != -1 ) {
		writeTag("/la/software/pro/logic/", imgInSpanish);
	}
	else if( URLpath.search("/finalcutexpress/") != -1 ) {
		writeTag("/la/finalcutexpress/", imgInSpanish);
	}
	else if( URLpath.search("/ical/") != -1 ) {
		writeTag("/la/ical/", imgInSpanish);
	}
	else if( URLpath.search("/safari/") != -1 ) {
		writeTag("/la/safari/", imgInSpanish);
	}
	else if( URLpath.search("/keynote/") != -1 ) {
		writeTag("/la/keynote/", imgInSpanish);
	}
	else if( URLpath.search("/g5/") != -1 ) {
		writeTag("/la/g5/", imgInSpanish);
	}
	else if( URLpath.search("/isight/") != -1 ) {
		writeTag("/la/isight/", imgInSpanish);
	}
	else if( URLpath.search("/ichat/") != -1 ) {
		writeTag("/la/ichat/", imgInSpanish);
	}
	else if( URLpath.search("/server/macosx/") != -1 ) {
		writeTag("/la/server/macosx/", imgInSpanish);
	}
	else if( URLpath.search("/server/") != -1 ) {
		writeTag("/la/server/", imgInSpanish);
	}
	else if( URLpath.search("/ilife/") != -1 ) {
		writeTag("/la/ilife/", imgInSpanish);
	}
	else if( URLpath.search("/iphoto/") != -1 ) {
		writeTag("/la/iphoto/", imgInSpanish);
	}
	else if( URLpath.search("/isync/") != -1 ) {
		writeTag("/la/isync/", imgInSpanish);
	}
	else if( URLpath.search("/dvdstudiopro/") != -1 ) {
		writeTag("/la/dvdstudiopro/", imgInSpanish);
	}
	else if( URLpath.search("/remotedesktop/") != -1 ) {
		writeTag("/la/remotedesktop/", imgInSpanish);
	}
	else if( URLpath.search("/emac/") != -1 ) {
		writeTag("/la/emac/", imgInSpanish);
	}
	else if( URLpath.search("/xserve/") != -1 ) {
		writeTag("/la/xserve/", imgInSpanish);
	}
	else if( URLpath.search("/bluetooth/") != -1 ) {
		writeTag("/la/bluetooth/", imgInSpanish);
	}
	else if( URLpath.search("/displays/") != -1 ) {
		writeTag("/la/displays/", imgInSpanish);
	}
	else if( URLpath.search("/appleworks/") != -1 ) {
		writeTag("/la/appleworks/", imgInSpanish);
	}
	else if( URLpath.search("/finalcutpro/") != -1 ) {
		writeTag("/la/finalcutpro/", imgInSpanish);
	}
	else if( URLpath.search("/appleshareip/") != -1 ) {
		writeTag("/la/appleshareip/", imgInSpanish);
	}
	else if( URLpath.search("/idvd/") != -1 ) {
		writeTag("/la/idvd/", imgInSpanish);
	}
	else if( URLpath.search("/imovie/") != -1 ) {
		writeTag("/la/imovie/", imgInSpanish);
	}
	else if( URLpath.search("/mouse/") != -1 ) {
		writeTag("/la/mouse/", imgInSpanish);
	}
	else if( URLpath.search("/keyboard/") != -1 ) {
		writeTag("/la/keyboard/", imgInSpanish);
	}
	else if( URLpath.search("/lae/ibook/") != -1 ) {
		writeTag("/la/ibook/", imgInSpanish);
	}
	else if( URLpath.search("/lae/ipod/") != -1 ) {
		writeTag("/la/ipod/", imgInSpanish);
	}
	else if( URLpath.search("/lae/g5processor/") != -1 ) {
		writeTag("/la/g5/", imgInSpanish);
	}
	else if( URLpath.search("/lae/firewire/") != -1 ) {
		writeTag("/la/firewire/", imgInSpanish);
	}
	else if( URLpath.search("/lae/ipodmini/") != -1 ) {
		writeTag("/ipodmini/", imgInSpanish);
	}
	else if( URLpath.search("/lae/usb/") != -1 ) {
		writeTag("/la/usb/", imgInSpanish);
	}
	else if( URLpath.search("/lae/itunes/") != -1 ) {
		writeTag("/la/itunes/", imgInSpanish);
	}
	else if( URLpath.search("/lae/powerbook/") != -1 ) {
		writeTag("/powerbook/", imgInSpanish);
	}
	else if( URLpath.search("/lae/imac/g3/") != -1 ) {
		writeTag("/la/imac/g3/", imgInSpanish);
	}
	else if( URLpath.search("/lae/imac/") != -1 ) {
		writeTag("/la/imac/", imgInSpanish);
	}
	else if( URLpath.search("/lae/powermac/") != -1 ) {
		writeTag("/la/powermac/", imgInSpanish);
	}
	else if( URLpath.search("/lae/airport/") != -1 ) {
		writeTag("/la/airport/", imgInSpanish);
	}
	else if( URLpath.search("/lae/hardware/") != -1 )  {
		writeTag("/la/hardware/", imgInSpanish);
	}
	else if( URLpath.search("latinamerica.apple.com/resellers/lae") != -1 ) {
		writeTag("/resellers/la/", imgInSpanish);
	}
	else if( URLpath.search("latinamerica.apple.com/service/lae") != -1 ) {
		writeTag("/service/la/", imgInSpanish);
	}
	else if( URLpath.search("/lae/software/volumelicensing/") != -1 ) {
		writeTag("/la/software/volumelicensing/", imgInSpanish);
	}
	
	else {
		writeTag("/la/", imgInSpanish);
	}

}
else {
	writeTag("/la/", imgInSpanish);
}


