function candoW3CDOM() {
  var test = document.GetElementById;
  return ((test == true)?(false):(true));
}
function checkBrowserData() {
  var browserData = ['',0];
  var BAgent=navigator.userAgent.toLowerCase();
  var verNum = BAgent.charAt(BAgent.indexOf('msie') + 5);
  if(BAgent.indexOf('msie')!=-1) {
    var dealM = 'O';
    if(parseInt(verNum) >= 8) dealM = 'Y';
    browserData[0] = 'msie';
    browserData[2] = 'msie'+dealM;
  }
  if(BAgent.indexOf('opera')!=-1) {
    browserData[0] = 'opera';
  }
  browserData[1] = parseInt(verNum);
  return browserData;
}
function check_val(val, regexp) {
  var result = val.match(regexp);
  return (result != null)?true:false;
}
function scrollbars() {
  var BAgent=navigator.userAgent.toLowerCase();
  if(BAgent.indexOf('msie')!=-1) {
    document.body.style.scrollbarFaceColor="#FFFFFF";
    document.body.style.scrollbarArrowColor="#EE8120";
    document.body.style.scrollbarTrackColor="#EE8120";
    document.body.style.scrollbarShadowColor="#999999";
    document.body.style.scrollbarHighlightColor="#CCFFFF";
    document.body.style.scrollbar3dLightColor="#CCCCCC";
    document.body.style.scrollbarDarkShadowColor="#666666";
  }
}
function preload_images() {
  (new Image(795,295)).src = "./images/pages/banner00.jpg";
  (new Image(795,295)).src = "./images/pages/banner01.jpg";
  (new Image(795,295)).src = "./images/pages/banner02.jpg";
  (new Image(795,295)).src = "./images/pages/banner03.jpg";
  (new Image(795,295)).src = "./images/pages/banner04.jpg";
  (new Image(795,295)).src = "./images/pages/banner05.jpg";
  (new Image(795,295)).src = "./images/pages/banner06.jpg";
  (new Image(795,295)).src = "./images/pages/banner07.jpg";
  (new Image(795,295)).src = "./images/pages/banner08.jpg";
  (new Image(795,295)).src = "./images/pages/banner09.jpg";
  (new Image(795,295)).src = "./images/pages/banner10.jpg";
  (new Image(795,295)).src = "./images/pages/banner11.jpg";
}
function setMainLinkEvents() {
  if(candoW3CDOM()) {
    var MLData = [
      ['00','home'],
      ['01','whatwedo'],
      ['02','newsroom'],
      ['03','ourblog'],
      ['04','dropusaline'],
      ['05','coursejoin']
    ];
    var MLData_dd1 = [
   /**   ['00','ddwhatwedo1'], **/
      ['01','ddwhatwedo2'],
   /**   ['02','ddwhatwedo3'],
      ['03','ddwhatwedo4'],
      ['04','ddwhatwedo5'],
      ['05','ddwhatwedo6'],
      ['06','ddwhatwedo7'], **/
      ['07','ddwhatwedo8'],
	  ['08','ddwhatwedo9'],
	  ['09','ddwhatwedo10']
    ];
    var MLData_spl = [
      ['00','login'],
      ['01','enrol']
    ];
    var MLData_cd1 = [
     ['00','coursejoin1'],
     ['01','coursejoin2']
    ];
    var n99 = 0;
    for(n99 = 0; n99 < MLData.length; n99++) {
      var focusfunc = 'if(!check_val(document.enrolform0cd.getElementById(\'linkcell'+MLData[n99][0]+'inner\').className,/currentLocn/g)) {'+
          'document.enrolform0cd.getElementById(\'linkcell'+MLData[n99][0]+'inner\').className = \''+MLData[n99][1]+'link\'+\' activeLocn\';  }';
      var blurfunc = 'if(!check_val(document.getElementById(\'linkcell'+MLData[n99][0]+'inner\').className,/currentLocn/g)) {'+
          'document.getElementById(\'linkcell'+MLData[n99][0]+'inner\').className = \''+MLData[n99][1]+'link\';  }';
      document.getElementById('link'+MLData[n99][0]).onmouseover=new Function(focusfunc);
      document.getElementById('link'+MLData[n99][0]).onmouseout=new Function(blurfunc);
      document.getElementById('link'+MLData[n99][0]).onfocus=new Function(focusfunc);
      document.getElementById('link'+MLData[n99][0]).onblur=new Function(blurfunc);
    }
    for(n99 = 0; n99 < MLData_dd1.length; n99++) {
      var focusfunc = 'if(!check_val(document.getElementById(\'ddl01linkcell'+MLData_dd1[n99][0]+'inner\').className,/currentLocn/g)) {'+
          'document.getElementById(\'ddl01linkcell'+MLData_dd1[n99][0]+'inner\').className = \''+MLData_dd1[n99][1]+'link\'+\' ddlactiveLocn\';  }';
      var blurfunc = 'if(!check_val(document.getElementById(\'ddl01linkcell'+MLData_dd1[n99][0]+'inner\').className,/currentLocn/g)) {'+
          'document.getElementById(\'ddl01linkcell'+MLData_dd1[n99][0]+'inner\').className = \''+MLData_dd1[n99][1]+'link\';  }';
      document.getElementById('ddl01link'+MLData_dd1[n99][0]).onmouseover=new Function(focusfunc);
      document.getElementById('ddl01link'+MLData_dd1[n99][0]).onmouseout=new Function(blurfunc);
      document.getElementById('ddl01link'+MLData_dd1[n99][0]).onfocus=new Function(focusfunc);
      document.getElementById('ddl01link'+MLData_dd1[n99][0]).onblur=new Function(blurfunc);
    }
    
    for(n99 = 0; n99 < MLData_spl.length; n99++) {
      if(document.getElementById('splink'+MLData_spl[n99][0])) {
      var focusfunc = 'if(!check_val(document.getElementById(\'splinkcell'+MLData_spl[n99][0]+'inner\').className,/currentLocn/g)) {'+
          'document.getElementById(\'splinkcell'+MLData_spl[n99][0]+'inner\').className = \''+MLData_spl[n99][1]+'link\'+\' activeLocn\';  }';
      var blurfunc = 'if(!check_val(document.getElementById(\'splinkcell'+MLData_spl[n99][0]+'inner\').className,/currentLocn/g)) {'+
          'document.getElementById(\'splinkcell'+MLData_spl[n99][0]+'inner\').className = \''+MLData_spl[n99][1]+'link\';  }';
      document.getElementById('splink'+MLData_spl[n99][0]).onmouseover=new Function(focusfunc);
      document.getElementById('splink'+MLData_spl[n99][0]).onmouseout=new Function(blurfunc);
      document.getElementById('splink'+MLData_spl[n99][0]).onfocus=new Function(focusfunc);
      document.getElementById('splink'+MLData_spl[n99][0]).onblur=new Function(blurfunc);
      }
    }
  }
}
function setHomePageEvents() {
  if(candoW3CDOM()) {
    document.getElementById('hmarticlelink00').onclick=new Function(
      'msg=window.open(\'pdfs/what_is_online_reputation_management_and_social_media_marketing.pdf\', '+
      '\'nrarticle00\', \'width=640,height=480,status=yes,resizable=yes\');  return false;');
  }
}
function setNewsRoomEvents() {
  if(candoW3CDOM()) {
    document.getElementById('nrarticlelink00').onclick=new Function(
      'msg=window.open(\'/pdfs/The_Ethics_of_Online_Reputation_Management.pdf\', '+
      '\'nrarticle00\', \'width=640,height=480,status=yes,resizable=yes\');  return false;');
    document.getElementById('nrarticlelink01').onclick=new Function(
      'msg=window.open(\'/pdfs/The_Top_10_Ways_to_Manage_Your_Online_Reputation.pdf\', '+
      '\'nrarticle00\', \'width=640,height=480,status=yes,resizable=yes\');  return false;');
    document.getElementById('nrarticlelink02').onclick=new Function(
      'msg=window.open(\'/pdfs/What_Is_Online_Reputation_Management_and_Social_Media_Marketing.pdf\', '+
      '\'nrarticle00\', \'width=640,height=480,status=yes,resizable=yes\');  return false;');
    document.getElementById('nrbloglink00').onclick=new Function(
      'msg=window.open(\'http://tigertwotiger.co.uk/\', '+
      '\'nrarticle00\', \'width=800,height=600,status=yes,resizable=yes\');  return false;');
  }
}
function setLoginPageEvents() {
  if(candoW3CDOM()) {
    var focusfunc = '';
    var blurfunc = '';

    var cBD = checkBrowserData();

    focusfunc = 'this.setAttribute(\'class\',\'ullink0_a\');';
    blurfunc = 'this.setAttribute(\'class\',\'ullink0\');';
    if(cBD[2] == 'msieO') {
      focusfunc = 'this.className = \'ullink0_a\';';
      blurfunc = 'this.className = \'ullink0\';';
    }
    document.getElementById('enrollink0').onmouseover=new Function(focusfunc);
    document.getElementById('enrollink0').onmouseout=new Function(blurfunc);
    document.getElementById('enrollink0').onfocus=new Function(focusfunc);
    document.getElementById('enrollink0').onblur=new Function(blurfunc);

    document.getElementById('loginform0unlabelc').style.display='none';
    document.getElementById('loginform0pwlabelc').style.display='none';
    if(document.getElementById('loginform0un').value == '') document.getElementById('loginform0un').value='USER NAME';
    document.getElementById('loginform0un').onfocus=new Function('if(this.value==\'USER NAME\') { this.value=\'\'; }');

    var fpwFunc = 'document.getElementById(\'loginform0pw\').style.display=\'inline\';  '+
    'document.getElementById(\'loginform0pw\').focus();  this.size=\'1\';  '+
    'this.style.display=\'none\';  var tpar = document.getElementById(\'loginform0pwfieldc\');  '+
    'tpar.removeChild(tpar.lastChild);';
    if(cBD[2] == 'msieO') {
      var fakepw = '<input type=\"text\" value=\"PASSWORD\" class=\"loginform0pw\" onfocus=\"'+fpwFunc+'\" />';
      document.getElementById('loginform0pwfieldc').innerHTML += fakepw;
    } else {
      var fakepw = document.createElement('input');
      fakepw.setAttribute('type','text');
      fakepw.setAttribute('value','PASSWORD');
      fakepw.setAttribute('class','loginform0pw');
      fakepw.onfocus=new Function(fpwFunc);
      document.getElementById('loginform0pwfieldc').appendChild(fakepw);
    }
    document.getElementById('loginform0pw').style.display='none';

    focusfunc = 'this.setAttribute(\'class\',\'loginform0sub_a\');';
    blurfunc = 'this.setAttribute(\'class\',\'loginform0sub\');';
    if(cBD[2] == 'msieO') {
      focusfunc = 'this.className = \'loginform0sub_a\';';
      blurfunc = 'this.className = \'loginform0sub\';';
    }
    document.getElementById('loginform0sub').onmouseover=new Function(focusfunc);
    document.getElementById('loginform0sub').onmouseout=new Function(blurfunc);
    document.getElementById('loginform0sub').onfocus=new Function(focusfunc);
    document.getElementById('loginform0sub').onblur=new Function(blurfunc);

    document.getElementById('lgaboutclink00').onclick=new Function(
      'msg=window.open(\'pdfs/TigerTwo_Course_Info.pdf\', '+
      '\'lgaboutclink00\', \'width=640,height=480,status=yes,resizable=yes\');  return false;');
  }
}
function setEnrolPageEvents() {
  if(candoW3CDOM()) {
    var focusfunc = '';
    var blurfunc = '';
    document.getElementById('enrolform0fnlabelc').style.display='none';
    document.getElementById('enrolform0lnlabelc').style.display='none';
    document.getElementById('enrolform0cnlabelc').style.display='none';
    document.getElementById('enrolform0emlabelc').style.display='none';
    document.getElementById('enrolform0tllabelc').style.display='none';
    document.getElementById('enrolform0cdlabelc').style.display='none';

    var cBD = checkBrowserData();

    if(document.getElementById('enrolform0fn').value == '') document.getElementById('enrolform0fn').value='FIRST NAME';
    document.getElementById('enrolform0fn').onfocus=new Function('if((this.value==\'FIRST NAME\') || (this.value==\'* First Name Blank *\') || (this.value==\'* First Name Invalid *\')) { this.value=\'\'; }');
    if(document.getElementById('enrolform0ln').value == '') document.getElementById('enrolform0ln').value='SURNAME';
    document.getElementById('enrolform0ln').onfocus=new Function('if((this.value==\'SURNAME\') || (this.value==\'* Surname Blank *\') || (this.value==\'* Surname Invalid *\')) { this.value=\'\'; }');
    if(document.getElementById('enrolform0cn').value == '') document.getElementById('enrolform0cn').value='COMPANY NAME (OPTIONAL)';
    document.getElementById('enrolform0cn').onfocus=new Function('if(this.value==\'COMPANY NAME (OPTIONAL)\') { this.value=\'\'; }');
    if(document.getElementById('enrolform0em').value == '') document.getElementById('enrolform0em').value='E-MAIL';
    document.getElementById('enrolform0em').onfocus=new Function('if((this.value==\'E-MAIL\') || (this.value==\'* e-Mail Blank *\') || (this.value==\'* e-Mail Invalid *\')) { this.value=\'\'; }');
    if(document.getElementById('enrolform0tl').value == '') document.getElementById('enrolform0tl').value='TELEPHONE';
    document.getElementById('enrolform0tl').onfocus=new Function('if((this.value==\'TELEPHONE\') || (this.value==\'* Telephone no. Blank *\') || (this.value==\'* Telephone no. Invalid *\')) { this.value=\'\'; }');

    if(cBD[2] == 'msieO') {
      var cdbuttonsc = '<div id=\"enrolform0cdbc00\"><span id=\"enrolform0cdbc00sp00\" style=\"display: none;\"> or alternatively, click a button: </span>';
    } else {
      var cdbuttonsc = document.createElement('div');
      cdbuttonsc.setAttribute('id','enrolform0cdbc00');
      var cdbuttonscsp = document.createElement('span');
      cdbuttonscsp.setAttribute('id','enrolform0cdbc00sp00');
      cdbuttonscsp.appendChild(document.createTextNode(' or alternatively, click a button: '));
      cdbuttonsc.appendChild(cdbuttonscsp);
      cdbuttonscsp.style.display = 'none';
    }
    var btn_num = ((cdttt.length <= 5)?(cdttt.length):(5));
    for(var cdi = 0; cdi < btn_num; cdi++) {
      focusfunc = 'if(!(this.getAttribute(\'class\') == \'enrolform0cdb_s\'))  this.setAttribute(\'class\',\'enrolform0cdb_a\');';
      blurfunc = 'if(!(this.getAttribute(\'class\') == \'enrolform0cdb_s\'))  this.setAttribute(\'class\',\'enrolform0cdb\');';
      onclickfunc = 'document.getElementById(\'enrolform0cd\').options['+(cdi+1)+'].selected=true;  '+
      'for(var cdi = 0; cdi < '+btn_num+'; cdi++) { '+
      'document.getElementById(\'enrolform0cdb\'+cdi).setAttribute(\'class\',\'enrolform0cdb\'); }  '+
      'this.setAttribute(\'class\',\'enrolform0cdb_s\');  return false;';
      if(cBD[2] == 'msieO') {
        focusfunc = 'if((this.className != \'enrolform0cdb_s\')) {  this.className=\'enrolform0cdb_a\';  }';
        blurfunc = 'if((this.className != \'enrolform0cdb_s\')) {  this.className=\'enrolform0cdb\';  }';
        onclickfunc = 'document.getElementById(\'enrolform0cd\').options['+(cdi+1)+'].selected=true;  '+
        'for(var cdi = 0; cdi < '+btn_num+'; cdi++) { '+
        'document.getElementById(\'enrolform0cdb\'+cdi).className = \'enrolform0cdb\'; }  '+
        'this.className = \'enrolform0cdb_s\';  return false;';
        cdbuttonsc += '<button id=\"enrolform0cdb'+cdi+'\" class=\"enrolform0cdb'+
        ((document.getElementById('enrolform0cd').selectedIndex == (cdi+1))?('_s'):(''))+
        '\" value=\"'+cdttt[cdi]+'\" '+
        'onmouseover=\"'+focusfunc+'\" onmouseout=\"'+blurfunc+'\" '+
        'onfocus=\"'+focusfunc+'\" onblur=\"'+blurfunc+'\" '+
        'onclick=\"'+onclickfunc+'\">'+cdttt[cdi]+'</button>';
      } else {
        var cdbutton = document.createElement('button');
        cdbutton.setAttribute('id','enrolform0cdb'+cdi);
        cdbutton.setAttribute('class','enrolform0cdb'+((document.getElementById('enrolform0cd').selectedIndex == (cdi+1))?('_s'):('')) );
        cdbutton.setAttribute('value', cdi);
        cdbutton.appendChild(document.createTextNode(cdttt[cdi]));
        cdbutton.onmouseover=new Function(focusfunc);
        cdbutton.onmouseout=new Function(blurfunc);
        cdbutton.onfocus=new Function(focusfunc);
        cdbutton.onblur=new Function(blurfunc);
        cdbutton.onclick=new Function(onclickfunc);
        cdbuttonsc.appendChild(cdbutton);
      }
    }
    if(cBD[2] == 'msieO') {
      cdbuttonsc += '</div>';
      document.getElementById('enrolform0cdc00').innerHTML += cdbuttonsc;
    } else {
      document.getElementById('enrolform0cdc00').appendChild(cdbuttonsc);
    }
    document.getElementById('enrolform0cdfieldc').style.display = 'none';

    focusfunc = 'this.setAttribute(\'class\',\'enrolform0sub_a\');';
    blurfunc = 'this.setAttribute(\'class\',\'enrolform0sub\');';
    if(cBD[2] == 'msieO') {
      focusfunc = 'this.className = \'enrolform0sub_a\';';
      blurfunc = 'this.className = \'enrolform0sub\';';
    }
    document.getElementById('enrolform0sub').onmouseover=new Function(focusfunc);
    document.getElementById('enrolform0sub').onmouseout=new Function(blurfunc);
    document.getElementById('enrolform0sub').onfocus=new Function(focusfunc);
    document.getElementById('enrolform0sub').onblur=new Function(blurfunc);
  }
}



