﻿menuHideDelay = 500;
lastMenu = "";
myTime = null;

function setHeight()
    {
    
        var pageDivHeight = document.getElementById("page").offsetHeight;
        
        var menuHeight = document.getElementById("menucontent").offsetHeight + document.getElementById("menubottom").offsetHeight
        
        var spacerHeight = pageDivHeight - menuHeight;
        document.getElementById("menuspacer").style.height = spacerHeight+"px";

    }
    
    
function showSecondMenu(sender, menuId)
{
	if(menuId != lastMenu)
	{
		hideSecondMenu(lastMenu);
	}
	
	if(myTime != null)
	{
		clearTimeout(myTime);
	}

	var menu2 = document.getElementById(menuId);
	menu2.style.top = getElementPosition(sender.id).top + 23 +"px";
	menu2.style.left = getElementPosition(sender.id).left + -40 +"px";
	menu2.style.display = "";
	lastMenu = menuId;
}

function hideSecondMenu(menuId)
{
	if(lastMenu != "")
	{
		var menu2 = document.getElementById(menuId);
		menu2.style.display = "none";
	}
}

function selectedSecondMenu()
{
	clearTimeout(myTime);
}

function setMenuHideTimer(menuId)
{
	myTime = setTimeout("hideSecondMenu('"+menuId+"')", menuHideDelay)
}

function getElementPosition(elemID){
var offsetTrail = document.getElementById(elemID);
var offsetLeft = 0;
var offsetTop = 0;
while (offsetTrail){
offsetLeft += offsetTrail.offsetLeft;
offsetTop += offsetTrail.offsetTop;
offsetTrail = offsetTrail.offsetParent;
}
if (navigator.userAgent.indexOf('Mac') != -1 && typeof document.body.leftMargin != 'undefined'){
offsetLeft += document.body.leftMargin;
offsetTop += document.body.topMargin;
}
return {left:offsetLeft,top:offsetTop};
}


function random_imglink()
{
      var myimages = new Array();
      myimages[1]="Images/BG-Header_Image1.jpg";
      myimages[2]="Images/BG-Header_Image2.jpg";
      myimages[3]="Images/BG-Header_Image3.jpg";
      myimages[4]="Images/BG-Header_Image4.jpg";

      var ry=Math.floor(Math.random()*myimages.length);

      if (ry==0)
         ry=1;
      
      document.getElementById("HeaderItems").style.backgroundImage = "url("+myimages[ry]+")";
}


function random_requestimage()
{
      var supportimages = new Array();
      supportimages[1]="Images/Request1.jpg";
      supportimages[2]="Images/Request2.jpg";


      var ry=Math.floor(Math.random()*supportimages.length);

      if (ry==0)
         ry=1;
      
      document.getElementById("supportbg").style.backgroundImage = "url("+supportimages[ry]+")";
}



function random_successimage()
{
      var successimages = new Array();
      successimages[1]="Images/Success1.jpg";
      successimages[2]="Images/Success2.jpg";

      var ry=Math.floor(Math.random()*successimages.length);

      if (ry==0)
         ry=1;
      
      document.getElementById("successbg").style.backgroundImage = "url("+successimages[ry]+")";
}


function SwapImage(elementid, newimageurl)
{
    var elem = document.getElementById(elementid);
    elem.src = newimageurl;
}

function random_text_ilr()
{
  var mytext=new Array()
  //specify random text below. You can have as many as you wish
  mytext[1]='"I’ve been signing up a mix of Train to Gain and Modern Apprentices for the last 2 years and have always dreaded having to complete the associated paperwork. There’s so much repetition involved, it really does feel like a chore and spoils that all important first meeting with the client."'
  mytext[2]='"Since I started using EZ-ILR I’ve found the whole process has been really streamlined, as though it’s been dragged into the 21st century. It used to take around 2 and half hours to sign up a candidate, but with EZ-ILR, I can now do it in under an hour!"'
  mytext[3]='"Signing up multiple candidates (from the same employer) is miles faster; using EZ-ILR I did 5 signups in less than 2 hours recently."'
  mytext[4]='"I’ve found EZ-ILR a really useful tool; it’s increased my data accuracy, reduced my paperwork and made the initial meeting with the employer an enjoyable experience, Oh, and people haven’t got to decipher my handwriting."'

  var mytext2=new Array()
  mytext2[1]='Sean Hepburn, Work Based Assessor, City of Bath College'
  mytext2[2]='Sean Hepburn, Work Based Assessor, City of Bath College'
  mytext2[3]='Sean Hepburn, Work Based Assessor, City of Bath College'
  mytext2[4]='Sean Hepburn, Work Based Assessor, City of Bath College'
  
  var ry=Math.floor(Math.random()*mytext.length)

  if (ry==0)
     ry=1
     document.write(''+'<p class="SmallQuote1">'+mytext[ry]+'</p>'+'<p class="SmallQuote2">'+mytext2[ry]+'</p>')
      
}

