function llama_tracking(queryTracking){
	var Tracking;
	Tracking=queryTracking;
	if (Tracking == "")
		alert("Please enter a Container or B/L Number.")
	else{   
		Tracking = trim(Tracking);
		location.href = "http://www2.libra.com.br/rastreo/rastreo.nsf/yourtrace?openagent&" + Tracking;   
	}
}

function llama_search(querySearch){
	var Search;
	Search=querySearch;
	Search = replaceSubstring(Search,'"','',true);
	if (Search == "")
		alert("Type the word you are searching for into the search box at the top of the page. Then hit the Search button.")
	else{
		location.href = "http://www2.libra.com.br/csav/staticpages.nsf/web?SearchView&Query="+"*"+escape(Search)+"*"+"+AND+(field+carrier+contains+CLIB)"+"+AND+(field+idioma+contains+e)"+"+AND+(field+body+contains+"+escape(Search)+")";
	}
}

function trim(inputstringTrim) {
  fixedTrim = "";
  lastCh = " ";
  for (x = 0; x < inputstringTrim.length; x++) {
     ch = inputstringTrim.charAt(x);
     if ((ch != " ") || (lastCh != " ")) { fixedTrim +=
                                          ch; }
     lastCh = ch;
}
  if (fixedTrim.charAt(fixedTrim.length - 1) == " ") {
     fixedTrim = fixedTrim.substring(0, fixedTrim.length -
                                     1); }
  return fixedTrim;
} 

