/*\
 * Array Functionality
 * script: array.js
 * for: browsers not implementing the full array functionality of ECMA262-3
\*/

if(typeof Array.prototype.copy=='undefined')
    Array.prototype.copy=function(a){
        var
            i=0,
            b=[];
        for(i;i<this.length;i++)
            b[i]=(typeof this[i].copy!='undefined')?
                this[i].copy():
                this[i];
        return b
    };

if(typeof Array.prototype.concat=='undefined')
    Array.prototype.concat=function(a){
        var
            i=0,
            b=this.copy();
        for(i;i<a.length;i++)
            b[b.length]=a[i];
        return b
    };
    
if(typeof Array.prototype.pop=='undefined')
    Array.prototype.pop=function(){
        var
            b=this[this.length-1];
        this.length--;
        return b
    };

if(typeof Array.prototype.push=='undefined')
    Array.prototype.push=function(){
        var
            i=0,
            b=this.length,
            a=arguments;
        for(i;i<a.length;i++)
            this[b+i]=a[i];
        return this.length
    };

if(typeof Array.prototype.shift=='undefined')
    Array.prototype.shift=function(){
        var
            i=0,
            b=this[0];
        for(i;i<this.length-1;i++)
            this[i]=this[i+1];
        this.length--;
        return b
    };

if(typeof Array.prototype.slice=='undefined')
    Array.prototype.slice=function(a,c){
        var
            i=0,
            b,
            d=[];
        if(!c)
            c=this.length;
        if(c<0)
            c=this.length+c;
        if(a<0)
            a=this.length-a;
        if(c<a){
            b=a;
            a=c;
            c=b
        }
        for(i;i<c-a;i++)
            d[i]=this[a+i];
        return d
    };

if(typeof Array.prototype.splice=='undefined')
    Array.prototype.splice=function(a,c){
        var
            i=0,
            e=arguments,
            d=this.copy(),
            f=a;
        if(!c)
            c=this.length-a;
        for(i;i<e.length-2;i++)
            this[a+i]=e[i+2];
        for(a;a<this.length-c;a++)
            this[a+e.length-2]=d[a-c];
        this.length-=c-e.length+2;
        return d.slice(f,f+c)
    };

if(typeof Array.prototype.unshift=='undefined')
    Array.prototype.unshift=function(a){
        var
            b;
        this.reverse();
        b=this.push(a);
        this.reverse();
        return b
    };



function rollSetup() {
 /** string added to "on" state images */
 var post = "_o";

 /** fetch the image tag array from the DOM */
 var imgTags = document.getElementsByTagName("img");

 /** loop through the images for find appropriate preloads */
 for (i=0; i < imgTags.length; i++) {
  /** make sure there is a source defined */
  if (imgTags[i].src != '') {
   /** make sure the image tag has a class */
   tmpClass = imgTags[i].className;
   if (tmpClass) {
    /** match the image rollover class */  
    if (tmpClass.match("rollover")) {
     /** store the image source to the 'imgOut' attribute */    
     imgTags[i].imgOut = new Image();
     imgTags[i].imgOut.src = imgTags[i].src;
	
     /** pull apart the source string */
     srcLength = imgTags[i].src.length;

     srcName = imgTags[i].src.substr(0, srcLength-4);
     srcExt = imgTags[i].src.substr(srcLength-4, srcLength);

     /** store the image source to the 'imgOver' attribute */
     imgTags[i].imgOver = new Image();
     imgTags[i].imgOver.src = srcName + post + srcExt;

     /** set up the 'onmouseover' and 'onmouseout' event handlers */     
     imgTags[i].onmouseover = function() {
      this.src = this.imgOver.src;
     }
     imgTags[i].onmouseout = function() {
      this.src = this.imgOut.src;
     }
    }
   }
  }
 }
}

function show(id) {
		var p = document.getElementById(id);
		p.style.display = "block";
	}

	function hide(id) {
		var p = document.getElementById(id);
		p.style.display = "none";
	}

if(typeof Array.prototype.splice=='undefined')
    Array.prototype.splice=function(a,c){
        var
            i=0,
            e=arguments,
            d=this.copy(),
            f=a;
        if(!c)
            c=this.length-a;
        for(i;i<e.length-2;i++)
            this[a+i]=e[i+2];
        for(a;a<this.length-c;a++)
            this[a+e.length-2]=d[a-c];
        this.length-=c-e.length+2;
        return d.slice(f,f+c)
    };

