function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=lib_bwcheck() ;

// get form object
function getForm (form) {
	var frm = bw.ie4?document.all[form]:document.getElementById(form);
	return frm ;
}

// add item to shop cart
function shopCart_add (item_id) {
	var frm = getForm ("shopCartForm") ;
	
	if (frm) {
			var prod = bw.ie4?document.all["item_id"] : document.getElementById ("item_id") ;
			
			if (prod) {
					prod.value = item_id ;
					frm.submit () ;
			}
	}
}
// remove item from cart
function shopCart_remove (item_id) {
	var frm = getForm ("shopCartListForm") ;
	
	if (frm) {
			var prod = bw.ie4?document.all["item_id"] : document.getElementById ("item_id") ;
			var cfunc = bw.ie4?document.all["cart_func"] : document.getElementById ("cart_func") ;
			
			if (prod) {
					prod.value = item_id ;
					cfunc.value = "delete" ;
					frm.submit () ;
			}
	}
}
// cart update
function shopCart_update () {
	var frm = getForm ("shopCartListForm") ;
	
	if (frm) {
			var cfunc = bw.ie4?document.all["cart_func"] : document.getElementById ("cart_func") ;
			
			if (cfunc) {
					cfunc.value = "update" ;
					frm.submit () ;
			}
	}
}
// cart emptited
function shopCart_empty () {
	var frm = getForm ("shopCartListForm") ;
	
	if (frm) {
			var cfunc = bw.ie4?document.all["cart_func"] : document.getElementById ("cart_func") ;
			
			if (cfunc) {
					cfunc.value = "empty" ;
					frm.submit () ;
			}
	}
}