var strCountryName, strCountryCode, urlCountryProfile, urlUseConditions, urlContacts, urlPolicies, strArguments



function BakeCookie(strname, strvalue)
{
var today = new Date ();
var expdate = new Date ();
expdate.setTime(expdate.getTime()+(1 * 1 * 5 * 60 * 1000));
expdate=expdate.toGMTString();
document.cookie=strname+"="+strvalue+";expires="+expdate+";"
}
function ServeCookie(name)
{
var namestr = name + "="
var namelen = namestr.length
var cooklen = document.cookie.length
var i = 0
while (i < cooklen)
{ var j = i + namelen
if (document.cookie.substring(i, j) == namestr)
{ endstr = document.cookie.indexOf (";", j)
if (endstr == -1) {endstr = document.cookie.length}
return unescape(document.cookie.substring(j,endstr))
}
i = document.cookie.indexOf(" ", i) + 1
if (i == 0) break
}
return null
}


function getCountryInfo () {
	var strReferrer, strUrl, strCookie,  intReferrer
	strReferrer 		= unescape(document.referrer);
	strCookie		= ServeCookie("country");
	
	if (strReferrer.search("877-1165")!="-1" || strReferrer.search("878-1625")!="-1" || strCookie=="co") {
		BakeCookie("country", "co");
		strCountryName = "Colombia";
		strcountryCode = "co";
		urlCountryProfile = "http://www.motorola.com/content/0,,747-1274,00.html";
		urlUseConditions = "http://www.motorola.com/content/0,,641-1021,00.html";
		urlContacts = "http://www.motorola.com/co/feedback";
		urlPolicies = "http://www.motorola.com/content/0,,640-1023,00.html";
		strArguments = "Introducci&oacute;n*http://www.motorola.com/content/0,,645-993,00.html*";
		strArguments = strArguments + "Aplicaciones de Mercado*http://www.motorola.com/content/0,,674-1045,00.html*";
		strArguments = strArguments + "Radios Convencionales*http://www.motorola.com/content/0,,862-1042,00.html*";
		strArguments = strArguments + "Radios Troncalizados*http://www.motorola.com/content/0,,863-1043,00.html*";
		strArguments = strArguments + "Tecnolog&iacute;a HF-SSB*http://www.motorola.com/content/0,,864-1626,00.html*";
		strArguments = strArguments + "Automatizaci&oacute;n y Control*http://www.motorola.com/content/0,,896-1658,00.html*";
		strArguments = strArguments + "Datos M&oacute;viles*http://www.motorola.com/content/0,,896-1658,00.html*";
		strArguments = strArguments + "Distribuidores*http://www.motorola.com/content/0,,675-1046,00.html";
	} else if (strReferrer.search("882-1649")!="-1" || strReferrer.search("886-1650")!="-1" || strCookie=="ve") {
		BakeCookie("country", "ve");
		strCountryName = "Venezuela";
		strcountryCode = "ve";
		urlCountryProfile = "http://www.motorola.com/content/0,,747-1274,00.html";
		urlUseConditions = "http://www.motorola.com/content/0,,756-1313,00.html";
		urlContacts = "http://www.motorola.com/ve/feedback";
		urlPolicies = "http://www.motorola.com/content/0,,752-1314,00.html";
		strArguments = "Introducci&oacute;n*http://www.motorola.com/content/0,,794-1349,00.html*";
		strArguments = strArguments + "Aplicaciones de Mercado*http://www.motorola.com/content/0,,797-1376,00.html*";
		strArguments = strArguments + "Radios Convencionales*http://www.motorola.com/content/0,,868-1374,00.html*";
		strArguments = strArguments + "Radios Troncalizados*http://www.motorola.com/content/0,,872-1375,00.html*";
		strArguments = strArguments + "Historias de Exito (Nuevo)*http://www.motorola.com/content/0,,1504-2772,00.html*";
		strArguments = strArguments + "Tecnolog&iacute;a HF-SSB*http://www.motorola.com/content/0,,876-1647,00.html*";
		strArguments = strArguments + "Automatizaci&oacute;n y Control*http://www.motorola.com/content/0,,903-1648,00.html*";
		strArguments = strArguments + "Datos M&oacute;viles*http://www.motorola.com/content/0,,911-1677,00.html*";
		strArguments = strArguments + "Distribuidores (nuevo)*http://www.motorola.com/content/0,,799-1377,00.html*";
		strArguments = strArguments + "Centros de Servicio T&eacute;cnico para Radios de Dos V&iacute;as*http://www.motorola.com/content/0,,1485-2723,00.html";
	} else if (strReferrer.search("879-1634")!="-1" || strReferrer.search("883-1635")!="-1" || strCookie=="cr") {
		BakeCookie("country", "cr");
		strCountryName = "Centro Am&eacute;rica";
		strcountryCode = "cr";
		urlCountryProfile = "http://www.motorola.com/content/0,,745-1265,00.html";
		urlUseConditions = "http://www.motorola.com/content/0,,753-1304,00.html";
		urlContacts = "http://www.motorola.com/cr/feedback";
		urlPolicies = "http://www.motorola.com/content/0,,749-1305,00.html";
		strArguments = "Introducci&oacute;n*http://www.motorola.com/content/0,,792-1332,00.html*";
		strArguments = strArguments + "Aplicaciones de Mercado*http://www.motorola.com/content/0,,795-1364,00.html*";
		strArguments = strArguments + "Radios Convencionales*http://www.motorola.com/content/0,,865-1362,00.html*";
		strArguments = strArguments + "Radios Troncalizados*http://www.motorola.com/content/0,,869-1363,00.html*";
		strArguments = strArguments + "Tecnolog&iacute;a HF-SSB*http://www.motorola.com/content/0,,873-1632,00.html*";
		strArguments = strArguments + "Automatizaci&oacute;n y Control*http://www.motorola.com/content/0,,900-1633,00.html*";
		strArguments = strArguments + "Datos M&oacute;viles*http://www.motorola.com/content/0,,908-1662,00.html*";
		strArguments = strArguments + "Distribuidores*http://www.motorola.com/content/0,,798-1365,00.html";
	} else if (strReferrer.search("881-1642")!="-1" || strReferrer.search("885-1643")!="-1" || strCookie=="pr") {
		BakeCookie("country", "pr");
		strCountryName = "El Caribe";
		strcountryCode = "pr";
		urlCountryProfile = "http://www.motorola.com/content/0,,746-1271,00.html";
		urlUseConditions = "http://www.motorola.com/content/0,,755-1310,00.html";
		urlContacts = "http://www.motorola.com/pr/feedback";
		urlPolicies = "http://www.motorola.com/content/0,,751-1311,00.html";
		strArguments = "Introducci&oacute;n*http://www.motorola.com/content/0,,765-1344,00.html*";
		strArguments = strArguments + "Aplicaciones de Mercado*http://www.motorola.com/content/0,,766-1372,00.html*";
		strArguments = strArguments + "Radios Convencionales*http://www.motorola.com/content/0,,867-1370,00.html*";
		strArguments = strArguments + "Radios Troncalizados*http://www.motorola.com/content/0,,871-1371,00.html*";
		strArguments = strArguments + "Tecnolog&iacute;a HF-SSB*http://www.motorola.com/content/0,,875-1644,00.html*";
		strArguments = strArguments + "Automatizaci&oacute;n y Control*http://www.motorola.com/content/0,,902-1645,00.html*";
		strArguments = strArguments + "Datos M&oacute;viles*http://www.motorola.com/content/0,,910-1673,00.html*";
		strArguments = strArguments + "Distribuidores*http://www.motorola.com/content/0,,767-1373,00.html";
	} else if (strReferrer.search("880-1639")!="-1" || strReferrer.search("884-1640")!="-1" || strCookie=="pe") {
		BakeCookie("country", "pe");
		strCountryName = "Per&uacute;";
		strcountryCode = "pe";
		urlCountryProfile = "http://www.motorola.com/content/0,,748-1268,00.html";
		urlUseConditions = "http://www.motorola.com/content/0,,754-1307,00.html";
		urlContacts = "http://www.motorola.com/pe/feedback";
		urlPolicies = "http://www.motorola.com/content/0,,750-1308,00.html";
		strArguments = "Introducci&oacute;n*http://www.motorola.com/content/0,,793-1338,00.html*";
		strArguments = strArguments + "Aplicaciones de Mercado*http://www.motorola.com/content/0,,796-1368,00.html*";
		strArguments = strArguments + "Radios Convencionales*http://www.motorola.com/content/0,,866-1366,00.html*";
		strArguments = strArguments + "Radios Troncalizados*http://www.motorola.com/content/0,,870-1367,00.html*";
		strArguments = strArguments + "Tecnolog&iacute;a HF-SSB*http://www.motorola.com/content/0,,874-1637,00.html*";
		strArguments = strArguments + "Automatizaci&oacute;n y Control*http://www.motorola.com/content/0,,901-1638,00.html*";
		strArguments = strArguments + "Datos M&oacute;viles*http://www.motorola.com/content/0,,909-1668,00.html*";
		strArguments = strArguments + "Distribuidores*http://www.motorola.com/content/0,,800-1369,00.html*";
		strArguments = strArguments + "Centros de Servicio T&eacute;cnico SAM *http://www.motorola.com/content/0,,1568-2972,00.html";
	} else {
		strCountryName = "Latino  Am&eacute;rica";
		strcountryCode = "co";
		urlCountryProfile = "http://www.motorola.com/content/0,,747-1274,00.html";
		urlUseConditions = "http://www.motorola.com/content/0,,641-1021,00.html";
		urlContacts = "http://www.motorola.com/co/feedback";
		urlPolicies = "http://www.motorola.com/content/0,,640-1023,00.html";
		strArguments = "Introducci&oacute;n*http://www.motorola.com/content/0,,645-993,00.html*";
		strArguments = strArguments + "Aplicaciones de Mercado*http://www.motorola.com/content/0,,674-1045,00.html*";
		strArguments = strArguments + "Radios Convencionales*http://www.motorola.com/content/0,,862-1042,00.html*";
		strArguments = strArguments + "Radios Troncalizados*http://www.motorola.com/content/0,,863-1043,00.html*";
		strArguments = strArguments + "Tecnolog&iacute;a HF-SSB*http://www.motorola.com/content/0,,864-1626,00.html*";
		strArguments = strArguments + "Automatizaci&oacute;n y Control*http://www.motorola.com/content/0,,896-1658,00.html*";
		strArguments = strArguments + "Datos M&oacute;viles*http://www.motorola.com/content/0,,896-1658,00.html*";
		strArguments = strArguments + "Distribuidores*http://www.motorola.com/content/0,,675-1046,00.html";
	}
}

