function Required() {
	myFields = new Array('yourname','address1','city','state','zip','phone','email','creditcard','expirationdate','cvvnumber','nameoncard','billingaddress','billingcity','billingstate','billingzip');

	for(i=0; i < myFields.length; i++) {
		obj = eval("form."+myFields[i]);
		if(obj.value == "") {
			alert('Please complete the entire form');
			obj.focus();
			return false;
		}
	}
	return true;
}

function MyCart(str) {
	var http = null;
	try { http=new XMLHttpRequest(); }
	catch (e) { try { http=new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { http=new ActiveXObject("Microsoft.XMLHTTP"); } }
	if (http==null) { alert ("Your browser does not support AJAX!"); return; }
	http.open("GET","getcart.htm?"+str,true);
	http.onreadystatechange = function() {
		if(http.readyState==4) {
			div = document.getElementById("mycart");
			div.innerHTML = http.responseText;
		}
	}
	http.send(null);
	return false;
}

function AddtoCart(iid,host,cart) {
	div = document.getElementById("added"+iid);
	div.innerHTML = "This item has been added to <a href=https://secure.desyne.com/dormchoices.com/mycart.htm?host="+host+"&cart="+cart+">your cart</a>.";
	size = eval("document.form"+iid+".pa1.value");

	var http = null;
	try { http=new XMLHttpRequest(); }
	catch (e) { try { http=new ActiveXObject("Msxml2.XMLHTTP"); }
	catch (e) { http=new ActiveXObject("Microsoft.XMLHTTP"); } }
	if (http==null) { alert ("Your browser does not support AJAX!"); return; }
	http.open("GET","/addtocart.htm?iid="+iid+"&size="+size+"",true);
	http.onreadystatechange = function() {
		if(http.readyState==4) {
			// nothing to do here
		}
	}
	http.send(null);
	return false;
}

function ShowDiv(id) {
	div = document.getElementById('div'+id);
	htm = document.getElementById("more"+id);
	if(div.style.height != '100%') {
		div.style.height='100%';
		htm.innerHTML = "Close [X]";
	} else {
		div.style.height='48px';
		htm.innerHTML = "...More";
	}
	// return false;
}

function dumpProps(obj) {
	var str='';
	for (var i in obj) {
		if(typeof obj[i] == "object") {
			str+="<b>"+i+" IS AN OBJECT</b>\n";
		} else {
			str+=i+"="+obj[i]+"\n";
		}
	}
	document.write("<pre>"+str+"</pre>");
}