function setEnrolPaymentPageEvents() {
  if(candoW3CDOM()) {
    var cBD = checkBrowserData();
  }
}
function setEnrolCompletePageEvents() {
  if(candoW3CDOM()) {
    var cBD = checkBrowserData();
    var focusfunc = 'this.setAttribute(\'class\',\'lglink0_a\');';
    var blurfunc = 'this.setAttribute(\'class\',\'lglink0\');';
    if(cBD[2] == 'msieO') {
      focusfunc = 'this.className = \'lglink0_a\';';
      blurfunc = 'this.className = \'lglink0\';';
    }
    document.getElementById('loginlink0').onmouseover=new Function(focusfunc);
    document.getElementById('loginlink0').onmouseout=new Function(blurfunc);
    document.getElementById('loginlink0').onfocus=new Function(focusfunc);
    document.getElementById('loginlink0').onblur=new Function(blurfunc);
  }
}
function setCourseMainPageEvents(itemcount) {
  if(candoW3CDOM()) {
    var cBD = checkBrowserData();
    var n99 = 0;
    var focusfunc = 'this.setAttribute(\'class\',\'weeklistitem0a_a\');';
    var blurfunc = 'this.setAttribute(\'class\',\'weeklistitem0a_s\');';
    if(cBD[2] == 'msieO') {
      focusfunc = 'this.className = \'weeklistitem0a_a\';';
      blurfunc = 'this.className = \'weeklistitem0a_s\';';
    }
    for(n99 = 0; n99 < itemcount; n99++) {
      document.getElementById('wli0a'+(n99+1)).onmouseover=new Function(focusfunc);
      document.getElementById('wli0a'+(n99+1)).onmouseout=new Function(blurfunc);
      document.getElementById('wli0a'+(n99+1)).onfocus=new Function(focusfunc);
      document.getElementById('wli0a'+(n99+1)).onblur=new Function(blurfunc);
    }
    focusfunc = 'this.setAttribute(\'class\',\'dflink0_a\');';
    blurfunc = 'this.setAttribute(\'class\',\'dflink0\');';
    if(cBD[2] == 'msieO') {
      focusfunc = 'this.className = \'dflink0_a\';';
      blurfunc = 'this.className = \'dflink0\';';
    }
    document.getElementById('forumlink0').onmouseover=new Function(focusfunc);
    document.getElementById('forumlink0').onmouseout=new Function(blurfunc);
    document.getElementById('forumlink0').onfocus=new Function(focusfunc);
    document.getElementById('forumlink0').onblur=new Function(blurfunc);
  }
}
function setCourseWeekPageEvents() {
  if(candoW3CDOM()) {
    var cBD = checkBrowserData();
    var focusfunc = '';
    var blurfunc = '';
    for(n99 = 0; n99 < 4; n99++) {
      var onclickfunc='var openedOrNot=((document.getElementById(\'resourcelistitem0_'+(n99+1)+'\').getAttribute(\'class\') == \'resourcelistitem0\')?(true):(false));'+
      'if(!openedOrNot) {  for(var n97 = 0; n97 < 4; n97++) {  document.getElementById(\'resourcelistitem0_\'+(n97+1)).setAttribute(\'class\',\'resourcelistitem0_c\');  }  }'+
      'document.getElementById(\'resourcelistitem0_'+(n99+1)+'\').setAttribute(\'class\',\'resourcelistitem0\'+((openedOrNot)?(\'_c\'):(\'\')) );  '+
      'return false;';
      if(cBD[2] == 'msieO') {
        onclickfunc='var openedOrNot=((document.getElementById(\'resourcelistitem0_'+(n99+1)+'\').className == \'resourcelistitem0\')?(true):(false));'+
        'if(!openedOrNot) {  for(var n97 = 0; n97 < 4; n97++) {  document.getElementById(\'resourcelistitem0_\'+(n97+1)).className = \'resourcelistitem0_c\';  }  }'+
        'document.getElementById(\'resourcelistitem0_'+(n99+1)+'\').className = \'resourcelistitem0\'+((openedOrNot)?(\'_c\'):(\'\'));  '+
        'return false;';
        document.getElementById('resourcelistitem0_'+(n99+1)).className='resourcelistitem0_c';
      } else {
        document.getElementById('resourcelistitem0_'+(n99+1)).setAttribute('class','resourcelistitem0_c');
      }
      document.getElementById('resourcelistitem0_'+(n99+1)+'a').onclick=new Function(onclickfunc);
      var listItemParent = document.getElementById('resourcelistitem0_'+(n99+1));
      var listItemsParentDIV = listItemParent.getElementsByTagName('div');
      var listItemsParentUL = listItemsParentDIV[1].getElementsByTagName('ul');
      var listItemsParents = listItemsParentUL[0].getElementsByTagName('li');
      var listitemlinks = null;
      for(var lic0 = 0; lic0 < listItemsParents.length; lic0++) {
        listitemlinks = listItemsParents[lic0].getElementsByTagName('a');
        listitemlinks[0].onclick=new Function(
        'var hrefStr = \'\'+this.href;  msg=window.open(hrefStr, '+
        '\'Resource\', \'width=640,height=480,status=yes,resizable=yes\');  return false;');
      }
    }
    focusfunc = 'this.setAttribute(\'class\',\'mmlink0_a\');';
    blurfunc = 'this.setAttribute(\'class\',\'mmlink0\');';
    if(cBD[2] == 'msieO') {
      focusfunc = 'this.className = \'mmlink0_a\';';
      blurfunc = 'this.className = \'mmlink0\';';
    }
    document.getElementById('modmatlink0').onmouseover=new Function(focusfunc);
    document.getElementById('modmatlink0').onmouseout=new Function(blurfunc);
    document.getElementById('modmatlink0').onfocus=new Function(focusfunc);
    document.getElementById('modmatlink0').onblur=new Function(blurfunc);

    focusfunc = 'this.setAttribute(\'class\',\'dflink1_a\');';
    blurfunc = 'this.setAttribute(\'class\',\'dflink1\');';
    if(cBD[2] == 'msieO') {
      focusfunc = 'this.className = \'dflink1_a\';';
      blurfunc = 'this.className = \'dflink1\';';
    }
    document.getElementById('forumlink0').onmouseover=new Function(focusfunc);
    document.getElementById('forumlink0').onmouseout=new Function(blurfunc);
    document.getElementById('forumlink0').onfocus=new Function(focusfunc);
    document.getElementById('forumlink0').onblur=new Function(blurfunc);
  }
}