

$('.FAQTopic > a').click(function () { 
    $(this).next().toggleClass("highlight");
  });




/**
 * Added by Frederikke Jensen, Hume
 * 20 06 09
 *
 * CUNA insurance quoting
 *
 ***/
 
    function showQuote(mylink) {
      
      if (!window.focus)return true;
    
      var href;
      var windowName;
      var features;
      var screenHeight;
      var screenWidth;
      var top;
      var left;
      var isStringUrl;
      
      if (typeof(mylink) == 'string') {
        href=mylink;
        isStringUrl=true;
      }
      else {
        href=mylink.href;
        isStringUrl=false;
      }

      windowName = "QuoteMaster_" + new Date().getTime();
      screenWidth = 767;
      screenHeight = screen.availHeight - 95;
      
      top = (( screen.availHeight ) - screenHeight ) / 2; 
      left = (( screen.availWidth ) - screenWidth ) / 2; 

      features = "resizable=yes,toolbar=0,menubar=no,directories=no," +
                  "scrollbars=yes,location=no,top=" + top + 
                  ",left=" + left + ",width=" + screenWidth + 
                  ",height=" + screenHeight; 

      window.open(href, windowName, features);
      
      if( isStringUrl == false ) {
        return false;
      }
    }

/**
 * Added by Frederikke Jensen
 * 15 10 09
 *
 * Insurance online quote landing page
 *
 ***/
function gotoInsuranceForm(URL)
{
  if(URL == "https://direct.membercare.com.au/b2c/quotemaster_b2c/newQuote.action?orgId=323&riskType=HOME" || URL == "https://direct.membercare.com.au/b2c/quotemaster_b2c/newQuote.action?orgId=323&riskType=HOME")
  {
    targetname = "InsuranceQuote";
    var newWindow = window.open(URL,targetname,"toolbar=yes,menubar=no,location=no,hotkeys=no,directories=no,scrollbars=yes,resizable=yes,status=yes,personalbar=no,self.resizeTo(screen.availWidth,screen.availHeight)");

    if( newWindow == null || typeof(newWindow)=="undefined" ){
       top.location.href = "http://www.humebuild.com.au/We-have-detected-that-you-have-a-pop-up-blocker-installed/default.aspx";
    } else {
       newWindow.focus();
       top.location.href = "http://www.humebuild.com.au/Did-you-get-a-quote-online/default.aspx";
    }
  }
  else
  {
    top.location.href = URL;
  }
}

function gotoInsuranceFormMotor(URL)
{
  if(URL == "https://direct.membercare.com.au/b2c/quotemaster_b2c/newQuote.action?orgId=323&riskType=MOTOR" || URL == "https://direct.membercare.com.au/b2c/quotemaster_b2c/newQuote.action?orgId=323&riskType=MOTOR")
  {
    targetname = "InsuranceQuoteMotor";
    var newWindow = window.open(URL,targetname,"toolbar=yes,menubar=no,location=no,hotkeys=no,directories=no,scrollbars=yes,resizable=yes,status=yes,personalbar=no,self.resizeTo(screen.availWidth,screen.availHeight)");

    if( newWindow == null || typeof(newWindow)=="undefined" ){
       top.location.href = "http://www.humebuild.com.au/We-have-detected-that-you-have-a-pop-up-blocker-installed/default.aspx";
    } else {
       newWindow.focus();
       top.location.href = "http://www.humebuild.com.au/Did-you-get-a-quote-online/default.aspx";
    }
  }
  else
  {
    top.location.href = URL;
  }
}

/**
 * Added by Imad Sader
 * 18 02 08
 *
 * Drop Down buttons
 *
 ***/
function gotoLink(URL)
{
  var targetname = "IBANK3_1";
  if(URL == "https://ibank.humebuild.com.au/login.asp " || URL == "https://ibank.humebuild.com.au/login.asp")
  {
    var ScreenHeight
    var ScreenWidth
    ScreenHeight = screen.height;
    ScreenWidth = screen.width;

	if( window.name == targetname )
	{
		window.name = "";
	}

    var newWindow = window.open(URL,targetname,"toolbar=yes,menubar=no,location=no,hotkeys=no,directories=no,scrollbars=yes,resizable=yes,status=yes,personalbar=no,self.resizeTo(screen.availWidth,screen.availHeight)");

    if( newWindow == null || typeof(newWindow)=="undefined" ){
       top.location.href = "http://www.humebuild.com.au/We-have-detected-that-you-have-a-pop-up-blocker-installed/default.aspx";
    } else {
       newWindow.focus();
       top.location.href = "http://www.humebuild.com.au/default.aspx";
    }
  }
  else
  {
    top.location.href = URL;
  }
}

