closetime = 0;
  function popWin(imgName)
  {
	window.open('portfolio-images.asp?img=' + imgName,'portfolioImage' + parseInt(Math.random() * 1000000),'directories=0,toolbar=0,menubar=0,personalbar=0,location=0,scrollbars=1,status=0,resizable=1,height=250,width=350,screenX=20,screenY=20,left=20,top=20');
  }
  function popNews()
  {
	  window.open('news_pop.asp','news' + parseInt(Math.random() * 1000000),'directories=0,toolbar=0,menubar=0,personalbar=0,location=0,scrollbars=1,status=0,resizable=1,height=350,width=350,screenX=20,screenY=20,left=20,top=20');
  }
  function popFaxWin(url)
  {
	window.open(url,'faxorder' + parseInt(Math.random() * 1000000),'directories=0,toolbar=0,menubar=0,personalbar=0,location=0,scrollbars=1,status=0,resizable=0,height=400,width=550,screenX=20,screenY=20,left=20,top=20');
  }
  function popInfoWin(url)
  {
	window.open('copy.asp?id='+url,'faxorder' + parseInt(Math.random() * 1000000),'directories=0,toolbar=0,menubar=0,personalbar=0,location=0,scrollbars=0,status=0,resizable=0,height=375,width=400,screenX=20,screenY=20,left=20,top=20');
  }
  
  function resizeIframe() {
	  newHeight = Number(document.getElementById('iFrameContents').clientHeight);
	  if (newHeight != 0) {
	  	 window.resizeTo(550,newHeight);
		 //window.scrollbars.visible=false;
	  }
  }
  
function showArticle(idList,newsid) {
		 var idArray = idList.split("|");
		 for(i=0; i<idArray.length; i++) {
				  if(idArray[i] != ""){
				      document.getElementById(idArray[i]).style.visibility="hidden";
				  }	   
		 }
		 document.getElementById(newsid).style.visibility="visible";
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = true;
function preloadImages() {
	if (document.images) {
		image_1a = newImage("images/portfolio/1.jpg");
		preloadFlag = true;
	}
}
  function resizePopUp() {
	  newWidth = Number(document.getElementById('contents').clientWidth)+50;
	  newHeight = Number(document.getElementById('contents').clientHeight)+100;
	  if (newWidth != 0 && newWidth >= 144) {
	  	 window.resizeTo(newWidth,newHeight);
		 //window.scrollbars.visible=false;
	  }
  }
function numericOnly(sString)
{
   var sNumericOnly = "";
   var sValidChars = "1234567890+-";
   for (var iCharPos = 0; iCharPos < sString.length; iCharPos++)
   {
      if (sValidChars.indexOf(sString.charAt(iCharPos)) != -1)
      {
         sNumericOnly = sNumericOnly + sString.charAt(iCharPos);
      }
   }
   //alert("sNumericOnly = " + sNumericOnly);
   return sNumericOnly;
}
 
function moveL2R()
{
if(typeof(rightTimeOut) != "undefined"){
clearTimeout(rightTimeOut);
}
var amount = numericOnly(document.getElementById("scrollTable").style.marginTop);
var newWidth = Number(document.getElementById("scrollTable").clientHeight);
//alert(newWidth);
//alert(Number(newWidth)+Number(numericOnly(document.getElementById("scrollTable").style.marginTop)));
if(Number(newWidth)+Number(numericOnly(document.getElementById("scrollTable").style.marginTop)) >= 230) {
document.getElementById("scrollTable").style.marginTop = parseInt(amount) - 5;
leftTimeOut = setTimeout("moveL2R()",60);
if(document.getElementById("loading").src=="http://www.criticalcpa.com/site_images/loading.gif"){
    document.getElementById("loading").src = "site_images/spacer.gif";
}
}
}

function moveR2L()
{
if(typeof(leftTimeOut) != "undefined"){
clearTimeout(leftTimeOut);
}
var amount = numericOnly(document.getElementById("scrollTable").style.marginTop);
var newWidth = Number(document.getElementById("scrollTable").clientHeight);
if(Number(numericOnly(document.getElementById("scrollTable").style.marginTop)) <=0) {
document.getElementById("scrollTable").style.marginTop = parseInt(amount) + 5;
rightTimeOut = setTimeout("moveR2L()",60);
}
}

function stopMove()
{
if(typeof(rightTimeOut) != "undefined"){
clearTimeout(rightTimeOut);
}
if(typeof(leftTimeOut) != "undefined"){
clearTimeout(leftTimeOut);
}
document.getElementById("scrollTable").style.marginTop = 0;
}