/*\
 * 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=\"taxbit51.htm\">12/11 - Treatment of Computer Software Costs</option>\n");
document.write("<option value=\"taxbit51.htm\">11/11 - 2010 Tax Relief Act – Enhanced Tax Benefits Soon to Expire</option>\n");
document.write("<option value=\"taxbit50.htm\">10/11 - Retention of Tax Records </option>\n");
document.write("<option value=\"taxbit49.htm\">09/11 - Tax Relief for Victims of Hurricane Irene </option>\n");
document.write("<option value=\"taxbit48.htm\">08/11 - Retirement Plans for Self-Employed Persons </option>\n");
document.write("<option value=\"taxbit47.htm\">07/11 - Mid-Year Tax Changes</option>\n");
document.write("<option value=\"taxbit46.htm\">06/11 - Maximizing Business Depreciation Deductions for Real Estate Acquisitions </option>\n");
document.write("<option value=\"taxbit45.htm\">05/11 - New Jersey Tax Bills for 2012</option>\n");
document.write("<option value=\"taxbit44.htm\">04/11 - Donating a Used Car to Charity</option>\n");
document.write("<option value=\"taxbit43.htm\">03/11 - Maximizing Depreciation Deductions for Business Real Estate</option>\n");
document.write("<option value=\"taxbit42.htm\">02/11 - Using S Corporations to Reduce Self Employment Income</option>\n");
document.write("<option value=\"taxbit41.htm\">01/11 - Tax Relief, Unemployment Insurance Reauthorization and Job Creation Act of 2010</option>\n");
document.write("<option value=\"taxbit40.htm\">12/10 - Charitable Contributions of Stock</option>\n");
document.write("<option value=\"taxbit39.htm\">11/10 - Year-End Tax Planning</option>\n");
document.write("<option value=\"taxbit38.htm\">10/10 - Small Business Jobs Act</option>\n");
document.write("<option value=\"taxbit37.htm\">09/10 - Home Office Deductions</option>\n");
document.write("<option value=\"taxbit36.htm\">08/10 - Tax Breaks for the Care of Elderly or Incapacitated Individuals</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("</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=\"an53.htm\">11/17/11- BK&Co. Hires New Manager, Robert Kenific, Jr.</option>\n");
document.write("<option value=\"an52.htm\">5/1/11- BK&Co. CPA's Welcomes Douglas Hilgenberg</option>\n");
document.write("<option value=\"an51.htm\">4/20/11- BK&Co. CPA's Hires Matthew Kantor</option>\n");
document.write("<option value=\"an49.htm\">3/2/11- BK&Co. Welcomes Mallorie Tolotta</option>\n");
document.write("<option value=\"an50.htm\">2/10/11- BK&Co. Welcomes Michael Pace</option>\n");
document.write("<option value=\"an48.htm\">2/10/11- BK&Co. Manager Speaks at Hope Chamber of Commerce</option>\n");
document.write("<option value=\"an47.htm\">2/1/11- BK&Co. Partner Appointed to Ethics Committee</option>\n");
document.write("<option value=\"an46.htm\">1/20/11- BK&Co. Manager Appointed VP of Hunterdon Helpline</option>\n");
document.write("<option value=\"an45.htm\">1/15/11- BK&Co. Manager becomes Certified Valuation Analyst</option>\n");
document.write("<option value=\"an44.htm\">12/20/10- BK&Co. Volunteers for YMCA Angel Patrol</option>\n");
document.write("<option value=\"an43.htm\">11/15/10- BK&Co. Manager Presents to Suburban CPA Study Group</option>\n");
document.write("<option value=\"an42.htm\">7/1/10- BK&Co. Manager Reelected as Treasurer for Hope Chamber</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=\"an49.htm\">3/2/10- BK&Co. Welcomes Mallorie Tolotta </option>\n");
document.write("<option value=\"an50.htm\">2/20/10- BK&Co. Welcomes Michael Pace</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=\"an41.htm\">1/19/09- BK&Co. Welcomes Louis Guastamacchia</option>\n");
document.write("<option value=\"an25.htm\">12/15/08- 2008 Angel Patrol</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=\"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=\"an40.htm\">3/18/08- BK&Co. Manager Appointed to Hunterdon Helpline Board</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("</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;


