document.write("\<link rel=\'SHORTCUT ICON\' type=\'" + "image/x-icon" + "\' href=\'" + "http://www.apprenticeships.org.uk/favicon.ico" + "\' id=\'favIcon\' \/\>");

// JavaScript Document
function ddtabcontent(tabinterfaceid){
	this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
	this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") 
 //Get all tab links within container
	this.enabletabpersistence=true
	this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
	this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array
	this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)
	this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
	this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
}
ddtabcontent.getCookie=function(Name)
{ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}

ddtabcontent.setCookie=function(name, value)
{
	
	document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
}
function intiateTab()
{
   //var Tabs=document.getElementById('faqDiv').getElementsByTagName('a');
    //Tabs.className="inactive"
	document.getElementById('faqDiv').getElementsByTagName("div")[0].style.display="block";
}
function expandTabs(tab)
{
   //alert(activeTab);
	if (tab == null)
	{
	    return;
	}
	var divs=document.getElementById('faqDiv').getElementsByTagName("div");	
	var Tabs=document.getElementById('faqDiv').getElementsByTagName('a');

 
    for(var i=0; i<divs.length; i++)
	{
	   
	    Tabs[i].className="inactive";
		divs[i].style.display="none";
		
		
    }
    
		if(tab=="applist")
	    {
	       Tabs[0].className="active";
	        document.getElementById(tab).className="faqListActive";
	    }
	    else if(tab=="emplist")
	    {
	       Tabs[1].className="active";
	        document.getElementById(tab).className="faqListActive";
	    }
	    else
	    {
	       Tabs[2].className="active";
	        document.getElementById(tab).className="faqListActive";
	    }
	 	 
	 document.getElementById(tab).style.display="block";
		
}
ddtabcontent.prototype={
	
	init:function()
	{
		var tabs= document.getElementById('faqDiv').getElementsByTagName('a');
	    var divs=document.getElementById('faqDiv').getElementsByTagName("div");	
		intiateTab();
		expandTabs(tabs[0].getAttribute("rel"));
		//expandTabs('applist');				
		
		for(var i=0; i<tabs.length; i++)
		{
		   
			tabs[i].onclick=function()
			{					
				   //
					if(this.getAttribute("rel") != "")
					{
					   
					    //document.getElementById('faqDiv').getElementsByTagName('a').className="active"
						ddtabcontent.setCookie("tab", this.getAttribute("rel"));
						expandTabs(this.getAttribute("rel"));
					
						
						
					}
				}
			}
	}

} //END Prototype assignment


function adjustFontSize(inc)
{
        var old = GetFontSize();
        incrementFontSize(0-old);
        incrementFontSize(inc);
}
function incrementFontSize(inc)

