//<SCRIPT LANGUAGE="JavaScript"><!--
function updatecart(oprice, toprice) {
var quantity = document.getElementById('quantity').value;
var check = document.getElementById('nomount');
var price = document.getElementById('price');
var priceval = document.getElementById('priceval');
//alert("try");

if(check.checked)
{
//alert("checked");
document.cart.mount.disabled=true;
var p = (Number(toprice)*Number(quantity)).toFixed(2);
price.innerHTML="$"+p;
priceval.value=p;
}

else
{
document.cart.mount.disabled=false;
var p = (Number(oprice)*Number(quantity)).toFixed(2);
price.innerHTML="$"+p;
priceval.value=p;

}
}


function submitc(iname) {
var quantity = document.getElementById('quantity').value;
var mounts = document.getElementById('mount');
var mount = mounts.options[mounts.selectedIndex].text;
//alert(mount);
var check = document.getElementById('nomount');
if (check.checked){
	mount="Top Only";
}
var priceval = document.getElementById('priceval').value;
//alert("try");
/*
alert(quantity);

alert(mount);
alert(priceval);
*/
//alert("done");
var ajaxRequest;  // The variable that makes Ajax possible!

try{
	// Opera 8.0+, Firefox, Safari
	ajaxRequest = new XMLHttpRequest();
} catch (e){
	// Internet Explorer Browsers
	try{
		ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try{
			ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e){
			// Something went wrong
			alert("Your browser broke!");
			return false;
		}
	}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
	if(ajaxRequest.readyState == 4){
		//var ajaxDisplay = document.getElementById('ajaxDiv');
		//alert(ajaxRequest.responseText);
		loadc();
	}else if(ajaxRequest.readyState == 1){
		//var ajaxDisplay = document.getElementById('ajaxDiv');
		//ajaxDisplay.innerHTML = "<img style=\"width: 32px; height: 32px; float: left;\" alt=\"Loading...\" src=\"images/loading.gif\">";
	}
}
//var age = document.getElementById('age').value;
//var iname="Bass";
var query = "quantity=" + quantity + "&mount=" + mount + "&priceval=" + priceval + "&iname=" + iname;
//alert(mount);
ajaxRequest.open("POST", "addtocart.php?"+query, true);
ajaxRequest.send(null); 
//var ajaxDisplay = document.getElementById('ajaxDiv');


popshow();


}

function popshow(){
	var cpop= document.getElementById('cpop');
	//var row=Math.ceil(id/4)*235+70;
	//var col=((id-1)%4+1)*160+270;
	//alert(row + " r  " + col + " c " + id);
	//cpop.style.top=getViewportScrollY+"px";
	//cpop.style.left=getViewportScrollX+"px";
	cpop.style.visibility="visible";
	cpop.style.display="block";
	//alert('pops');
}

function pophide(){
	var cpop = document.getElementById('cpop');
	//alert(button.hasfocus);
	cpop.style.visibility="hidden";
	cpop.style.display="none";
}

//-->
//</SCRIPT>