function menu_findObj(n, d) { //v4.01
  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=menu_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function menu_swapImage() { //v3.0
  var i,j=0,x,a=menu_swapImage.arguments; document.menu_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=menu_findObj(a[i]))!=null){document.menu_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function menu_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.menu_p) d.menu_p=new Array();
   var i,j=d.menu_p.length,a=menu_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.menu_p[j]=new Image; d.menu_p[j++].src=a[i];}}
}

/*
function getServerName(){
	var ServerName = "http://www.pbsj.com/";
	var url = document.URL.toLowerCase();
	pos = url.search(".pbsj.com/");
	if(pos > -1)
		ServerName = url.substring(0,pos + 10);

	if(ServerName == "http://search.pbsj.com/")
		ServerName = "http://www.pbsj.com/";
	
	return ServerName;
}
*/
function getServerName(){
	var ServerName = "";
	var url = document.URL.toLowerCase();
	/*pos = url.search("http://localhost/ss/");
	if(pos > -1)
		ServerName = url.substring(0,pos + 10);*/

	if(ServerName == "")
		ServerName = "";
	
	return ServerName;
}


function mmLoadMenus() {
	var MenuWidth=210;
	var MenuHeight=20;

  if (window.menu_services) return;

	var ServerName = getServerName();
	
//Core Services
	window.menu_services_1 = new Menu("Design Consultancy & Engg. Services",280,MenuHeight,"Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#ffffff","#cc0000","left","middle",2,0,500,3,0,true,true,true,2,true,true,true,"normal");
	menu_services_1.addMenuItem("Oil & Gas Pipeline Transportation","location='" + ServerName + "oilngas_pipeline_scope_of_services.html'");
	menu_services_1.addMenuItem("GIS Driven Software Development","location='" + ServerName + "gis_scope_of_services.html'");
	menu_services_1.addMenuItem("Highway Engineering & Construction Supervision","location='" + ServerName + "highway_engineering_scope_of_services.html'");
	menu_services_1.addMenuItem("Irrigation, Flood Control & Water Management","location='" + ServerName + "irrigation_scope_of_services.html'");
	menu_services_1.addMenuItem("Environment Impact & Management Plan","location='" + ServerName + "environment_impact_scope_of_services.html'");
	menu_services_1.addMenuItem("Town Planning & Urban Development","location='" + ServerName + "town_planning_scope_of_services.html'");
	menu_services_1.addMenuItem("Right of Use Acquisition & Permitting","location='" + ServerName + "acquisition_permitting_scope_of_services.html'");
	menu_services_1.addMenuItem("Geotechnical Engineering","location='" + ServerName + "geotech_scope_of_services.html'");
	menu_services_1.addMenuItem("Water and Sanitation Engineering","location='" + ServerName + "water_scope_of_services.html'");
	menu_services_1.addMenuItem("Electrical Engineering","location='" + ServerName + "Electrical_Engineering.html'");
	//menu_services_1.addMenuItem("Technology","location='" + ServerName + "What/Core/Technology/'");
	menu_services_1.hideOnMouseOut=true;
	menu_services_1.menuBorder=1;
	menu_services_1.menuLiteBgColor='#ffffff';
	menu_services_1.menuBorderBgColor='#666666';
	menu_services_1.bgColor='#cccccc';

	window.menu_services_2 = new Menu("Investigation & Services",310,MenuHeight,"Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#ffffff","#cc0000","left","middle",2,0,500,3,0,true,true,true,2,true,true,true,"normal");
	menu_services_2.addMenuItem("Engineering, Property & Hydrographic Surveys","location='" + ServerName + "engineering_property_scope_of_services.html'");
	menu_services_2.addMenuItem("Photogrammetry and LIDAR Filtering","location='" + ServerName + "Photogrammetry_scope_of_services.html'");
	menu_services_2.addMenuItem("Remote Sensing & Satellite Image Processing","location='" + ServerName + "remote_scope_of_services.html'");
	menu_services_2.addMenuItem("GIS/CADD Data Development and Maintenance","location='" + ServerName + "gis_cadd_scope_of_services.html'");
	menu_services_2.addMenuItem("Soil Investigation & Foundation Engineering","location='" + ServerName + "soil_scope_of_services.html'");
	menu_services_2.addMenuItem("Route Planning, 3D Corridor Mapping....","location='" + ServerName + "route_planning_scope_of_services.html'");
	menu_services_2.addMenuItem("Ground Water & Resistivity Surveys","location='" + ServerName + "ground_water_scope_of_services.html'");
	menu_services_2.addMenuItem("Underwater Leak Detection & Turnkey Solutions","location='" + ServerName + "underwater_scope_of_services.html'");
	menu_services_2.addMenuItem("Terrain Evaluation & Geological Appraisal","location='" + ServerName + "terrainevaluation_scope_of_services.html'");
	menu_services_2.hideOnMouseOut=true;
	menu_services_2.menuBorder=1;
	menu_services_2.menuLiteBgColor='#ffffff';
	menu_services_2.menuBorderBgColor='#666666';
	menu_services_2.bgColor='#cccccc';

	//Root - What We Do
	window.menu_services = new Menu("root",230,MenuHeight,"Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#ffffff","#cc0000","left","middle",2,0,500,3,0,true,true,true,2,true,true,true,"normal");
	menu_services.addMenuItem(menu_services_1,"location='" + ServerName + "services.html'");
	menu_services.addMenuItem(menu_services_2,"location='" + ServerName + "services.html'");
	//Comprehensive Capabilities
	//menu_services.addMenuItem("Comprehensive&nbsp;Capabilities","location='" + ServerName + "What/Comp/index.asp'");	//menu_services_3);
	menu_services.hideOnMouseOut=true;
	menu_services.childMenuIcon="scriptfiles/arrows.gif";
	menu_services.menuBorder=1;
	menu_services.menuLiteBgColor='#ffffff';
	menu_services.menuBorderBgColor='#666666';
	menu_services.bgColor='#cccccc';
	
//End - Services

//Start - About Us
		window.menu_aboutus = new Menu("root",90,MenuHeight,"Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#ffffff","#cc0000","left","middle",2,0,500,3,0,true,true,true,2,true,true,true,"normal");
		menu_aboutus.addMenuItem("Mission","location='" + ServerName + "mission.html'");
		menu_aboutus.addMenuItem("Introduction","location='" + ServerName + "aboutus.html'");
		menu_aboutus.addMenuItem("ISO","location='" + ServerName + "iso.html'");
		menu_aboutus.addMenuItem("Project Profile","location='" + ServerName + "projectprofile.html'");
		menu_aboutus.addMenuItem("People","location='" + ServerName + "people.html'");
		menu_aboutus.addMenuItem("Resources","location='" + ServerName + "resources.html'");
		menu_aboutus.addMenuItem("Quality Policy","location='" + ServerName + "qualitypolicy.html'");
		menu_aboutus.addMenuItem("HSE Policy","location='" + ServerName + "hsepolicy.html'");
		menu_aboutus.hideOnMouseOut=true;
		menu_aboutus.childMenuIcon="/navbar/images/arrows.gif";
		menu_aboutus.menuBorder=1;
		menu_aboutus.menuLiteBgColor='#ffffff';
		menu_aboutus.menuBorderBgColor='#666666';
		menu_aboutus.bgColor='#cccccc';
//End - About Us

//Start - Clients
		window.menu_clients = new Menu("root",140,MenuHeight,"Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#ffffff","#cc0000","left","middle",2,0,500,3,0,true,true,true,2,true,true,true,"normal");
		menu_clients.addMenuItem("Testimonials","location='" + ServerName + "clients_testimonials.html'");
		menu_clients.addMenuItem("International","location='" + ServerName + "clients_international.html'");
		menu_clients.addMenuItem("Indian","location='" + ServerName + "clients_india.html'");
		menu_clients.addMenuItem("Major Projects & Clients","location='" + ServerName + "clients.html'");
		menu_clients.hideOnMouseOut=true;
		//menu_clients.childMenuIcon="/navbar/images/arrows.gif";
		menu_clients.menuBorder=1;
		menu_clients.menuLiteBgColor='#ffffff';
		menu_clients.menuBorderBgColor='#666666';
		menu_clients.bgColor='#000088';
//End - clients

//Start - Contact Us
		window.menu_contactus = new Menu("root",90,MenuHeight,"Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#ffffff","#cc0000","left","middle",2,0,500,3,0,true,true,true,2,true,true,true,"normal");
		menu_contactus.addMenuItem("Address","location='" + ServerName + "contactus.html'");
		menu_contactus.addMenuItem("Feedback","location='" + ServerName + "feedback.asp'");
		menu_contactus.hideOnMouseOut=true;
		//menu_contactus.childMenuIcon="/navbar/images/arrows.gif";
		menu_contactus.menuBorder=1;
		menu_contactus.menuLiteBgColor='#ffffff';
		menu_contactus.menuBorderBgColor='#666666';
		menu_contactus.bgColor='#000088';
//End - Contact Us

//Start - Products
		window.menu_products = new Menu("root",90,MenuHeight,"Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#ffffff","#cc0000","left","middle",2,0,500,3,0,true,true,true,2,true,true,true,"normal");
		menu_products.addMenuItem("SASG","location='" + ServerName + "products_sasg.html'");
		menu_products.addMenuItem("ROU Master","location='" + ServerName + "products_roumaster.html'");
		menu_products.addMenuItem("PCM","location='" + ServerName + "products_sam.html'");
	    menu_products.addMenuItem("BMS","location='" + ServerName + "products_bms.html'");
		menu_products.addMenuItem("IRIS","location='" + ServerName + "products_iris.html'");
		menu_products.addMenuItem("PDMS","location='" + ServerName + "products_pdms.html'");
		menu_products.addMenuItem("SeconMap","location='" + ServerName + "products_seconmap.html'");
		menu_products.addMenuItem("ASG-WP","location='" + ServerName + "products_wp.html'");
		menu_products.addMenuItem("SSN","location='" + ServerName + "products_ssn.html'");
		menu_products.addMenuItem("WDN","location='" + ServerName + "products_wdn.html'");
		menu_products.addMenuItem("SBSD","location='" + ServerName + "products_sbsd.html'");
		menu_products.addMenuItem("RPMS","location='" + ServerName + "products_rpms.html'");
		menu_products.addMenuItem("RoW Master","location='" + ServerName + "products_row.html'");
		menu_products.addMenuItem("CityGas","location='" + ServerName + "products_CityGas.html'");
		menu_products.addMenuItem("BPMS","location='" + ServerName + "products_bpms.html'");
		menu_products.hideOnMouseOut=true;
		//menu_contactus.childMenuIcon="/navbar/images/arrows.gif";
		menu_products.menuBorder=1;
		menu_products.menuLiteBgColor='#ffffff';
		menu_products.menuBorderBgColor='#666666';
		menu_products.bgColor='#000088';
//End - Products

//Start - Careers
		window.menu_careers = new Menu("root",90,MenuHeight,"Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#ffffff","#cc0000","left","middle",2,0,500,3,0,true,true,true,2,true,true,true,"normal");
		menu_careers.addMenuItem("Join Us","location='" + ServerName + "careers.html'");
		menu_careers.addMenuItem("Application Form","location='" + ServerName + "Register.aspx'");
		//menu_careers.addMenuItem("E-mail CV","location.href='mailto:sesvy@blr.vsnl.net.in&subject=From Careers Page in Site'");
		menu_careers.hideOnMouseOut=true;
		//menu_contactus.childMenuIcon="/navbar/images/arrows.gif";
		menu_careers.menuBorder=1;
		menu_careers.menuLiteBgColor='#ffffff';
		menu_careers.menuBorderBgColor='#666666';
		menu_careers.bgColor='#000088';
//End - Careers

//Start - Media Room
		window.menu_mediaroom = new Menu("root",90,MenuHeight,"Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#ffffff","#cc0000","left","middle",2,0,500,3,0,true,true,true,2,true,true,true,"normal");
		menu_mediaroom.addMenuItem("News","location='" + ServerName + "media_room.html'");
		menu_mediaroom.addMenuItem("Brochures","location='" + ServerName + "media_room_brochures.html'");
		menu_mediaroom.addMenuItem("News Letter","location='" + ServerName + "media_room_newsletter.html'");
		menu_mediaroom.hideOnMouseOut=true;
		//menu_mediaroom.childMenuIcon="/navbar/images/arrows.gif";
		menu_mediaroom.menuBorder=1;
		menu_mediaroom.menuLiteBgColor='#ffffff';
		menu_mediaroom.menuBorderBgColor='#666666';
		menu_mediaroom.bgColor='#cccccc';
//End - Media Room


//Start - Search menu
	//Search Root
	window.menu_search = new Menu("root",195,100,"Arial, Helvetica, sans-serif",12,"#000000","#ffffff","#ffffff","#ffffff","left","top",0,0,500,3,0,true,true,true,2,false,true,false,"normal");
	//Root
	//menu_search.addMenuItem("<form id=myform name=\"myform\" method=\"POST\" action=\"search.asp\"><table cellspacing=0 cellpadding=0 border=0><tr><td><img border=\"0\" src=\"/navbar/images/search_dotted.gif\" width=\"190\" height=\"3\" align=\"bottom\">&nbsp;</td></tr><tr><td>&nbsp;<img border=\"0\" src=\"/navbar/images/search.gif\" width=\"60\" height=\"10\"></td></tr><tr><td><table cellpadding=0 cellspacing=0 border=0><tr><td>&nbsp;<input type=\"text\" name=\"T1\" size=14 style=\"width:125px;height:20px; border: 1px solid #666666;background-color: #EFEFEF;\"></td><td><input type=\"image\" src=\"/navbar/images/enter.gif\" width=\"38\" height=\"20\" align=\"bottom\" border=\"0\"></td></tr></table></td></tr><tr><td><img border=\"0\" src=\"/navbar/images/search_dotted.gif\" width=\"190\" height=\"3\" align=\"bottom\">&nbsp;</td></tr><tr><td>&nbsp;<a href=\"search.asp\"><img border=\"0\" src=\"/navbar/images/advanced_search.gif\" width=\"135\" height=\"13\"></a></td></tr></table></form>");
	menu_search.addMenuItem("<FORM ACTION=\"/search/search.asp\" NAME=\"MONDOSEARCHFORM\" METHOD=\"GET\"><INPUT TYPE=\"HIDDEN\" Name=\"type\" VALUE=\"search\"><INPUT TYPE=\"HIDDEN\" NAME=\"RESMASK\" VALUE=\"MssRes.msk\"><INPUT TYPE=\"HIDDEN\" NAME=\"CFGNAME\" VALUE=\"MssFind.cfg\"><table cellspacing=0 cellpadding=0 border=0><tr><td><img border=\"0\" src=\"/navbar/images/search_dotted.gif\" width=\"190\" height=\"3\" align=\"bottom\">&nbsp;</td></tr><tr><td>&nbsp;<img border=\"0\" src=\"/navbar/images/search.gif\" width=\"60\" height=\"10\"></td></tr><tr><td><table cellpadding=0 cellspacing=0 border=0><tr><td>&nbsp;<input type=\"text\" name=\"Query\" value size=14 style=\"width:125px;height:20px; border: 1px solid #666666;background-color: #EFEFEF;\"></td><td><input type=\"image\" src=\"/navbar/images/enter.gif\" width=\"38\" height=\"20\" align=\"bottom\" border=\"0\"></td></tr></table></td></tr><tr><td><img border=\"0\" src=\"/navbar/images/search_dotted.gif\" width=\"190\" height=\"3\" align=\"bottom\">&nbsp;</td></tr><tr><td>&nbsp;<a href=\"/search/search.asp?type=advsearch\"><img border=\"0\" src=\"/navbar/images/advanced_search.gif\" width=\"135\" height=\"13\"></a></td></tr></table></form>");
	menu_search.hideOnMouseOut=true;
	menu_search.menuBorder=1;
	menu_search.menuLiteBgColor='#ffffff';
	menu_search.menuBorderBgColor='#666666';
	menu_search.bgColor='#cccccc';
//End - Search menu


	menu_search.writeMenus();
} // mmLoadMenus()

function preloadImages()
{
	menu_preloadImages('/navbar/images/nav_home_on_f2.gif','/ss/scriptfiles/nav_are_on_f2.gif','/navbar/images/nav_whatwedo_on_f2.gif','/navbar/images/nav_whatwedo_on.gif','/navbar/images/nav_press_on_f2.gif','/navbar/images/nav_locations_f2.gif','/navbar/images/nav_careers_on_f2.gif','/navbar/images/nav_contact_on_f2.gif','/navbar/images/nav_search_on_f2.gif','/navbar/images/nav_search_on.gif');
}

function menu_swapImgRestore() { //v3.0
  var i,x,a=document.menu_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
