﻿/*\
 * 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 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=\"\">Archived Press Releases</option>\n");
document.write("<option value=\"pr21.htm\">Thompson Networks Invites Community to Phil-A-Van for PhilAbundance</option>\n");
document.write("<option value=\"pr20.htm\">Thompson Networks Supports Gala Event Honoring Santo Gairo</option>\n");
document.write("<option value=\"pr19.htm\">Thompson Networks Participates in Community 5K Run Honoring Brandon Boger</option>\n");
document.write("<option value=\"pr18.htm\">Thompson Networks Sponsors Community Event to Raise Breast Cancer Awareness</option>\n");
document.write("<option value=\"pr17.htm\">Estech Systems Inc., Eschews Outside Investors to Maintain Sole Control</option>\n");
document.write("<option value=\"pr16.htm\">Thompson Networks Now Offers Wireless Solutions</option>\n");
document.write("<option value=\"pr15.htm\">Thompson Networks Participates in Big Brothers Big Sisters of Bucks County&rsquo;s Annual Fundraiser</option>\n");
document.write("<option value=\"pr14.htm\">Thompson Networks Offers Telephone Infrastructure Grants to Support Bucks-Mont Katrina Relief Efforts</option>\n");
document.write("<option value=\"pr13.htm\">Thompson Networks Promotes P. Nicole Dean to Manager of Customer Service</option>\n");
document.write("<option value=\"pr12.htm\">Thompson Networks Marks its 25th Anniversary with a Community Service Campaign </option>\n");
document.write("<option value=\"pr7.htm\">Thompson Networks&rsquo; Employees Donate Over $1,000 to Children and Families in Need</option>\n");
document.write("<option value=\"pr8.htm\">Thompson Networks&rsquo; Professional Staff Continues to Grow</option>\n");
document.write("<option value=\"pr6.htm\">Thompson Networks Sponsors First Annual Pajama Walk for Breast Cancer Awareness</option>\n");
document.write("<option value=\"pr5.htm\">Thompson Networks Creates Race Team for &quot;Friends of Brandon&quot; Run</option>\n");
document.write("<option value=\"pr4.htm\">Thompson Networks Sponsors the Central Bucks Family YMCA Golf Classic</option>\n");
document.write("<option value=\"pr2.htm\">Thompson Networks Hosts its First Annual Golf Outing</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 archiveAPR(){
document.write("<form name=\"articlenavigator\">\n");
document.write("<select name=\"jump\" id=\"jump\" onChange=\"MM_jumpMenu('parent',this,0)\"> \n");
document.write("<option>Archived Press Releases</option>\n");
document.write("<option value=\"apr13.htm\">The Curchin Group Welcomes Kimberly Melski as a Manager</option>\n");
document.write("<option value=\"apr12.htm\">The Curchin Group to Host its First Annual Indoor Miniature Golf Tournament for Charity</option>\n");
document.write("<option value=\"apr11.htm\">Curchin Partner to Receive Spinnaker Award from the Eastern Monmouth Area Chamber of Commerce</option>\n");
document.write("<option value=\"apr10.htm\">Curchin Partner Presents at the National Association of Credit Union Supervisory &amp; Auditing Committees&rsquo; Annual Conference &amp; Exposition</option>\n");
document.write("<option value=\"apr9.htm\">Curchin Exhibits at the Eastern Monmouth Chamber of Commerce&rsquo;s Annual Expo </option>\n");
document.write("<option value=\"apr8.htm\">Curchin Partner to be a Special Guest on CNBC&rsquo;s Tax Thursdays</option>\n");
document.write("<option value=\"apr7.htm\">Curchin Partner Presents the Benefits of Working for a Small Accounting Firm to his Alma Mater</option>\n");
document.write("<option value=\"apr6.htm\">The Curchin Group and Smith Barney to Host Joint Seminar on Year-End Tax Planning</option>\n");
document.write("<option value=\"apr5.htm\">Curchin Partner Goes National Talking About the Benefits of \"Like Kind Exchanges\"</option>\n");
document.write("<option value=\"apr4.htm\">The Curchin Group Celebrates its 50th Year</option>\n");
document.write("<option value=\"apr3.htm\">Curchin Group Professional Receives Young Leadership Award</option>\n");
document.write("<option value=\"apr2.htm\">Curchin Partner Doug Stives is Featured on \"Your Money\"</option>\n");
document.write("<option value=\"apr1.htm\">CNBC's Morning Call Show to Interview Curchin's Doug Stives</option>\n");
document.write("</select></form>\n");
document.write("\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;