getCountryInfo ();



function generateGenHeader (strCountryName, strCountryCode, urlCountryProfile) {
	document.write ("<link rel=stylesheet type=text/css href='http://www.motorola.com/css/styles2.css'>");
	document.write ("<table width=100% cellpadding=0 cellspacing=0 border=0 class=GlobalBanner>");
	document.write ("<tr class='bg'>");
	document.write ("<td class=logo width=50% rowspan=2>");
	document.write ("<img src='http://a508.g.akamai.net/7/508/787/20030530001454/www.motorola.com/mot/images/motorolaLogo.gif' width=208 height=41 alt='MOTOROLA - intelligence everywhere' border=0>");
	document.write ("</td>");
	document.write ("<td class=country width=50% rowspan=2><span class='current'>"+strCountryName+"</span><br></td>");
	document.write ("<td class='divider'>&nbsp;</td>");
	document.write ("<td class=search><a href='http://www.motorola.com/search' class=fnDark>Buscar</a></td>");
	document.write ("<td class=field valign=bottom>");
	document.write ("<form action='http://search.motorola.com/query.html' method='get'>");
	document.write ("<input type=text class=text value='' name='qt' alt='Enter Search' id=search size=9 maxlength=50>");
	document.write ("<input type=image src='http://a508.g.akamai.net/7/508/787/20030530001455/www.motorola.com/mot/images/arrow_global_arrow.gif' class=arrowButtonLg alt=Submit name=Submit id=searchSubmit width=21 height=21>");
	document.write ("</form>");
	document.write ("</td>");
	document.write ("<td class=corner>");
	document.write ("<img src='http://a508.g.akamai.net/7/508/787/20030530001456/www.motorola.com/mot/images/bannerCorner.gif' width=13 height=13 alt= border=0 align=middle>");
	document.write ("</td>");
	document.write ("</tr>");
	document.write ("</table>");
	document.write ("<table width=100% cellpadding=0 cellspacing=0 border=0 class=GlobalNavigation>");
	document.write ("<tr>");
	document.write ("<td width=100% class=nav>");
	document.write ("<a href='http://www.motorola.com/"+strCountryCode+"' class='navLight'>Inicio</a>&nbsp;|&nbsp;");
	document.write ("<a href='"+urlCountryProfile+"' class='navLight'>Acerca de Motorola "+strCountryName+"</a>&nbsp;|&nbsp;");
	document.write ("<a href='http://www.motorola.com/"+strCountryCode+"/products/' class='navLight'>Productos y Servicios</a>&nbsp;|&nbsp;");
	document.write ("<a href='http://www.motorola.com/"+strCountryCode+"/feedback/' class='navLight'>Cont&aacute;ctenos</a>");
	document.write ("</td>");
	document.write ("<td class=nav><img src='http://a508.g.akamai.net/7/508/787/20030530001453/www.motorola.com/mot/images/colornavbar.gif' width=175 height=20 alt= border=0></td>");
	document.write ("</tr>");
	document.write ("</table>");
	document.write ("<td class=divider>&nbsp;</td>");
	document.write ("<td class=divider>&nbsp;</td>");
	document.write ("<td class=divider>&nbsp;</td>");
}
function generateGenFooter (urlUseConditions, urlContacts, urlPolicies) {
	document.write ("<table width='100%' cellpadding='0' cellspacing='0' border='0' class='GlobalFooter'>");
	document.write ("<tr class='bg'>");
	document.write ("<td class='nav' align='center'>");
	document.write ("<a class='navLight' href='http://www.motorola.com'>www.motorola.com</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.write ("<a class='navLight' href='"+urlUseConditions+"'>Condiciones de Uso</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.write ("<a class='navLight' href='"+urlContacts+"'>Cont&aacute;ctenos</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
	document.write ("<a class='navLight' href='"+urlPolicies+"'>Pol&iacute;ticas de Privacidad</a>");
	document.write ("</td>");
	document.write ("</tr>");
	document.write ("<tr>");
	document.write ("<td class='nav' align='center'><small>&copy; Derechos Reservados 1994-2003 Motorola, Inc. Todos los Derechos Reservados.</small></td>");
	document.write ("</tr>");
	document.write ("</table>");
}
function generateGenLeftNav (strArguments) {
	var nameList, i=0;
	nameList = new Array();
	nameList = strArguments.split ("*");
	arrLength = nameList.length
	document.write ("<table width=100% cellpadding=0 cellspacing=0 border=0 class='LeftHandNavigation'>");
	document.write ("<tr><td class='container'>");
	document.write ("<ul class='main'>");
	while (i<=arrLength/2-1) {
		document.write ("<li ><a href='"+nameList[i*2+1]+"' class='navDark'>"+nameList[i*2]+"</a></li>");
		i+=1
	}
	document.write ("</ul>");
	document.write ("</td></tr>");
	document.write ("</table>");
}

function generateGenTitle (strTitle) {
	document.write ("<table width='100%' cellpadding='0' cellspacing='0' border='0' class='PageSubHeader1'>");
	document.write ("<tr class='bg'>");
	document.write ("<td class='flag'>&nbsp;</td>");
	document.write ("<td class='banner' width='100%'><h2>"+strTitle+"</h2></td>");
	document.write ("</tr>");
	document.write ("</table>");
}


function generateHeader (){
	generateGenHeader(strCountryName, strcountryCode, urlCountryProfile);
}
function generateFooter (){
	generateGenFooter(urlUseConditions, urlContacts, urlPolicies);
}
function generateCGISSLeftNav (){
	generateGenLeftNav(strArguments);
}

