function AddCart(url, id, obj) {
	
	addurl = url+'addcart?item='+id;
	new Ajax.Request(addurl, 
	  {
		onSuccess: function(transport)
		{
		
			if(transport.responseText!="")
			{
		
				obj.style.display = "none";
				document.getElementById('hid_'+id).style.display = "block";
						   
		
			} else { show_error_msg(); }
		
		},
			onFailure: function(){show_error_msg();}
	}
				
	);

}

function show_error_msg()
		{
		   alert("Server connection lost");
		}

function getHeight() 
	{
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	  }
	  return myHeight;
	}

	function resize () {
		h = getHeight()-375;
		i = document.getElementById('page');
		//alert(h+' '+i.offsetHeight);
		if (i.offsetHeight < h) {i.style.height = h-37 + 'px'}
		//else {i.style.height = 300 + 'px'}
	}
	
function CheckBoxTrigger(obj) {
	if (obj.value == 1) {obj.value = 0} 
	else {obj.value = 1}
}
function CheckBoxTrigger2(obj, cnt) {
	if (obj.value == 1) {
		obj.value = 0;
		document.getElementById('cnt'+cnt).value--;
	} else {
		obj.value = 1;
		document.getElementById('cnt'+cnt).value++;
	}
	if (document.getElementById('cnt'+cnt).value > 0) {
		document.getElementById('start'+cnt).value = 'continue';	
	} else {
		document.getElementById('start'+cnt).value = 'start';	
	}
}