function stopError() {
  return true;
}

function getRandomNum(lbound, ubound) {
return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}

var timeDelay = 9500; // change delay time in seconds
var counter = 0;

function startPix(func) {
setInterval(func, timeDelay);
}

var init = false;
function slideshow() {
	if(init == false || choices.length == 0){
	//alert("creating array");
	choices = new Array("01.gif", "02.gif", "03.gif", "04.gif", "05.gif", "06.gif", "07.gif", "08.gif", "09.gif", "10.gif", "11.gif", "12.gif", "13.gif", "14.gif", "15.gif");
	init = true;
	}
	var path = "./img/quotes/"
	var selected= getRandomNum(0, choices.length);
	var imagePath =  choices.splice(selected,1);
	//alert("pic: "+imagePath + " length: "+choices.length);
	document.quote.src = path + imagePath;
}


var career_init = false;
function career_slideshow() {
	if(career_init == false || choices.length == 0){
	//alert("creating array");
	choices = new Array("01.gif", "02.gif", "03.gif", "04.gif", "05.gif", "06.gif", "07.gif", "08.gif", "09.gif");
	career_init = true;
	}
	var path = "./img/career_quotes/"
	var selected= getRandomNum(0, choices.length);
	var imagePath =  choices.splice(selected,1);
	//alert("pic: "+imagePath + " length: "+choices.length);
	document.quote.src = path + imagePath;
}

function archiveArticle(){
document.write("<form name=\"taxbitnavigator\">\n");
document.write("<select name=\"jump\" id=\"jump\" onChange=\"MM_jumpMenu('parent',this,0)\">\n");
document.write("<option value=\"\">Article Archive</option>\n");
document.write("<option value=\"article1.htm\">Reading Your Business</option>\n");
document.write("<option value=\"article2.htm\">New Jersey Contractor withholding requirements  and  Business Registration Certificates</option>\n");
document.write("</select></form>\n");
}

function archiveTaxbit(){
document.write("<form name=\"taxbitnavigator\">\n");
document.write("<select name=\"jump\" id=\"jump\" onChange=\"MM_jumpMenu('parent',this,0)\">\n");
document.write("<option value=\"\">Tax Tidbit Archive</option>\n");
document.write("<option value=\"taxbit35.htm\">07/10 - Health Savings Accounts</option>\n");
document.write("<option value=\"taxbit34.htm\">06/10 - Tax Breaks for Charity Volunteers</option>\n");
document.write("<option value=\"taxbit33.htm\">05/10 - Small Employer Health Insurance Credit</option>\n");
document.write("<option value=\"taxbit32.htm\">04/10 - Hiring Incentives to Restore Employment Act</option>\n");
document.write("<option value=\"taxbit31.htm\">03/10 - Tax Aspects of Self-Employment</option>\n");
document.write("<option value=\"taxbit30.htm\">02/10 - Haiti Assistance Income Tax Relief Act</option>\n");
document.write("<option value=\"taxbit29.htm\">01/10 - Worker, Homeownership and Business Assistance Act of 2009</option>\n");
document.write("<option value=\"taxbit28.htm\">12/09 - New Rollover Opportunities into Roth IRAs</option>\n");
document.write("<option value=\"taxbit27.htm\">11/09 - Sale of a Business Asset</option>\n");
document.write("<option value=\"taxbit26.htm\">10/09 - Simplified Employee Pension Retirement Plans</option>\n");
document.write("<option value=\"taxbit25.htm\">09/09 - Should your Business Operate as a Limited Liability Company?</option>\n");
document.write("<option value=\"taxbit24.htm\">08/09 - Deducting Business Website Costs</option>\n");
document.write("<option value=\"taxbit23.htm\">07/09 - Passive Activity Losses</option>\n");
document.write("<option value=\"taxbit22.htm\">06/09 - Job Hunting Expenses - Tax Deductions</option>\n");
document.write("<option value=\"taxbit21.htm\">05/09 - Tax Amnesty Program</option>\n");
document.write("<option value=\"taxbit20.htm\">04/09 - Losses on Ponzi-type Investment Schemes</option>\n");
document.write("<option value=\"taxbit19.htm\">03/09 - 2009 Recovery Act: Businesses</option>\n");
document.write("<option value=\"taxbit18.htm\">02/09 - Hiring Your Spouse as an Employee</option>\n");
document.write("<option value=\"taxbit17.htm\">01/09 - Business Trips That Mix Business with Pleasure</option>\n");
document.write("<option value=\"taxbit16.htm\">12/08 - 2008 Stabilization Act: Tax Changes Affecting Businesses</option>\n");
document.write("<option value=\"taxbit15.htm\">11/08 - 2008 Planning - Retirement Savings for the Self-Employed</option>\n");
document.write("<option value=\"taxbit14.htm\">10/08 - Exclusion on Gain of Sale of Personal Residence New Rules</option>\n");
document.write("<option value=\"taxbit13.htm\">09/08 - 2008 Planning - Home Office Deduction</option>\n");
document.write("<option value=\"taxbit12.htm\">08/08 - 2008 Housing Act - Homebuyer Credit</option>\n");
document.write("<option value=\"taxbit11.htm\">07/08 - 2008 Planning - Commonly Missed Business Tax Deductions</option>\n");
document.write("<option value=\"taxbit10.htm\">06/08 - 2008 Planning - Independent Contractor vs. Employee</option>\n");
document.write("<option value=\"taxbit9.htm\">02/08 - 2008 Economic Stimulus Act - Business Tax Incentives</option>\n");
document.write("<option value=\"taxbit8.htm\">01/08 - Fact Sheet On Hobby And Business Expenses</option>\n");
document.write("<option value=\"taxbit7.htm\">10/07 - Election To Expense Business Assets</option>\n");
document.write("<option value=\"taxbit6.htm\">08/07 - Audits - Travel & Entertainment Deductions</option>\n");
document.write("<option value=\"taxbit5.htm\">07/07 - Deducting The Cost of Your Computer Software</option>\n");
document.write("<option value=\"taxbit2.htm\">05/07 - Deducting Business Start-up and Expansion Expenses</option>\n");
document.write("<option value=\"taxbit3.htm\">02/07 - Federal Telephone Excise Tax Refund 2006 Business Tax Returns</option>\n");
document.write("<option value=\"taxbit4.htm\">12/06 - Are You Maximizing Your Auto Expenses For Your Business?</option>\n");
document.write("<option value=\"taxbit1.htm\">11/06 - Did You Know That Conserving Energy Can Reduce Your Taxes in 2006 & 2007?</option>\n");
document.write("</select></form>\n");
}