function goto(dropdown_id)
{
  dropdown = document.getElementById(dropdown_id);

  var myindex  = dropdown.selectedIndex;
  var selValue = dropdown.options[myindex].value;
  var targetname = "IBANK3_1";	// BM move variable
  // Reset the window name to null if window is targetname i.e. Force new window.
  if( window.name == targetname )
  {
     window.name = "";
  }

  if(selValue == "https://ibank.humebuild.com.au/login.asp " || selValue == "https://ibank.humebuild.com.au/login.asp")
  {
    var ScreenHeight
    var ScreenWidth
    ScreenHeight = screen.height;
    ScreenWidth = screen.width;
    var newWindow = window.open(selValue,targetname,"toolbar=yes,menubar=no,location=no,hotkeys=no,directories=no,scrollbars=yes,resizable=yes,status=yes,personalbar=no,self.resizeTo(screen.availWidth,screen.availHeight)");
    if( newWindow == null || typeof(newWindow)=="undefined" ){
       top.location.href = "http://www.humebuild.com.au/We-have-detected-that-you-have-a-pop-up-blocker-installed/default.aspx";
    } else {
       newWindow.focus();
       top.location.href = "http://www.humebuild.com.au/default.aspx";
    }
  }
  else
  {
    top.location.href = selValue;
  }
}



/**
 * Added by Imad Sader
 * 15 02 08
 *
 * Populate drop down options automatically
 *
 ***/

/** Populate dropdown lists ****/


populate('ibank', 'ibank_text');
populate('rates', 'rates_text');
populate('apply', 'apply_text');


function populate(dropdown_id, list_id)
{
  var dropdown = document.getElementById(dropdown_id);

  var list = document.getElementById(list_id);

  var j = 0;

  if(list)
  {
    var list_items = list.childNodes;

    for(var i=0; i<list_items.length; i++)
    {
      var item = list_items.item(i).innerHTML;

      if(item)
      {
        var text = item.substring(0,item.indexOf(','));
        var endOfURL = itemLength(item);
        var url = item.substring(item.indexOf(',') + 2, endOfURL);
        
        var myNewOption = new Option(text,url);
        dropdown.options[j] = myNewOption;
        j++;
      }
    }
  }
}

function itemLength(item)
{
    var length = item.length;
    //alert(length - 2);
    var lastSpace = item.lastIndexOf(" ");
    //alert(lastSpace);
    
    if((length - 2) == lastSpace)
    {
      return lastSpace;
    }
    else
    {
      return length;
    }
    return length;
}


function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}

 

// Use this to randomly set images in a section on your site

if (MM_findObj('youruniqueid')) {

  bannerSrcStart = 'Images/UserUploadedImages/11/image_prefix';
  bannerSrcEnd = '.jpg';
  maxRandomNumber = 18;
  randomNumber = Math.floor(Math.random()*maxRandomNumber) + 1;

  bannerSrc = bannerSrcStart + randomNumber + bannerSrcEnd;


  //use this line to set the images as a background image
  //MM_findObj('youruniqueid').style.backgroundImage = 'url(' + bannerSrc + ')';

  //use this line to set the images as an inline image
  MM_findObj('youruniqueid').innerHTML = '<img border=0 src=' + bannerSrc + '>';

}


//this is used to set the test to a bigger font size
//this looks for default things such as h1, h2, p, a tags
//may need to customise to your site

