
function update_points() {

    if (!site_url) { site_url = '/'; }
    if (document.getElementById('qty_points')) {
        url=site_url+'shopping-basket/?link=true&action=update_points';
        url+='&qty='+document.getElementById('qty_points').value;
        
        location.href=url;
    } 
}

function update_basket(product_id) {

	if (!site_url) { site_url = '/'; }
	if (document.getElementById('qty_'+product_id)) {
		url=site_url+'shopping-basket/?link=true&action=update_basket&item='+product_id;
		url+='&qty='+document.getElementById('qty_'+product_id).value;
		
		location.href=url;
	} 
}

function showproducts(keyindex,uniqid,rowtotal) {
	
	for (i=1;i<=rowtotal;i++) {
		if (document.getElementById('featured_'+uniqid+'_'+i)) {
			document.getElementById('featured_'+uniqid+'_'+i).className="hide";
			document.getElementById('menu_'+uniqid+'_'+i).className="menu";
		}
	}
	if (document.getElementById('featured_'+uniqid+'_'+keyindex)) {
		document.getElementById('featured_'+uniqid+'_'+keyindex).className="show";
		document.getElementById('menu_'+uniqid+'_'+keyindex).className="menu active";
	}
}

function add_basket(product_id,state) {

	if (!site_url) { site_url = '/'; }
	
		
		url=site_url+'shopping-basket/?action=add_to_basket&item='+product_id;
		if (state==true) {
			url+='&qty=1';			
		} else {
			if (document.getElementById('qty_'+product_id)) {
				url+='&qty='+document.getElementById('qty_'+product_id).value;
			} else {
				url+='&qty=1';
			}
		}
		location.href=url;	
}

