
function checkItems(formobj)
{
	var quant = formobj.fquantity.value ;
	if (isNaN(quant) == true || quant < 1 || quant > 9)
	{
		alert("Please enter a number between 1 and 9");
		formobj.fquantity.focus();
		return false
	}else
	{
		return true;
	}
}

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_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 validate(theForm){
	if (theForm.fname.value == "" || theForm.fname.value.length < 2){
		alert("Please fill in your first name.");
		theForm.fname.focus();
		return false;
	}
	if (theForm.lname.value == "" || theForm.lname.value.length < 2){
		alert("Please fill in your last name.");
		theForm.lname.focus();
		return false;
	}
	if (theForm.email.value == "" || theForm.email.value.indexOf('@',1)== -1 || theForm.email.value.indexOf('.',2)==-1){
		alert("Please fill in your email address.");
		theForm.email.focus();
		return false;
	}
return true;
}

function validateccard(theForm){
	if (theForm.cardname.value == "" || theForm.cardname.value.length < 2){
		alert("Please fill in the name found on your credit card.");
		theForm.cardname.focus();
		return false;
	}
	if (theForm.cardno.value == "" || theForm.cardno.value.length < 12 || theForm.cardno.value == "0000000000000000"){
		alert("Please fill in the card number in this format: 0000000000000000.");
		theForm.cardno.focus();
		return false;
	}
return true;
}

startPos=30 // Starting Position of First line in Pixels
loop=true // Loop Scrolling (T/F)
iSpeed=180 // Speed of scrolling: Increase to reduce speed
pxStep=1 // Number of Pixels per step

// Initiate News Scroller
function NewsInit(){
	if (bw.ns5==1) startPos=0;
	objNewsBox=new createLayer('NewsBox')
	objNewsItems=new createLayer('NewsItems','NewsBox')
	objNewsItems.moveIt(0,startPos)
	objNewsBox.css.visibility='visible'
	objNewsItems.scroller(iSpeed)
}

// Initiate Suppliers Scroller
function SuppliersInit(){
	if (bw.ns5==1) startPos=0;
	objNewsBox=new createLayer('SuppliersBox')
	objNewsItems=new createLayer('SuppliersItems','SuppliersBox')
	objNewsItems.moveIt(0,startPos)
	objNewsBox.css.visibility='visible'
	objNewsItems.scroller(iSpeed)
}


// Scrolling Function
function scroller(iSpeed){
	if(this.y>-this.scrollHeight){
		this.moveIt(0,this.y-pxStep)
		setTimeout(this.obj+".scroller("+iSpeed+")",iSpeed)
	}else if(loop) {
		this.moveIt(0,startPos)
		eval(this.obj+".scroller("+iSpeed+")")
	  }
}

// Set Browser Object
function setBrObj(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
// Create Layers
function createLayer(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.scroller=scroller;
	this.moveIt=b_moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}
// Movement of Scroller
function b_moveIt(x,y){
	this.x=x;this.y=y
	this.css.left=this.x
	this.css.top=this.y
}
bw=new setBrObj()

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;
}
