
function expandCollapse(elem, changeImage)
{
        ecBlock = document.all(elem);
        if (ecBlock != undefined && ecBlock != null)
        {
                if (ecBlock.style.display == "none" || ecBlock.style.display == null || ecBlock.style.display == "")
                {
                    //shows the info.
					///document.all(elmnt).style.visibility="visible"
                    ecBlock.style.display = "block";
                }
                else if (ecBlock.style.display == "block")
                {
                    //hide info
                    ecBlock.style.display = "none";
                    
                }
                else
                {
                    //catch any weird circumstances.
                    ecBlock.style.display = "block";
					//ecBlock.style.visibility="visible"
                }
        }//end check ecBlock
}//end expandCollapse

function Gallery(link, width, height) {
	document.getElementById('gallery').innerHTML = '<img border="0" src="'+link+'" width="'+width+'"  height="'+height+'">';
}

function ToCart(id, num, color) {
        JsHttpRequest.query(
            'addtocart.php', // backend
            {
				'tovar_id': id,
				'tovar_color': color,
				'tovar_num': num
				  
            },
            function(result, errors) {
			            document.getElementById('basket').innerHTML = errors;
						
            },
            true  // do not disable caching
        );
}

function AddToCart(id, color) {
	hs.htmlExpand(document.getElementById('id_'+id), { contentId: 'highslide-html',outlineWhileAnimating: true, objectLoadTime : 'after'});
	
	ToCart(id, 1, color);
	setTimeout("hs.close()",2000)
}
