var countbeginr = (document.cookie.indexOf("prodProblem")+ 12);
var countendr = (document.cookie.indexOf("prodProblem") + 13);
sValue = document.cookie.substring( countbeginr, countendr );
openThisDiv = 'problem'+ sValue;

if (sValue == '1') {
	bnGuides.get("Account_Updates_Billing", 5);
	$('.iaButtonOff:eq(0)').addClass("iaButtonSelected");
} else if (sValue == '2') {
	bnGuides.get("Employees_And_Employee_Taxes", 5);
	$('.iaButtonOff:eq(1)').addClass("iaButtonSelected");
} else if (sValue == '3') {
	bnGuides.get("Payroll_And_Direct_Deposit", 5);
	$('.iaButtonOff:eq(2)').addClass("iaButtonSelected");
} else if (sValue == '4') {
	bnGuides.get("Tax_Forms_And_Payroll_Liabilities", 5);
	$('.iaButtonOff:eq(3)').addClass("iaButtonSelected");
} else if (sValue == '5') {
	bnGuides.get("Software_Operations", 5);
	$('.iaButtonOff:eq(4)').addClass("iaButtonSelected");
} else if (sValue == '6') {
	bnGuides.get("Errors_And_Software_Troubleshooting", 5);
	$('.iaButtonOff:eq(5)').addClass("iaButtonSelected");
} else {
	bnGuides.get("Account_Updates_Billing", 5);
	$('.iaButtonOff:eq(0)').addClass("iaButtonSelected");
}  
iaLoadGuides(sValue)

function iaLoadGuides(sValue) {
	if (sValue == '1') {
		bnGuides.get("Account_Updates_Billing", 5);
	} else if (sValue == '2') {
		bnGuides.get("Employees_And_Employee_Taxes", 5);
	} else if (sValue == '3') {
		bnGuides.get("Payroll_And_Direct_Deposit", 5);
	} else if (sValue == '4') {
		bnGuides.get("Tax_Forms_And_Payroll_Liabilities", 5);
	} else if (sValue == '5') {
		bnGuides.get("Software_Operations", 5);
	} else if (sValue == '6') {
		bnGuides.get("Errors_And_Software_Troubleshooting", 5);
	} else {} 
	// $('.iaButtonOff:eq("sValue")').addClass("iaButtonSelected");
}

$(document).ready(function(){
    $(".iaButtonOff").hover(
      function () {
        $(this).removeClass("iaButtonOff");
        $(this).addClass("iaButtonOver");
      }, 
      function () {
    	  $(this).removeClass("iaButtonOver");
	      $(this).addClass("iaButtonOff");
      }
    );
    $(".iaButtonOff").click(function () { 
    	$(".iaButtonOff").removeClass("iaButtonSelected");
        $(this).addClass("iaButtonSelected"); 
        var iaIndex = $("#iaButtons #iab").index(this) + 1;
        iaSetCookieValue = 'prodProblem,' + iaIndex;
        setPRSCookie(iaSetCookieValue);
        iaLoadGuides(iaIndex);
      });	
});

