function loadDivisions() { 

    index1 = 0;
    listofimages = new Array(4);
    
    listofimages[0] = new Image(260,221)
    listofimages[0].src = "divisions/wse.jpg"
    
    listofimages[1] = new Image(260,221)
    listofimages[1].src = "divisions/marathon.jpg"
    
    listofimages[2] = new Image(260,221)
    listofimages[2].src = "divisions/vikimatic.jpg"
    
    listofimages[3] = new Image(260,221)
    listofimages[3].src = "divisions/maxcell.jpg"

    thetimer = setTimeout("changeImage()", 3000);
} 

function changeImage(){ 

    index1 = index1 + 1
    if (index1 == "4") { 
        index1 = 0 
    } 

    imagesource = listofimages[index1].src
    window.document.divisions.src = imagesource
    thetimer = setTimeout("changeImage()", 4000);
} 

function changeDivisions() { 

    if (index1 == 0) { 
        newlocation = "wse.aspx" 
    }
    else if (index1 == 1) { 
        newlocation = "marathon.aspx" 
    }
    else if (index1 == 2) { 
        newlocation = "vikimatic.aspx" 
    }
    else if (index1 == 3) { 
        newlocation = "maxcell.aspx" 
    }
    
    location = newlocation 
}

function sameAsBilling() {

    if (document.form1.same.checked) {

	    document.form1.shipCompany.value = document.form1.company.value;
		document.form1.shipFirstName.value = document.form1.first_name.value;
		document.form1.shipLastName.value = document.form1.last_name.value;
		document.form1.shipAddress1.value = document.form1.address1.value;
		document.form1.shipCity.value = document.form1.city.value;
		document.form1.shipState.value = document.form1.state.value;
		document.form1.shipZip.value = document.form1.zip.value;
		document.form1.shipCountry.value = document.form1.country.value;
		document.form1.shipPhone.value = document.form1.phone.value;
	}
}
    
function cvv2() {

    options="toolbar=0,status=0,menubar=0,scrollbars=0,resizable=0,width=500,height=300";
	window.open("cvv2.html", "Help", options);
}

function checkQty(field, desc) {

	var chars = "0123456789";
	var field_val = eval('document.form1.' + field + '.value');
    var alertNow = false;
    
	if (field_val == "0")
	  	eval('document.form1.' + field).value = ""; 
	for (var i = 0; i < field_val.length; i++) { 
		if (chars.indexOf(field_val.charAt(i)) == -1) { 
			alertNow = true;
    	  	eval('document.form1.' + field).value = "";
   		} 
	}
	
	if (alertNow == true)
	    alert("Only numbers (0-9) are allowed for the " + desc + " quantity.\n");
}

function updateSubtotal() {

	var chars = "0123456789";
	var qty = document.form1.quantity.value;
    var alertNow = false;
    
	if (qty == "0")
	  	document.form1.quantity.value = "1"; 
	
	for (var i = 0; i < qty.length; i++) { 
		if (chars.indexOf(qty.charAt(i)) == -1) { 
			document.form1.quantity.value = "1";
   		} 
	}
	
	var total = document.form1.quantity.value * document.form1.subtotal_orig.value;
	document.form1.subtotal.value = '$' + total.toFixed(2);
}