function random_text_clients2()
{
  var mytext=new Array()
  //specify random text below. You can have as many as you wish
  mytext[1]='"Very Professional"'
  mytext[2]='"Presentation and delivery were first class."'
  mytext[3]='"I liked the mix of accedemic theories and real world solutions"'
  mytext[4]='"Everything very good, very well organised."'
  mytext[5]='"The exercises were a good way of getting us to communicate as a group and to access our strenths and weaknesses."'
  mytext[6]='"Inspired me with confidence to try different approach to leading."'
  mytext[7]='"The teaching technique is one to be admired and used in future coaching sessions."'
  mytext[8]='"Provoked thoughts around general areas of learning within the company."'
  mytext[9]='"Great use of my time. Good value for money!!"'
  mytext[10]='"An excellent delivery method which encourages trainee interaction."'

  var mytext2=new Array()
  mytext2[1]='Robert Oldham, Uponor Ltd'
  mytext2[2]='Mervyn Hodgson, Ansec (UK) Ltd'
  mytext2[3]='Ann Coxall, Notts Dyslexia Soc'
  mytext2[4]='Amanda Marsden, Jacksons the Bakers'
  mytext2[5]='Andrew Brewer, Avoca Systems Ltd'
  mytext2[6]='Dave Yeomans, Acres Willington'
  mytext2[7]='Brian Roberts, Gardner Aerospace Ltd'
  mytext2[8]='Mark Scott, Fairfield Control Systems'
  mytext2[9]='Simon Meadows, Sterling Property Care Ltd'
  mytext2[10]='Brian Roberts, Gardner Aerospace Ltd'
  
  var ry=Math.floor(Math.random()*mytext.length)

  if (ry==0)
     ry=1
     document.write(''+mytext[ry]+'<p style="text-align:center; margin-bottom:8px;">'+mytext2[ry]+'</p>')
      
}

function random_text_clients3()
{
  var mytext=new Array()
  //specify random text below. You can have as many as you wish
  mytext[1]='"You had taken on board our comments of what the group would like to discuss. The style of training perfectly met the learning style of the group. Topics discussed were excellent and timing perfectly suited our needs. I gained much from the programme"'
  mytext[2]='"Very useful. Delivered in a relaxed and informal environment. Excellent use of "real-life" business examples."'
  mytext[3]='"The programme did everything it was designed to do."'
  mytext[4]='"Very professionally run course, clearly delivered and at a good pace."'
  mytext[5]='"Enjoyed the fact that this was very much an interacting group learning from each other as well as the trainer."'
  mytext[6]='"Everything has been useful in different ways"'
  mytext[7]='"Great facilitator - thanks"'
  mytext[8]='"Every aspect was useful"'
  mytext[9]='"Good programme delivered in an interesting and professional manner."'
  mytext[10]='"Well presented, clear, understandable"'

  var mytext2=new Array()

  mytext2[1]='Sarah Stuart, Derwent Stepping Stones'
  mytext2[2]='Helen Richardson, Orbital Recruitment Limited'
  mytext2[3]='Rebecca Safhill-Barber, The Millstone Inn'
  mytext2[4]='Victoria Tabiner, Ethiprint'
  mytext2[5]='Adam Morris, Zibrant (IBR)'
  mytext2[6]='Sasha Nugent, Discovery Childcare'
  mytext2[7]='Liz Pattison, Food & Drink Forum'
  mytext2[8]='Carl Matts, Sherwood Press'
  mytext2[9]='Keith Walker, Fairfield Control Systems'
  mytext2[10]='David Charlton, The Mansfield Building Society'
  
  var ry=Math.floor(Math.random()*mytext.length)

  if (ry==0)
     ry=1
     document.write(''+mytext[ry]+'<p style="text-align:center; margin-bottom:8px;">'+mytext2[ry]+'</p>')
      
}