{


      var heading = document.getElementsByTagName('h5');
        for(n=0; n<heading.length; n++) 
        {
          if(heading[n].style.fontSize) 
          
          {
           
            var size = parseInt(heading[n].style.fontSize.replace("px", ""));
            
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
           heading[n].style.fontSize = size+ 'px';
        }


       
        var p = document.getElementsByTagName('p');
        for(n=0; n<p.length; n++) 
        {
          if(p[n].style.fontSize) 
          {
            var size = parseInt(p[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
           p[n].style.fontSize = size+ 'px';
        }
        
        var a = document.getElementsByTagName('a');
        var i = 0;
        for(n=0; n<a.length; n++) 
        {
          if (a[n].className != "doNotChangeFont")
          {
              if(a[n].style.fontSize) 
              {
                var size = parseInt(a[n].style.fontSize.replace("px", ""));
              } 
              else 
              {
                var size = 12;
                
               }
               size = size + parseInt(inc);
               
               a[n].style.fontSize = size+ 'px';
           }
        }
        
        var Li = document.getElementsByTagName('li');
        for(n=0; n<Li.length; n++) 
        {
           if(Li[n].style.fontSize) 
          {
            var size = parseInt(Li[n].style.fontSize.replace("px", ""));
          } 
           else 
          {
          
             var size = 12;
            
           }
           size = size + parseInt(inc);
           
           Li[n].style.fontSize = size+ 'px';
        }
        
        var s = document.getElementsByTagName('span');
         
        for(n=0; n<s.length; n++) 
        {
           if(s[n].style.fontSize) 
          {
            var size = parseInt(s[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
           s[n].style.fontSize = size+ 'px';
        }
        
        var l = document.getElementsByTagName('label');
         
        for(n=0; n<l.length; n++) 
        {
            if(l[n].style.fontSize) 
          {
            var size = parseInt(l[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
          l[n].style.fontSize = size+ 'px';
        }
        
        var td = document.getElementsByTagName('td');
         
        for(n=0; n<td.length; n++) 
        {
            if(td[n].style.fontSize) 
          {
            var size = parseInt(td[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
           td[n].style.fontSize = size+ 'px';
        }
        
        var bold = document.getElementsByTagName('b');
         
        for(n=0; n<bold.length; n++) 
        {
           if(bold[n].style.fontSize) 
          {
            var size = parseInt(bold[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
           bold[n].style.fontSize = size+ 'px';
        }
        
         var List = document.getElementsByTagName('ul');
         
        for(n=0; n<List.length; n++) 
        {
           if(List[n].style.fontSize) 
          {
            var size = parseInt(List[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
           List[n].style.fontSize = size+ 'px';
        }
        
        
        
        SaveFontSize(inc);
}
//-----Ramesh ----//

function SetFont()
{
       var i = 0;
       var inc = 12
       inc = GetFontSize();
        
       var heading = document.getElementsByTagName('h5');
       
        for(n=0; n<heading.length; n++) 
        {
          
          if(heading[n].style.fontSize) 
          {
            var size = parseInt(heading[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;            
          }
                    
           
            size = size + parseInt(inc);
           
             
             if(heading[n].id.substring(0,10) == "changeFont" && inc == "0")
             {       
                      
                heading[n].style.fontSize = 11+ 'px';
                           
             }
             else if(heading[n].className.substring(0,10) == "changeFont" && inc == "0")
             {       
                      
                heading[n].style.fontSize = 14+ 'px';
                           
             }
             else if(heading[n].id.substring(0,5) == "hFont" && inc == "0")
             {       
                      
                heading[n].style.fontSize = 14+ 'px';
                           
             }
             else
             {
               heading[n].style.fontSize = size+ 'px';
             } 
        }

        var p = document.getElementsByTagName('p');
        for(n=0; n<p.length; n++) 
        {
          if(p[n].style.fontSize) 
          {
            var size = parseInt(p[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           
             size = size + parseInt(inc);
             if(p[n].id.substring(0,7) == "newFont" && inc == "0")
             {             
               p[n].style.fontSize = 11+ 'px';
             }
             else
             {
              p[n].style.fontSize = size+ 'px';
             } 
        }
        
        var a = document.getElementsByTagName('a');
        var i = 0;
        
        for(n=0; n<a.length; n++) 
        {
          if (a[n].className != "doNotChangeFont")
          {
              if(a[n].style.fontSize) 
              {
                var size = parseInt(a[n].style.fontSize.replace("px", ""));            
              } 
              else 
              {
                 var size = 12;
              }
              size = size + parseInt(inc);
              if(a[n].id.substring(0,4) == "Font" && inc == "0")
              {           
                   a[n].style.fontSize = 11+ 'px';
              }
              else if (a[n].id.substring(0,10) == "changeFont" && inc >= "0" )
              {
                    
                   a[n].style.fontSize = 24+ 'px'; 
                                  
              }
              //check
              else if (a[n].className.substring(0,10) == "changeFont" && inc >= "0" )
              {
                    
                   a[n].style.fontSize = 24+ 'px'; 
                                  
              }
              else if (a[n].id.substring(0,5) == "nFont" && inc >= "0")
              {
                   a[n].style.fontSize = 15+ 'px';                
              }
              else 
              {   
                   if(inc != "0")
                   {
                     a[n].style.fontSize = size+ 'px';
                                              
                   }
              } 
          }        
       }        

        var s = document.getElementsByTagName('span');
         
        for(n=0; n<s.length; n++) 
        {
           if(s[n].style.fontSize) 
          {
            var size = parseInt(s[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
             size = size + parseInt(inc);
             if(s[n].id.substring(0,7) == "newFont" || s[n].id.substring(0,11) == "newFontRss1" || s[n].id.substring(0,11) == "newFontRss2"&& inc == "0")
             {
               s[n].style.fontSize = 11+ 'px';
             }
             else
             {
              s[n].style.fontSize = size+ 'px';
             } 
        }
        
        var l = document.getElementsByTagName('label');
         
        for(n=0; n<l.length; n++) 
        {
            if(l[n].style.fontSize) 
          {
            var size = parseInt(l[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
           l[n].style.fontSize = size+ 'px';
        }
        
        var td = document.getElementsByTagName('td');
         
        for(n=0; n<td.length; n++) 
        {
            if(td[n].style.fontSize) 
          {
            var size = parseInt(td[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
           td[n].style.fontSize = size+ 'px';
        }
        
        var bold = document.getElementsByTagName('b');
         
        for(n=0; n<bold.length; n++) 
        {
           if(bold[n].style.fontSize) 
          {
            var size = parseInt(bold[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
           bold[n].style.fontSize = size+ 'px';
        }
        
        var List = document.getElementsByTagName('ul');
        for(n=0; n<List.length; n++) 
        {
           if(List[n].style.fontSize) 
          {
            var size = parseInt(List[n].style.fontSize.replace("px", ""));
          } 
          else 
          {
            var size = 12;
            
           }
           size = size + parseInt(inc);
           
           List[n].style.fontSize = size+ 'px';
        }
        
        
        var Li = document.getElementsByTagName('li');
        for(n=0; n<Li.length; n++) 
        {
           if(Li[n].style.fontSize) 
          {
            var size = parseInt(Li[n].style.fontSize.replace("px", ""));
          } 
            else 
           {
            var size = 12;
            
           }
           size = size + parseInt(inc);
             if(Li[n].id.substring(0,7) == "newFont" && inc == "0")
             {
               Li[n].style.fontSize = 12+ 'px';
             }
             else
             {
              Li[n].style.fontSize = size+ 'px';
             } 
           
           //size = size + parseInt(inc);
           
          // Li[n].style.fontSize = size+ 'px';
        }
        
        AppendQueryStringForSecondaryDevices();
        SaveFontSize(inc);
        
        
}

function AppendQueryStringForSecondaryDevices()
{
    
    var href, subString;
    var anchors = document.getElementsByTagName("a");
    var windowLocation = window.location;
    // Check if the current version of the site is for secondary devices.
    if (windowLocation.href.indexOf("?p=2") > 0)
    {
        for (counter =0; counter < anchors.length; counter++)
        {
              // Consider only those anchors that are internal links. Meaning they have the same host as the window.location. Further check if the Urls already have a query strng.
              if (windowLocation.hostname == anchors[counter].hostname && anchors[counter].href.indexOf("?p=2") <= 0 && anchors[counter].className != "doNotAppendQueryString")
              {
                  // Next check if the anchors already have a query string. If so append the querystring with an "&" 
                  if (anchors[counter].href.indexOf("?") > 0 )
                  {
                        // secondary devices would not work if p=2 is not the first querystring. So
                        var split = anchors[counter].href.split("?");
                        anchors[counter].href = split[0] + "?p=2" + "&" + split[1];                        
                  }
                  else
                  {
                        anchors[counter].href = anchors[counter].href + "?p=2";
                  }  
              }              
        }
    }
   
}

function wOpen()
{
 window.location.href('contactus.aspx');
}


function SaveFontSize(inc) 
{
    CreateCookie("myappfont", inc, 365, false);
}
function GetFontSize() 
{
    return getCookie("myappfont");
}
//end colour picker
function CreateCookie(name,value,days,useLang) 
{

  var langString = useLang ? GetLang() : "";

  var cookie = name + langString + "=" + value + ";";

  if (days) 
  {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    cookie += " expires=" + date.toGMTString() + ";";
  }
  cookie += " path=/";
  document.cookie = cookie;
}

function GetLang()
{
  var langString = "";

  if (document.documentElement){
    langString = document.documentElement.lang;
    if (langString != ""){
      langString = "-" + langString;
    }
  }  
  return langString;
}

function getCookie(name)
{
if (document.cookie.length>0)
  {
  var c_start=document.cookie.indexOf(name + "=");
  if (c_start!=-1)
    { 
      c_start=c_start + name.length+1; 
      c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
      return document.cookie.substring(c_start,c_end);
    } 
  }
return 0;
}

function createDIV()
{
    document.write("<div id='columnsDiv'>");  
}
function homeDiv()
{
    document.write("<div class='block_margin'>");
}
function closeDIV()
{
    document.write("</div>");
}
function sectionDiv()
{
  document.write("<div class='sectionblock_margin'>");
}
function createSectionDIV()
{
document.write("<div class='sectionblock_holder'>");
}

function testEmail() 
{
  alert(document.getElementById('txtSenderEmail').value);
   
   
       var EmailID1=document.getElementById('txtSenderEmail').value;
       var EmailID2=document.getElementById('txtRecipientEmail').value;
       var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
        var TestMail;
       if(EmailID1 != '')
       {
          TestMail=regex.test(EmailID1); 
       }
       else if(EmailID2!= '')
       {
         TestMail=regex.test(EmailID2); 
       }
       if(!TestMail)
       {
         alert('Inavlid Email'); 
       }
       return true;
  
}

function validateEmail()
{
alert("Sample");


    alert(document.getElementById('<%=txtSenderEmail.ClientID%>'));
//    var email1 = document.getElementById('txtSenderEmail').value; 
//    var email2 =  document.getElementById('txtRecipientEmail').value;
//    var emailRegEx = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
//       
//    if(email1 != '' &&  email2 !='')
//    {
//    
//        if(!email1.match(emailRegEx) && email2.match(emailRegEx))
//        {
//          alert('Please enter a valid email address.');
//          return false;
//        }
//      
//   }
//}
}
      
      
function LoadPeerRating()
{    
}







// expand individual qestions 

function expandIndividualQuestions(div,h5tag)
{
   //collapseAll();
   var identity = document.getElementById(div); 
   var h5tags =document.getElementById(h5tag); 
   if(identity.className == 'qhide')
   {
     identity.className ='qopen';
   }
    else 
    {
      identity.className ='qhide';
    }
   
    if(h5tags.className == 'expand')
   {
     h5tags.className ='collapse';
     
   }
    else 
    {
      h5tags.className ='expand';
    }
}


//expand all divs 
 
function expandAll()
{
       var arrayOfDivs = document.getElementsByTagName("div");
       var arrayOfh4 = document.getElementsByTagName("h4");
       var arrayOfh5 = document.getElementsByTagName("h5");
       
       
       // for all h5 tags 
       
       for(i=0; i< arrayOfh5.length; i++)
       {
         if(arrayOfh5[i].className == 'expand')
         {
          arrayOfh5[i].className ='collapse';
         }
       } 
            
       
       
       //for all h4 tags 
       for(i=0; i< arrayOfh4.length; i++)
       {
         if(arrayOfh4[i].className == 'expand')
         {
          arrayOfh4[i].className ='collapse';
         }
       } 
            
            
         // for all divs       
        for(n=0; n<arrayOfDivs.length; n++) 
        {
          if(arrayOfDivs[n].className == 'qhide')
          {
            
             arrayOfDivs[n].className ='qopen';
             
           } 

        }
}  
    



// collapse all divs 

function collapseAll()

{
        var arrayOfDivs = document.getElementsByTagName("div");
        var arrayOfh4 = document.getElementsByTagName("h4");
        var arrayOfh5 = document.getElementsByTagName("h5");
        
        // for all h5 tags 
        for(i=0; i< arrayOfh5.length; i++)
       {
         if(arrayOfh5[i].className == 'collapse')
         {
          arrayOfh5[i].className ='expand';
         }
       } 
        
        
        //for all h4 tags 
       for(i=0; i< arrayOfh4.length; i++)
       {
         if(arrayOfh4[i].className == 'collapse')
         {
          arrayOfh4[i].className ='expand';
         }
       } 
       
       // for all divs tags 
        for(n=0; n<arrayOfDivs.length; n++) 
        {
          if(arrayOfDivs[n].className == 'qopen')
          {
             arrayOfDivs[n].className ='qhide';
            
          } 

        }
        
}



//expand group

function expandGroup(div,h4tag)
 {
   var identity = document.getElementById(div); 
   var h4tags=document.getElementById(h4tag); 
   if(identity.className == 'qhide')
   {
     identity.className ='qopen';
     
   }
    else 
    {
      identity.className ='qhide';
    }
   
   if(h4tags.className == 'expand')
   {
     h4tags.className ='collapse';
     
   }
   
    else 
    {
      h4tags.className ='expand';
    } 
   
}


function expandImg(div)
{
   var identity = document.getElementById(div); 
   if(identity.className == 'expand')
   {
     identity.className ='collapse';
     
   }
    else 
    {
      identity.className ='expand';
    }
   
}


function expandIndividualImg(div)
{
    var identity = document.getElementById(div); 
   if(identity.className == 'expand')
   {
     identity.className ='collapse';
     
   }
    else 
    {
      identity.className ='expand';
    }
   
}


function SubsectionDiv()
{

document.write("<div class='subSectionPadTop'>");
}

function SubsectionDiv1()
{
document.write("<div class='subSectionHolder'>");
}