function replaceSubstring(inputString, badString,
                          goodString, caseSensitive) {
  var fixedReplace = "";
  var UI = inputString;
  var UB = badString;
  
  if ((caseSensitive != 1) && (caseSensitive != true)) {
  UI = inputString.toUpperCase();
     UB = badString.toUpperCase();
     }
  var badEnd = -1;
  var badLoc = UI.indexOf(UB);
  if (badLoc != -1) {
     for (x=1; (badLoc != -1); x++) {
        fixedReplace = fixedReplace + 
                       inputString.substring((badEnd +
                       1), badLoc) + goodString
        badEnd = badLoc + UB.length - 1;
        badLoc = UI.indexOf(UB, (badLoc + 1)); }
     fixedReplace = fixedReplace + 
                    inputString.substring((badEnd + 1),
                    inputString.length); }
     else { fixedReplace = inputString;    }
return fixedReplace;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function checkWhich(evt,query,boton){ 
	var isNav4, isIE4 , lista;
	if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
		var isNav4 = (navigator.appName == "Netscape") ? true : false;
		var isIE4 = (navigator.appName.indexOf("Microsoft" != -1)) ? true : false;
	}

	if (isNav4){		
                if(evt.which==13){
			if(boton=="S"){	llama_search(query);}
			if(boton=="T"){	llama_tracking(query);}
		}
	} 
	else{
		if(isIE4){
                	if(window.event.srcElement.type == "text"){			   
                	    	if(window.event.keyCode==13){
			       		if(boton=="S"){	llama_search(query);}
					if(boton=="T"){	llama_tracking(query);}
				}                     
			} 
		}
                 
	}  
	return false;          
      
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length;
i++)
    if (a[i].indexOf('#')!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document;
if((p=n.indexOf('?'))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i>d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}

function doNothing(){

}
function mmLoadMenus() {
  if (window.mm_menu_1116155350_0) return;
    window.mm_menu_1116155350_0_1 = new Menu("Schedules",143,16,"Verdana, Arial, Helvetica, sans-serif",10,"#003366","#FFFFFF","#B8C7DA","#034997","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
    mm_menu_1116155350_0_1.addMenuItem("Overview","window.open('index.php?p=online_schedules_overview', '_self');");
    mm_menu_1116155350_0_1.addMenuItem("Master&nbsp;Schedule","window.open('index.php?p=online_schedules_master', '_self');");
    mm_menu_1116155350_0_1.addMenuItem("Vessel&nbsp;Position","window.open('index.php?p=online_schedules_vessel_position', '_self');");
    mm_menu_1116155350_0_1.addMenuItem("Schedule&nbsp;by&nbsp;Port","window.open('index.php?p=online_schedules_vessel_schedule', '_self');");
     mm_menu_1116155350_0_1.hideOnMouseOut=true;
     mm_menu_1116155350_0_1.bgColor='#D3DCE7';
     mm_menu_1116155350_0_1.menuBorder=1;
     mm_menu_1116155350_0_1.menuLiteBgColor='#D1DAE6';
     mm_menu_1116155350_0_1.menuBorderBgColor='#DEE4ED';
    window.mm_menu_1116155350_0_2 = new Menu("Tracking",143,16,"Verdana, Arial, Helvetica, sans-serif",10,"#003366","#FFFFFF","#B8C7DA","#034997","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
    mm_menu_1116155350_0_2.addMenuItem("Overview","window.open('index.php?p=online_tracking_overview', '_self');");
    mm_menu_1116155350_0_2.addMenuItem("Module","window.open('index.php?p=online_tracking_module', '_self');");
     mm_menu_1116155350_0_2.hideOnMouseOut=true;
     mm_menu_1116155350_0_2.bgColor='#D3DCE7';
     mm_menu_1116155350_0_2.menuBorder=1;
     mm_menu_1116155350_0_2.menuLiteBgColor='#D1DAE6';
     mm_menu_1116155350_0_2.menuBorderBgColor='#DEE4ED';
    window.mm_menu_1116155350_0_3 = new Menu("Equipment",143,16,"Verdana, Arial, Helvetica, sans-serif",10,"#003366","#FFFFFF","#B8C7DA","#034997","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
    mm_menu_1116155350_0_3.addMenuItem("Container&nbsp;Types","window.open('index.php?p=online_container_types', '_self');");
     mm_menu_1116155350_0_3.hideOnMouseOut=true;
     mm_menu_1116155350_0_3.bgColor='#D3DCE7';
     mm_menu_1116155350_0_3.menuBorder=1;
     mm_menu_1116155350_0_3.menuLiteBgColor='#D1DAE6';
     mm_menu_1116155350_0_3.menuBorderBgColor='#DEE4ED';
    window.mm_menu_1116155350_0_4 = new Menu("USA&nbsp;Tools",143,16,"Verdana, Arial, Helvetica, sans-serif",10,"#003366","#FFFFFF","#B8C7DA","#034997","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
    mm_menu_1116155350_0_4.addMenuItem("xUSA&nbsp;Public&nbsp;Tariff","window.open('http://www.csav.com/pages/usa_public_tariff_en_clib.htm', '_self');");
'    mm_menu_1116155350_0_4.addMenuItem("USA&nbsp;Public&nbsp;Tariff","window.open('index.php?p=online_public_tariff', '_self');");
    mm_menu_1116155350_0_4.addMenuItem("AES&nbsp;Direct","window.open('index.php?p=online_aes_direct', '_self');");
    mm_menu_1116155350_0_4.addMenuItem("Weight&nbsp;Limitations","window.open('index.php?p=online_weight_limitations', '_self');");
     mm_menu_1116155350_0_4.hideOnMouseOut=true;
     mm_menu_1116155350_0_4.bgColor='#D3DCE7';
     mm_menu_1116155350_0_4.menuBorder=1;
     mm_menu_1116155350_0_4.menuLiteBgColor='#D1DAE6';
     mm_menu_1116155350_0_4.menuBorderBgColor='#DEE4ED';
  window.mm_menu_1116155350_0 = new Menu("root",143,16,"Verdana, Arial, Helvetica, sans-serif",10,"#003366","#FFFFFF","#B8C7DA","#034997","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  mm_menu_1116155350_0.addMenuItem(mm_menu_1116155350_0_1);
  mm_menu_1116155350_0.addMenuItem(mm_menu_1116155350_0_2);
  mm_menu_1116155350_0.addMenuItem(mm_menu_1116155350_0_3);
  mm_menu_1116155350_0.addMenuItem(mm_menu_1116155350_0_4);
  mm_menu_1116155350_0.addMenuItem("Web&nbsp;Tools","window.open('index.php?p=online_webtools', '_self');");
      mm_menu_1116155350_0.addMenuItem("E-Commerce","window.open('http://ecommerce.csavgroup.com/ECO/Login.aspx?ReturnUrl=%2feco%2fDefault.aspx', '_blank');");
   mm_menu_1116155350_0.hideOnMouseOut=true;
   mm_menu_1116155350_0.childMenuIcon="../img/arrows.gif";
   mm_menu_1116155350_0.bgColor='#D3DCE7';
   mm_menu_1116155350_0.menuBorder=1;
   mm_menu_1116155350_0.menuLiteBgColor='#D1DAE6';
   mm_menu_1116155350_0.menuBorderBgColor='#DEE4ED';
        window.mm_menu_1117172500_0_1 = new Menu("Offices",113,16,"Verdana, Arial, Helvetica, sans-serif",10,"#003366","#FFFFFF","#B8C7DA","#034997","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
    mm_menu_1117172500_0_1.addMenuItem("Head&nbsp;Office","window.open('index.php?p=about_offices_head', '_self');");
    mm_menu_1117172500_0_1.addMenuItem("Regional&nbsp;Offices","window.open('index.php?p=about_offices_regional', '_self');");
    mm_menu_1117172500_0_1.addMenuItem("Local&nbsp;Offices","window.open('index.php?p=about_offices_local', '_self');");
     mm_menu_1117172500_0_1.hideOnMouseOut=true;
     mm_menu_1117172500_0_1.bgColor='#D3DCE7';
     mm_menu_1117172500_0_1.menuBorder=1;
     mm_menu_1117172500_0_1.menuLiteBgColor='#D1DAE6';
     mm_menu_1117172500_0_1.menuBorderBgColor='#DEE4ED';
	 
	 
	 
	 
	 
  window.mm_menu_1117172500_0 = new Menu("root",113,16,"Verdana, Arial, Helvetica, sans-serif",10,"#003366","#FFFFFF","#B8C7DA","#034997","left","middle",3,0,1000,-5,7,true,true,true,0,false,true);
  mm_menu_1117172500_0.addMenuItem("About&nbsp;Libra","window.open('index.php?p=about_about_libra', '_self');");
  mm_menu_1117172500_0.addMenuItem(mm_menu_1117172500_0_1);
  mm_menu_1117172500_0.addMenuItem("ISO&nbsp;9001","window.open('index.php?p=about_iso9001', '_self');");
  mm_menu_1117172500_0.addMenuItem("ISM","window.open('index.php?p=about_ism', '_self');");
  mm_menu_1117172500_0.addMenuItem("Marketing","window.open('index.php?p=marketing_home', '_self');");
  mm_menu_1117172500_0.addMenuItem("Jobs","window.open('http://curriculum.csavgroup.com.br', '_blank');");
   mm_menu_1117172500_0.hideOnMouseOut=true;
   mm_menu_1117172500_0.childMenuIcon="../img/arrows.gif";
   mm_menu_1117172500_0.bgColor='#D3DCE7';
   mm_menu_1117172500_0.menuBorder=1;
   mm_menu_1117172500_0.menuLiteBgColor='#D1DAE6';
   mm_menu_1117172500_0.menuBorderBgColor='#DEE4ED';
window.mm_menu_1202162950_0 = new Menu("root",242,16,"Verdana, Arial, Helvetica, sans-serif",10,"#003366","#FFFFFF","#B8C7DA","#034997","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_1202162950_0.addMenuItem("US&nbsp;Gulf&nbsp;Weekly&nbsp;Service&nbsp;-&nbsp;Sling&nbsp;1","location='index.php?p=services_rota1'");
  mm_menu_1202162950_0.addMenuItem("Us&nbsp;Gulf&nbsp;Fortnight&nbsp;Service&nbsp;-&nbsp;Sling&nbsp;2","location='index.php?p=services_rota2'");
  mm_menu_1202162950_0.addMenuItem("New&nbsp;Usatlan","location='index.php?p=services_rota3'");
  mm_menu_1202162950_0.addMenuItem("South&nbsp;American&nbsp;West&nbsp;Coast&nbsp;Service","location='index.php?p=services_rota4'");
  mm_menu_1202162950_0.addMenuItem("NMediterranean Sirius","location='index.php?p=services_rota5'");
  mm_menu_1202162950_0.addMenuItem("North&nbsp;of&nbsp;Europe","location='index.php?p=services_rota6'");
   mm_menu_1202162950_0.hideOnMouseOut=true;
   mm_menu_1202162950_0.bgColor='#D3DCE7';
   mm_menu_1202162950_0.menuBorder=1;
   mm_menu_1202162950_0.menuLiteBgColor='#D1DAE6';
   mm_menu_1202162950_0.menuBorderBgColor='#DEE4ED';

mm_menu_1202162950_0.writeMenus();
} // mmLoadMenus()
<!--
function ativo(src) {
if (!src.contains(event.fromElement))
 {
    src.bgColor = '#666666';
 }
}
function inativo(src,corinativa) {
if (!src.contains(event.toElement))
 {
  src.bgColor = '#034997';
 }
}
function ativocustumer(src) {
if (!src.contains(event.fromElement))
 {
    src.bgColor = '#FFCC00';
 }
}
function inativocustumer(src,corinativa) {
if (!src.contains(event.toElement))
 {
  src.bgColor = '#034997';
 }
}
function ativocustumer(src) {
if (!src.contains(event.fromElement))
 {
    src.bgColor = '#FFCC00';
 }
}
function inativocustumer(src,corinativa) {
if (!src.contains(event.toElement))
 {
  src.bgColor = '#034997';
 }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
