var fileName;
var mapDetect;

var about_map;
var contact_map;
var candidates_map;
var clients_map;
var flashControl;
var squareImage;
var titleImage;
var subNavImage;

fileName = location.pathname.substring(location.pathname.lastIndexOf('/')+1);
fileName = fileName.replace(".htm","");
fileName = fileName.replace(".asp","");

switch (fileName) {

   case "about":
   	flashControl = "a";
   	squareImage = "about_square.gif";
   	titleImage = "about_title.gif";
   	subNavImage = "about_subnav.gif";
   break;
   
   case "about_news":
   	flashControl = "b";
   	squareImage = "about_square.gif";
   	titleImage = "about_title.gif";
   	subNavImage = "about_news_subnav.gif";   
   break;
   
   case "candidates":
    flashControl = "c";
   	squareImage = "candidates_square.gif";
   	titleImage = "candidates_title.gif";
   	subNavImage = "candidates_subnav.gif";   
   break; 
   
   case "candidates_search":
    flashControl = "d";
   	squareImage = "candidates_square.gif";
   	titleImage = "candidates_title.gif";
   	subNavImage = "candidates_search_subnav.gif";     
   break;
   
   case "candidates_search_results":
    flashControl = "d";
   	squareImage = "candidates_square.gif";
   	titleImage = "candidates_title.gif";
   	subNavImage = "candidates_search_subnav.gif";     
   break;
   
   case "candidates_search_jobdetails":
    flashControl = "d";
   	squareImage = "candidates_square.gif";
   	titleImage = "candidates_title.gif";
   	subNavImage = "candidates_search_subnav.gif";  
   break;
   
   case "candidates_advice":
    flashControl = "e";
   	squareImage = "candidates_square.gif";
   	titleImage = "candidates_title.gif";
   	subNavImage = "candidates_advice_subnav.gif";      
   break;
   
   case "candidates_register":
    flashControl = "f";
   	squareImage = "candidates_square.gif";
   	titleImage = "candidates_title.gif";
   	subNavImage = "candidates_register_subnav.gif";     
   break;
   
   case "candidates_register_thanks":
    flashControl = "f";
   	squareImage = "candidates_square.gif";
   	titleImage = "candidates_title.gif";
   	subNavImage = "candidates_register_subnav.gif";    
   break;
   
   case "candidates_timesheets":
    flashControl = "g";
   	squareImage = "candidates_square.gif";
   	titleImage = "candidates_title.gif";
   	subNavImage = "candidates_timesheets_subnav.gif";    
   break;
   
   case "contact":
    flashControl = "h";
    squareImage = "contact_square.gif";
    titleImage = "contact_title.gif";
   	subNavImage = "contact_subnav.gif";    
   break;
   
   case "contact_candidates":
    flashControl = "i";
    squareImage = "contact_square.gif";
    titleImage = "contact_title.gif";
   	subNavImage = "contact_candidates_subnav.gif";   
   break;
   
   case "contact_clients":
    flashControl = "j";
    squareImage = "contact_square.gif";
    titleImage = "contact_title.gif";
   	subNavImage = "contact_clients_subnav.gif";   
   break;
   
   case "clients":
    flashControl = "k";
    squareImage = "clients_square.gif";
    titleImage = "clients_title.gif";
   	subNavImage = "clients_subnav.gif";   
   break;
   
   case "clients_termsofbusiness":
    flashControl = "l";
    squareImage = "clients_square.gif";
    titleImage = "clients_title.gif";
   	subNavImage = "clients_termsofbusiness_subnav.gif";    
   break;
   
   case "clients_testimonials":
    flashControl = "m";
    squareImage = "clients_square.gif";
    titleImage = "clients_title.gif";
   	subNavImage = "clients_testimonials_subnav.gif";     
   break;
   

}

// image map details
about_map = '<map name="Map"><area shape="rect" coords="36,4,73,22" href="about_news.asp"><area shape="rect" coords="27,29,46,47" href="candidates.htm"><area shape="rect" coords="3,29,21,47" href="clients.htm"><area shape="rect" coords="4,5,22,23" href="about.htm"><area shape="rect" coords="87,35,124,53" href="about_news.asp"></map>';
contact_map = '<map name="Map"><area shape="rect" coords="203,3,250,22" href="contact_clients.htm"><area shape="rect" coords="110,4,184,21" href="contact_candidates.htm"><area shape="rect" coords="35,3,88,22" href="contact.htm"></map>';
candidates_map = '<map name="Map"><area shape="rect" coords="37,4,90,23" href="candidates_search.htm"><area shape="rect" coords="107,5,150,22" href="candidates_advice.htm"><area shape="rect" coords="168,3,227,22" href="candidates_register.htm"><area shape="rect" coords="247,3,321,24" href="candidates_timesheets.htm"></map>';
clients_map = '<map name="Map"><area shape="rect" coords="37,4,155,23" href="clients_termsofbusiness.htm"></map>';

if (plugin) {

  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="577" height="84" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id=otcNav>');
  document.write('<param name="MOVIE" value="flash/otcNav.swf?' + flashControl + '">');
  document.write('<param name="PLAY" value="true">');
  document.write('<param name="LOOP" value="false">');
  document.write('<param name="QUALITY" value="high">');
  document.write('<param name="SCALE" value="SHOWALL">');
  document.write('<embed name="otcNav" src="flash/otcNav.swf?' + flashControl + '" width="577" height="84" play="true" loop="false" quality="high" scale="SHOWALL" type="application/x-shockwave-flash" swliveconnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
  document.write('</embed>');
  document.write('</object>');
  
  //alert("plugin detected");

}

else {                                        

   fileName = location.pathname.substring(location.pathname.lastIndexOf('/')+1);
   fileName = fileName.replace(".htm","");
   fileName = fileName.replace(".asp","");
   
   // set the value of MapDetect
   if (fileName.indexOf("_") != -1) {
     mapDetect = fileName.substring(0,fileName.indexOf("_")) + "_map";
     // alert(mapDetect);
   }
   else {
     mapDetect = fileName + "_map";
   }
   
   document.write('<table border="0" cellspacing="0" cellpadding="0">');
   document.write(' <tr>'); 
   document.write("  <td rowspan=\"2\"><img src=\"flashalt_images/" + squareImage + "\" width=\"50\" height=\"84\" usemap=\"#NavSquare\" border=\"0\"><map name=\"NavSquare\"><area shape=\"rect\" coords=\"3,30,21,48\" href=\"clients.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('navtitle','','flashalt_images/clients_title.gif',1)\"><area shape=\"rect\" coords=\"27,30,46,48\" href=\"candidates.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('navtitle','','flashalt_images/candidates_title.gif',1)\"><area shape=\"rect\" coords=\"28,4,47,22\" href=\"contact.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('navtitle','','flashalt_images/contact_title.gif',1)\"><area shape=\"rect\" coords=\"4,3,22,21\" href=\"about.htm\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('navtitle','','flashalt_images/about_title.gif',1)\"></map></td>")
   document.write('  <td><img src="flashalt_images/' + titleImage + '" width="527" height="32" name="navtitle"></td>')
   document.write(' </tr>');
   document.write(' <tr>');
   document.write('<td><img src="flashalt_images/' + subNavImage + '" width="527" height="52" usemap="#Map" border="0"></td>');
   document.write(' </tr>');
   document.write('</table>');
   
   // write out the appropriate image map
   eval('document.write(' + mapDetect + ');'); 
}    