function bigFont() {

  if (!document.getElementById) 
    return;

  if (!document.getElementsByTagName) 
    return;

  var heading1 = document.getElementsByTagName("h1");
  var heading2 = document.getElementsByTagName("h2");
  var heading3 = document.getElementsByTagName("h3");
  var heading4 = document.getElementsByTagName("h4");
  var heading5 = document.getElementsByTagName("h5");
  var heading6 = document.getElementsByTagName("h6");

  for (var a=0; a<heading1.length; a++)
  {
    heading1[a].style.fontSize = "35px";
  }
  for (var e=0; e<heading2.length; e++)
  {
    heading2[e].style.fontSize = "25px";
  }
  for (var e=0; e<heading3.length; e++)
  { 
    heading3[e].style.fontSize = "20px";
  }
  for (var e=0; e<heading4.length; e++)
  {
    heading4[e].style.fontSize = "19px";
  }
  for (var e=0; e<heading5.length; e++)
  {
    heading5[e].style.fontSize = "18px";
  }
  for (var e=0; e<heading6.length; e++)
  {
    heading6[e].style.fontSize = "17px";
  }

  if (document.getElementById("tblContentTD1")) {

    var contentText = document.getElementById("tblContentTD1");

    var paraText = contentText.getElementsByTagName("p");
    var anchorText = contentText.getElementsByTagName("a");
    for (var x=0; x<paraText.length; x++)
    {
      paraText[x].style.fontSize = "17px";
    }
    for (var x=0; x<anchorText.length; x++)
    {
      anchorText[x].style.fontSize = "17px";
    }
  }

  var rightText = document.getElementsByTagName("p");

  for (var e=0; e<rightText.length; e++)
  {
    if (rightText[e].className == "actionBox")
    {
      rightText[e].style.fontSize = "13px";
      var anchorText = rightText[e].getElementsByTagName("a");
      for (var x=0; x<anchorText.length; x++)
      {
        anchorText[x].style.fontSize = "13px";
      }
    }
  }

  if (!document.getElementById("tblContentTD1")) {

    var normal = document.getElementsByTagName("td");

    for (var e=0; e<normal.length; e++)
    {
      if (normal[e].className == "clsNormal")
      {
        normal[e].style.fontSize = "17px";
      }
    }

    var altNormal = document.getElementsByTagName("a");

    for (var e=0; e<altNormal.length; e++)
    {
      if (altNormal[e].className == "clsNormal")
      {
        altNormal[e].style.fontSize = "17px";
      }
      else if (altNormal[e].className == "clsAltNormal")
      {
        altNormal[e].style.fontSize = "17px";
      }
      else if (altNormal[e].className == "clsMidHeader")
      {
        altNormal[e].style.fontSize = "25px";
      }
    }
  }
}


//this is used to set the test to the normal font size
//this looks for default things such as h1, h2, p, a tags
//may need to customise to your site

function normalFont() {

  if (!document.getElementById) 
    return;

  if (!document.getElementsByTagName) 
    return;

  var heading1 = document.getElementsByTagName("h1");
  var heading2 = document.getElementsByTagName("h2");
  var heading3 = document.getElementsByTagName("h3");
  var heading4 = document.getElementsByTagName("h4");
  var heading5 = document.getElementsByTagName("h5");
  var heading6 = document.getElementsByTagName("h6");

  for (var a=0; a<heading1.length; a++)
  {
    heading1[a].style.fontSize = "30px";
  }
  for (var e=0; e<heading2.length; e++)
  {
    heading2[e].style.fontSize = "20px";
  }
  for (var e=0; e<heading3.length; e++)
  {
    heading3[e].style.fontSize = "15px";
  }
  for (var e=0; e<heading4.length; e++)
  {
    heading4[e].style.fontSize = "14px";
  }
  for (var e=0; e<heading5.length; e++)
  {
    heading5[e].style.fontSize = "13px";
  }
  for (var e=0; e<heading6.length; e++)
  {
    heading6[e].style.fontSize = "12px";
  }

  if (document.getElementById("tblContentTD1")) {
  
    var contentText = document.getElementById("tblContentTD1");

    var paraText = contentText.getElementsByTagName("p");
    var anchorText = contentText.getElementsByTagName("a");
    for (var x=0; x<paraText.length; x++)
    {
      paraText[x].style.fontSize = "12px";
    }
    for (var x=0; x<anchorText.length; x++)
    {
      anchorText[x].style.fontSize = "12px";
    }
  }

  var rightText = document.getElementsByTagName("p");

  for (var e=0; e<rightText.length; e++)
  {
    if (rightText[e].className == "actionBox")
    {
      rightText[e].style.fontSize = "11px";
      var anchorText = rightText[e].getElementsByTagName("a");
      for (var x=0; x<anchorText.length; x++)
      {
        anchorText[x].style.fontSize = "11px";
      }
    }
  }

  if (!document.getElementById("tblContentTD1")) {

    var normal = document.getElementsByTagName("td");

    for (var e=0; e<normal.length; e++)
    {
      if (normal[e].className == "clsNormal")
      {
        normal[e].style.fontSize = "12px";
      }
    }

    var altNormal = document.getElementsByTagName("a");

    for (var e=0; e<altNormal.length; e++)
    {
      if (altNormal[e].className == "clsNormal")
      {
        altNormal[e].style.fontSize = "12px";
      }
      else if (altNormal[e].className == "clsAltNormal")
      {
        altNormal[e].style.fontSize = "12px";
      }
      else if (altNormal[e].className == "clsMidHeader")
      {
        altNormal[e].style.fontSize = "20px";
      }
    }
  }
}


