function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}
function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}
function getBodyScrollTop()
{
  return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
function getBodyScrollLeft()
{
  return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}

function loadB(ID, FCON) {
if ((document.getElementById(ID).style.visibility == "visible" & FCON == 0) || FCON == 1) {
if (FCON == 1) jsphp_shtml('shop','pop','act=pop');
document.getElementById(ID).style.visibility = "visible";
document.getElementById(ID).style.top = getBodyScrollTop() + getClientHeight() - 50;
document.getElementById(ID).style.left = getClientWidth() - 210;
}
}
function addID(ID)
{
if (document.order.item[ID].checked == false) {
document.order.item_ids.value += ID;
}
alert(document.order.item_ids.value);
}

function checkItem(ID)
{
if (document.getElementById(ID).checked == false) document.getElementById(ID).checked = true;
else document.getElementById(ID).checked = false;
}

function addToCart(ID) {
var SENDSTR = '', oForm = document.getElementsByName('item[]');
for (var i=0; i < oForm.length; i++) {
if(oForm[i].checked == true) SENDSTR += 'item_id[]='+oForm[i].value+'&';
}
jsphp_shtml('shop','items_tmp',SENDSTR+'act=add');
//loadB('pop', 1);
setTimeout("loadB('pop', 1)",500);
}

function cartDelete (ID) {
jsphp_shtml('cart','button','act=delete&user_id='+SESSION_ID+'&id='+ID);
document.getElementById('row'+ID).style.display='none';
jsphp_shtml('cart','price','act=recalc&user_id='+SESSION_ID);
}

function loadItems () {
jsphp_shtml('shop','items','cat_id='+document.getElementById('type_id2').value);
}

function agbAgree(ID){
var BUTTON = document.getElementById('button');
if (BUTTON.disabled == false) BUTTON.disabled = true;
else BUTTON.disabled = false;
}

