// JavaScript Document

<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var addwindow;
		function addtocart(id, quantities, prices) {
		  if (navigator.appName == "Microsoft Internet Explorer") {
		    x = window.screenLeft + document.body.clientWidth/2 - 200;
			y = window.screenTop + document.body.clientHeight/2 - 95; 
			properties = "width=400,height=130,top="+y+",left="+x+",resizable=1";
		  } else {
		    x = 0 + screen.width/2 - 200;
			y = 0 + screen.height/2 - 95;	
			properties = "width=400,height=130,screenY="+y+",screenX="+x+",resizable=1";  
		  }
			addwindow = window.open("addtocart.php?id="+id+"&quantities="+quantities+"&prices="+prices, "addwindowhtml", properties);
		}

				//var addwindow;
		function cart() {
		  if (navigator.appName == "Microsoft Internet Explorer") {
		    x = window.screenLeft + document.body.clientWidth/2 - 250;
			y = window.screenTop + document.body.clientHeight/2 - 150; 
			properties = "width=500,height=300,top="+y+",left="+x+",scrollbars=1,resizable=1";
		  } else {
		    x = 0 + screen.width/2 - 250;
			y = 0 + screen.height/2 - 150;	
			properties = "width=500,height=300,screenY="+y+",screenX="+x+",scrollbars=1,resizable=1";  
		  }
			addwindow = window.open("/cart.php", "cart", properties);
		}
		
function isBlank() {
value=document.forms[0].elements['sp-q'].value;

if ( value == "" ){
         alert("Please enter a search query");
         return false;
     }
     else {
     return true;
     }
}
function gone()
{
location=document.jumpy.example.options[document.jumpy.example.selectedIndex].value
}
function gone2()
{
location=document.jumpy2.example.options[document.jumpy2.example.selectedIndex].value
}
function gone3()
{
location=document.jumpy3.example.options[document.jumpy3.example.selectedIndex].value
}


var theImages = new Array()
theImages[0] = 'electric-staplers/106-gangster-stapler.jpg'
theImages[1] = 'electric-staplers/105-gangster-2.jpg'
theImages[2] = 'electric-staplers/105-three-3.jpg'
theImages[3] = 'industrial-staplers/mini-carton-stapler-air-2.jpg'
theImages[4] = 'industrial-staplers/mini-carton-stapler-air-3.jpg'
theImages[5] = 'industrial-staplers/industrial-plier-P6C-8F.jpg'
theImages[6] = 'industrial-staplers/industrial-staper-P50-5B.jpg'
theImages[7] = 'industrial-staplers/industrial-stapler-5080-2.jpg'
theImages[8] = 'industrial-staplers/industrial-stapler-D60ADC.jpg'
theImages[9] = 'industrial-staplers/industrial-stapler-RF-888.jpg'

var j = 0
var p = theImages.length;

var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}

var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

function bkmk() {
	var url = "http://www.stapleheadquarters.com";
	var cpt = "Salco Industrial staplers";
	var msg = "bookmark";

	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion);
	if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
   	document.write('<A HREF="javascript:window.external.AddFavorite(\'http://www.stapleheadquarters.com\', \'Salco Industrial staplers\');" ');   	
   	document.write('>'+ msg + '</a>');
	}
	
//	else{
//   	txt += "  (Ctrl+D)";
 //  	document.write('<font class=sl >' +msg+ '</font>');
//	} 

else if(OP || IE && !document.uniqueID){
       BK.onclick = function(){
          alert('Your '+RegExp.$1+' browser requires that you\nPress Ctrl & T to Bookmark this page.');
       }
       BK.onmouseover = function(){
          window.status='Your '+RegExp.$1+' browser requires that you Press Ctrl & T to Bookmark this page.';
          return true;
       }
    }

    else if(NS){
       BK.onclick = function(){
          alert('Your '+RegExp.$1+' browser requires that you\nPress Ctrl & D to Bookmark this page.');
       }
       BK.onmouseover = function(){
          window.status='Your '+RegExp.$1+' browser requires that you press Ctrl & D to Bookmark this page.';
          return true;
       }
    }

    else{ BK.innerHTML = '' }

}

// window in the middle of the screen
	

//-->