var DDSPEED = 10;
var DDTIMER = 15;
function getmenu()
{
   var strMenu = '';
   
    strMenu = strMenu +  "<dl class=\"dropdown\">";
    strMenu = strMenu + "       <dt id=\"Dt1\" onclick=\"window.location='index.html';\">Home</dt>";
    strMenu = strMenu + "</dl>";
  
	strMenu = strMenu + "<dl class=\"dropdown\">";
    strMenu = strMenu + "       <dt id=\"about-ddheader\" onmouseover=\"ddMenu('about',1)\" onmouseout=\"ddMenu('about',-1)\">About</dt>";
    strMenu = strMenu + "<dd id=\"about-ddcontent\" onmouseover=\"cancelHide('about')\" onmouseout=\"ddMenu('about',-1)\">";
    strMenu = strMenu + "<ul>";
    strMenu = strMenu + "  <li><a href=\"about_irca.html\" class=\"underline\">About IRCA</a></li>";
    strMenu = strMenu + "  <li><a href=\"about_bee.html\" class=\"underline\">About BEE</a></li>";
    strMenu = strMenu + "  <li><a href=\"accreditation_certification.html\" class=\"underline\">Accreditation &amp; Certification</a></li>";
    strMenu = strMenu + "  <li><a href=\"structure.html\" class=\"underline\">Company Structure</a></li>";
    strMenu = strMenu + "  <li><a href=\"docs/corporate_profile.pdf\" target=\"_blank\" class=\"underline\">Corporate Profile</a></li>";
      
    strMenu = strMenu + " </ul>";
    strMenu = strMenu + " </dd>";
    strMenu = strMenu + "</dl>"
    strMenu = strMenu + "<dl class=\"dropdown\">";
    strMenu = strMenu + "  <dt id=\"service-ddheader\" onmouseover=\"ddMenu('service',1)\" onmouseout=\"ddMenu('service',-1)\">Services &amp; Products</dt>";
    strMenu = strMenu + "  <dd id=\"service-ddcontent\" onmouseover=\"cancelHide('service')\" onmouseout=\"ddMenu('service',-1)\">";
    strMenu = strMenu + "    <ul>";
    strMenu = strMenu + "      <li><a href=\"consulting.html\" class=\"underline\">Consulting Services</a></li>";
    strMenu = strMenu + "      <li><a href=\"etd.html\" class=\"underline\">Education &amp; Training</a></li>";
    strMenu = strMenu + "      <li><a href=\"bit.html\" class=\"underline\">Behaviour Intervention Technologies</a></li>";
    strMenu = strMenu + "      <li><a href=\"MCSTS.html\" class=\"underline\">Mining, Construction Safety Technical Services</a></li>";
    strMenu = strMenu + "      <li><a href=\"auditing.html\" class=\"underline\">Auditing</a></li>";
    strMenu = strMenu + "      <li><a href=\"rpl.html\" class=\"underline\">RPL</a></li>";
         
    strMenu = strMenu + "     </ul>";
    strMenu = strMenu + "   </dd>";
    strMenu = strMenu + "</dl>";
    strMenu = strMenu + "<dl class=\"dropdown\">";
    strMenu = strMenu + "    <dt id=\"software-ddheader\" onmouseover=\"ddMenu('software',1)\" onmouseout=\"ddMenu('software',-1)\">Software Products</dt>";
    strMenu = strMenu + "    <dd id=\"software-ddcontent\" onmouseover=\"cancelHide('software')\" onmouseout=\"ddMenu('software',-1)\">";
    strMenu = strMenu + "    <ul>";
    strMenu = strMenu + "      <li><a href=\"rcat.html\" class=\"underline\">RCAT Software</a></li>";
    strMenu = strMenu + "      <li><a href=\"bbs.html\" class=\"underline\">BBS Software</a></li>";
    strMenu = strMenu + "      <li><a href=\"isit.html\" class=\"underline\">ISIT Software</a></li>";
    strMenu = strMenu + "      <li><a href=\"ras.html\" class=\"underline\">RAS Software</a></li>";
	strMenu = strMenu + "      <li><a href=\"Harrington.html\" class=\"underline\">Harrington Software</a></li>";
   // strMenu = strMenu + "      <li><a href=\"software.html\">EBMS</a></li>";
    strMenu = strMenu + "    </ul>";
    strMenu = strMenu + "    </dd>";
    strMenu = strMenu + "</dl>";
    strMenu = strMenu + "<dl class=\"dropdown\">";
    strMenu = strMenu + "  <dt id=\"events-ddheader\" onmouseover=\"ddMenu('events',1)\" onmouseout=\"ddMenu('events',-1)\">Downloads</dt>";
    strMenu = strMenu + "  <dd id=\"events-ddcontent\" onmouseover=\"cancelHide('events')\" onmouseout=\"ddMenu('events',-1)\">";
    strMenu = strMenu + "    <ul>";
    strMenu = strMenu + "      <li><a href=\"articles.html\" class=\"underline\">Articles</a></li>";
    strMenu = strMenu + "      <li><a href=\"product_and_services_catalogue/Small_catalogue.html\" target=\"_blank\" class=\"underline\">Catalogue</a></li>";
    strMenu = strMenu + "     <li><a href=\"newsletters.html\" class=\"underline\">Newsletter</a></li>";
	strMenu = strMenu + "     <li><a href=\"Gallery.html\" class=\"underline\">Gallery</a></li>";
          
    strMenu = strMenu + "    </ul>";
    strMenu = strMenu + "  </dd>";
    strMenu = strMenu + "</dl>";
    strMenu = strMenu + "<dl class=\"dropdown\">";
    strMenu = strMenu + "  <dt id=\"contact-ddheader\" onmouseover=\"ddMenu('contact',1)\" onmouseout=\"ddMenu('contact',-1)\">Contact us</dt>";
    strMenu = strMenu + "  <dd id=\"contact-ddcontent\" onmouseover=\"cancelHide('contact')\" onmouseout=\"ddMenu('contact',-1)\">";
    strMenu = strMenu + "    <ul>";
    strMenu = strMenu + "      <li><a href=\"contact.html\" class=\"underline\">Contact IRCA Office</a></li>";
    strMenu = strMenu + "      <li><a href=\"docs/ho_map.pdf\" target=\"_blank\" class=\"underline\">Directions to Head Office</a></li>";
    strMenu = strMenu + "      <li><a href=\"feedback.html\" class=\"underline\">Client Feedback</a></li>";
    strMenu = strMenu + "      <li><a href=\"career_opportunities.html\" class=\"underline\">Career Opportunities</a></li>";
         
          
    strMenu = strMenu + "    </ul>";
    strMenu = strMenu + "   </dd>";
    strMenu = strMenu + "</dl>";
    
    strMenu = strMenu +  "<dl class=\"dropdown\">";
    strMenu = strMenu + "       <dt id=\"Dt1\" onclick=\"window.location='related.html';\">Related Links </dt>";
    strMenu = strMenu + "</dl>";
         
          
    strMenu = strMenu + "    </ul>";
    strMenu = strMenu + "   </dd>";
    strMenu = strMenu + "</dl>";
  
    document.getElementById('menu_bg').innerHTML=strMenu;
    
    //replace the footer content
    var strFooter = "";
    
    strFooter = strFooter + "<p>&copy;Copyright, IRCA Global  2011. </p>"; 
     document.getElementById('footer').innerHTML=strFooter;
     //end replace footer content
     
    //replace left content
   var strLeftcontent  ="";
   
   
    strLeftcontent = strLeftcontent + " <div class=\"bor\">";
	strLeftcontent = strLeftcontent + "	<div class=\"categories\"> ";
	strLeftcontent = strLeftcontent + "		<h3>Quick Links</h3> ";
	strLeftcontent = strLeftcontent + "		<ul> ";
	strLeftcontent = strLeftcontent + "			<li><a href=\"etd.html\" style=\"border-bottom: 1px dotted #701212;\">Training Schedules</a></li> ";
	strLeftcontent = strLeftcontent + "			<li><a href=\"career_opportunities.html\" style=\"border-bottom: 1px dotted #701212;\">Career Opportunities</a></li> ";
	strLeftcontent = strLeftcontent + "			<li><a href=\"EBMS_Demo_Published/default.htm\" target=\"_blank\" style=\"border-bottom: 1px dotted #701212;\">EBMS Demo </a></li> ";
	strLeftcontent = strLeftcontent + "			<li><a href=\"docs/catalogue.pdf\" target=\"_blank\" style=\"border-bottom: 1px dotted #701212;\">Product &amp; Services Catalogue</a></li> ";
	strLeftcontent = strLeftcontent + "			<li><a href=\"docs/short_form_agreement.doc\" target=\"_blank\"  style=\"border-bottom: 1px dotted #701212;\">Training Booking Form</a></li> ";
				
	strLeftcontent = strLeftcontent + "		</ul> ";
	strLeftcontent = strLeftcontent + "	</div> ";
	strLeftcontent = strLeftcontent + "</div> ";
	strLeftcontent = strLeftcontent + "<div class=\"bor\"> ";
	strLeftcontent = strLeftcontent + "	  <h3>Company News</h3> ";
	strLeftcontent = strLeftcontent + "	<div class=\"company\"> ";
	strLeftcontent = strLeftcontent + "		<ul> ";
				
	strLeftcontent = strLeftcontent + "			<li><a href=\"Bcom1.html\" style=\"border-bottom: 1px dotted #701212;\"> Available Feb 2012</a> ";
	strLeftcontent = strLeftcontent + "			  <p> <b> Bachelor of Commerce Business Management</b></p><p> ";
    strLeftcontent = strLeftcontent + "Business Management can be defined as a process which enables managers to make a value judgement on how to improve the performance of their operations through the selection and application of a blend of technologies.</p><div class=\"read\"></div> ";
	strLeftcontent = strLeftcontent + "			</li> ";
    

    strLeftcontent = strLeftcontent + "            <li><a href=\"Savenda.html\" style=\"border-bottom: 1px dotted #701212;\">IRCA Savenda</a> ";
	strLeftcontent = strLeftcontent + "			<p> <b>IRCA Savenda, Zambia</b></p><p> ";
    strLeftcontent = strLeftcontent + "IRCA Savenda in Zambia is up and Running. Click on read more for more information";
    strLeftcontent = strLeftcontent + "... </p><div class=\"read\"><a href=\"Savenda.html\">read more</a></div> ";
	strLeftcontent = strLeftcontent + "			</li> ";
				
	strLeftcontent = strLeftcontent + "            <li><a href=\"MCSTS.html\" style=\"border-bottom: 1px dotted #701212;\">Launched February 2012</a> ";
	strLeftcontent = strLeftcontent + "			<p> <b>Mining and Construction, Safety Technical Services</b></p><p> ";
    strLeftcontent = strLeftcontent + "IRCA Global is proud to announce the launch of their new department, Mining and Construction, Safety Technical Services.";
    strLeftcontent = strLeftcontent + "... </p><div class=\"read\"><a href=\"MCSTS.html\">read more</a></div> ";
	strLeftcontent = strLeftcontent + "			</li> ";
				
	strLeftcontent = strLeftcontent + "		</ul> ";
	strLeftcontent = strLeftcontent + "	</div> ";
	strLeftcontent = strLeftcontent + "</div> ";
    
     document.getElementById('left').innerHTML=strLeftcontent;
    //end replace left content

}
// main function to handle the mouse events //
function ddMenu(id,d){
  var h = document.getElementById(id + '-ddheader');
  var c = document.getElementById(id + '-ddcontent');
  clearInterval(c.timer);
  if(d == 1){
    clearTimeout(h.timer);
    if(c.maxh && c.maxh <= c.offsetHeight){return}
    else if(!c.maxh){
      c.style.display = 'block';
      c.style.height = 'auto';
      c.maxh = c.offsetHeight;
      c.style.height = '0px';
    }
    c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
  }else{
    h.timer = setTimeout(function(){ddCollapse(c)},50);
  }
}

// collapse the menu //
function ddCollapse(c){
  c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER);
}

// cancel the collapse if a user rolls over the dropdown //
function cancelHide(id){
  var h = document.getElementById(id + '-ddheader');
  var c = document.getElementById(id + '-ddcontent');
  clearTimeout(h.timer);
  clearInterval(c.timer);
  if(c.offsetHeight < c.maxh){
    c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
  }
}

// incrementally expand/contract the dropdown and change the opacity //
function ddSlide(c,d){
  var currh = c.offsetHeight;
  var dist;
  if(d == 1){
    dist = (Math.round((c.maxh - currh) / DDSPEED));
  }else{
    dist = (Math.round(currh / DDSPEED));
  }
  if(dist <= 1 && d == 1){
    dist = 1;
  }
  c.style.height = currh + (dist * d) + 'px';
  c.style.opacity = currh / c.maxh;
  c.style.filter = 'alpha(opacity=' + (currh * 100 / c.maxh) + ')';
  if((currh < 2 && d != 1) || (currh > (c.maxh - 2) && d == 1)){
    clearInterval(c.timer);
  }
}
