﻿var count = 0;
function Anthem_PreCallBack() { 
    count++;
    setTimeout("CallBackStarted()", 500); 
}
function Anthem_PostCallBack() { CallBackFinished(); }

function CallBackStarted() {
  if (count > 0){  
    var item = document.getElementById('wait');
    if ((!window.XMLHttpRequest) && (document.documentElement)){
      item.style.position = 'absolute';
      //code to make ie6 behave
      if (document.documentElement.scrollTop){
        item.style.top = document.documentElement.scrollTop + 15;
      }
      else{ item.style.top = 15; }      
      item.style.right = 15;
    }
    item.style.display = 'block';    
  }
}
 
function CallBackFinished(){
  count--;
  if (count == 0){
    var item = document.getElementById('wait');
    if (item != null){
        item.style.display = 'none';
    }
  }
}

// Custom JavaScripting -- Paul Pettit
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore_1() { //v3.0
  var i,x,a=document.MM_sr_1; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImgRestore_2() { //v3.0
  var i,x,a=document.MM_sr_2; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage_1() { //v3.0
  var i,j=0,x,a=MM_swapImage_1.arguments; document.MM_sr_1=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr_1[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImage_2() { //v3.0
  var i,j=0,x,a=MM_swapImage_2.arguments; document.MM_sr_2=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr_2[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function notesWin(url) {
	remote = window.open(url,"remoteWin","width=640,height=480,resizable=0,menubar=0,status=0,scrollbars=1");
	remote.opener.name = "opener";
}
function newWin(url) {
	remote = window.open(url,"remoteWin","width=700,height=500,resizable=1,menubar=0,status=0,scrollbars=1");
	remote.opener.name = "opener";
}
function formWin(url) {
	remote = window.open(url,"remoteWin","width=820,height=600,resizable=1,menubar=0,status=0,scrollbars=1,toolbar=1");
	remote.opener.name = "opener";
}

function partnerSite(url) {
	if(confirm('You are now exiting 1ComputerBargains.com. If you have items in your shopping cart, you may want to submit and complete your order before leaving. Click "OK" if you wish to leave without completing any pending orders.')) {
		location = url;
	}
}
function mainSite(url) {
	if(confirm('You are now transfering to the main 1ComputerBargains.com store. If you have items in your shopping cart, you may want to submit and complete your order before leaving. Click "OK" if you wish to leave without completing any pending orders. All pending orders will be saved until you return.')) {
		location = url;
	}
}

function priceAlert() {
	alert('This product has special pricing requirements, be sure and review these requirements as described under Pricing Information below the product description.')
}
function orderAlert() {
	alert('This product has special pricing requirements, ordering this item without understanding these requirements could result in the cancellation of the order. Please review the product description for more information.')
	}