function archiveFTT(){
document.write("<form name=\"articlenavigator\">\n");
document.write("<select name=\"jump\" id=\"jump\" onChange=\"MM_jumpMenu('parent',this,0)\">\n");
document.write("<option value=\"\">News Archive</option>\n");
document.write("<option value=\"an35.htm\">6/28/10-  BK&Co. Manager Participates in Junior Achievement Event</option>\n");
document.write("<option value=\"an34.htm\">12/15/09-  BK&Co. Partners with YMCA for 2009 Angel Patrol</option>\n");
document.write("<option value=\"an33.htm\">4/23/09- BK&Co. Speaks at Merrill Lynch Seminar</option>\n");
document.write("<option value=\"an25.htm\">12/15/08- 2008 Angel Patrol</option>\n");
document.write("<option value=\"an26.htm\">12/15/08- BK&Co. Welcomes Rosemary Spicuzza</option>\n");
document.write("<option value=\"an32.htm\">12/10/08- BK&Co. Co-Sponsors 2008 Economic Forum</option>\n");
document.write("<option value=\"an27.htm\">11/19/08- BK&Co. Manager Presents Tax Planning Seminar</option>\n");
document.write("<option value=\"an24.htm\">10/21/08- BK&Co. to Co-Sponsor Card Club</option>\n");
document.write("<option value=\"an31.htm\">10/15/08- BK&Co. Welcomes Steven Strohl</option>\n");
document.write("<option value=\"an30.htm\">10/08/08- BK&Co. Welcomes Melanie Glagola</option>\n");
document.write("<option value=\"an23.htm\">9/23/08- BK&Co. Manager Presents to Trade Association</option>\n");
document.write("<option value=\"an21.htm\">7/01/08- BK&Co., CPA's, PC Gains Woodbridge Area Office</option>\n");
document.write("<option value=\"an19.htm\">6/06/08- BK & Co. Welcomes AnnaMaria LubranoLavadera</option>\n");
document.write("<option value=\"an22.htm\">6/01/08- BK&Co. Celebrates 15 Years</option>\n");
document.write("<option value=\"an28.htm\">5/31/08- BK&Co. Partner Appointed to Sun Advisory Board</option>\n");
document.write("<option value=\"an29.htm\">5/31/08- BK&Co. Partner Appointed as Treasurer for Hunterdon County Chamber of Commerce</option>\n");
document.write("<option value=\"an18.htm\">2/11/08- John R. Bedard, CPA Joins YMCA Board Of Trustees</option>\n");
document.write("<option value=\"an17.htm\">1/30/08- High School Students Get Inside Scoop about One of Today's Best Career Opportunities </option>\n");
document.write("<option value=\"an20.htm\">12/17/07- BK&amp;Co. Partners with YMCA for Angel Patrol</option>\n");
document.write("<option value=\"an15.htm\">12/28/07- BK&Co. Gains New Practice and Manager, Edward P. Portice, CPA </option>\n");
document.write("<option value=\"an14.htm\">12/04/07- BK&Co. Welcomes Patrick Lenahan </option>\n");
document.write("<option value=\"an13.htm\">11/28/07- BK&Co. Welcomes Stephen Prew </option>\n");
document.write("<option value=\"an11.htm\">10/26/07- BK&Co. Welcomes Grace Xu</option>\n");
document.write("<option value=\"an9.htm\">3/27/07- BK&Co. Manager Presents on Buying Real Estate</option>\n");
document.write("<option value=\"an7.htm\">2/21/07- BK&Co. Hires Alfia Fahrutdinova</option>\n");
document.write("<option value=\"an6.htm\">2/1/07- BK&Co. Passes Peer Review</option>\n");
document.write("<option value=\"an4.htm\">11/14/06- BK&Co. to Sponsors Doing Business with Goliath</option>\n");
document.write("<option value=\"an8.htm\">10/20/06- BK&Co. Welcomes Teresa Meisner</option>\n");
document.write("<option value=\"an3.htm\">10/16/06- BK&Co., Sr. Manager Presents on SAS No. 99</option>\n");
document.write("<option value=\"an5.htm\">9/18/06- BK&Co. Welcomes Diane Cifelli as a New Associate</option>\n");
document.write("<option value=\"an2.htm\">6/26/06- BK&Co. Partner Presents on the Tax Implications of Owning and Leasing Real Estate</option>\n");
document.write("<option value=\"an1.htm\">6/5/06- BK&Co. Welcomes Ryan P. Hintenach as a New Associate</option>\n");
document.write("</select></form>\n");
}

function archiveATN(){
document.write("<form name=\"articlenavigator\">\n");
document.write("<select name=\"jump\" id=\"jump\" onChange=\"MM_jumpMenu('parent',this,0)\">\n");
document.write("<option value=\"\">Archived Accounting and Tax News</option>\n");
document.write("<option value=\"atn14.htm\">Tax Breaks and Heartbreaks in New Law</option>\n");
document.write("<option value=\"atn13.htm\">New Jersey 2007 Budget Highlights</option>\n");
document.write("<option value=\"atn12.htm\">IRS Headquarters Building to Remain Closed for 30 Days; Tax Operations Continue</option>\n");
document.write("<option value=\"atn11.htm\">Governor Proposes Various Tax Increases in Fiscal Year 2007 Budget</option>\n");
document.write("<option value=\"atn10.htm\">FDIC Insurance Increase</option>\n");
document.write("<option value=\"atn9.htm\">IRS Cautions Taxpayers About Tax Scams</option>\n");
document.write("<option value=\"atn8.htm\">IRS releases 2006 Pension plan limitations</option>\n");
document.write("<option value=\"atn7.htm\">Social Security Benefits to Increase 4.1%</option>\n");
document.write("<option value=\"atn6.htm\">Presidents Tax Reform Panel Proposes Income, Consumption Taxes</option>\n");
document.write("<option value=\"atn5.htm\">IRS Launches Study of S Corporation Reporting Compliance</option>\n");
document.write("<option value=\"atn4.htm\">Fair Rebate And Property Tax Reimbursement Filing Deadline Extended To October 17 </option>\n");
document.write("<option value=\"atn3.htm\"><span class=\"red\">Tax Alert:</span> Estate Tax in Limbo</option>-->	  \n");
document.write("<!--<option value=\"atn2.htm\">Business Use of Cell Phones and other Portable Electronic Devices</option>  \n");
document.write("<option value=\"atn1.htm\">Recent NJ tax court case effects gains on real estate rentals</option> \n");
document.write("</select></form>\n");
}




function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

window.onerror = stopError;

