function ShowResult(data) {
	var obContainer = document.getElementById('miniBasketResult');
	if (obContainer)
		obContainer.innerHTML = data;
}

function AddBasket(id) {
	var TID = CPHttpRequest.InitThread();
	CPHttpRequest.SetAction(TID, ShowResult);
	CPHttpRequest.Send(TID, '/personal/basketchange.php', {'id':id, 'mode':'ajax', 'operat':'add'});
	
	return false;
}

function DelBasket(id) {
	var TID = CPHttpRequest.InitThread();
	CPHttpRequest.Send(TID, '/personal/basketchange.php', {'id':id, 'mode':'ajax', 'operat':'del'});
	
	return false;
}

function DelBasketAll() {
	var TID = CPHttpRequest.InitThread();
	CPHttpRequest.SetAction(TID, ShowResult);
	CPHttpRequest.Send(TID, '/personal/basketchange.php', {'mode':'ajax', 'operat':'delall'});
	
	return false;
}

function setView (src, w, h, rsrc, rw, rh, ralt) {
	var timer;
	document.images['view_pic'].src = src;
	//setTimeout ('alert('+document.images['view_pic'].height+')', 700)
	//alert (document.images['view_pic'].height);
	document.images['view_pic'].width = w;
	document.images['view_pic'].height = h;

	if (!document.all)
		document.getElementById('view_pic').setAttribute("onclick", "ImgShw('"+rsrc+"',"+rw+","+rh+",'"+ralt+"')");
	else
		document.getElementById('view_pic').setAttribute("onclick", function() {ImgShw(rsrc,rw,rh,ralt);});
	
	for (i=1;;i++) {
		name='liltpic'+i;
		if(document.getElementById(name)==null)
			break;
		document.getElementById(name).style.borderColor='#d8dfdd';
	}
}

function ImgShw(src, width, height, alt) {
	var scroll = "no";
	var top=0, left=0;
	if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
	if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
	if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
	width = width+20;
	height = height+20;
	width = Math.min(width, screen.width-10);
	height = Math.min(height, screen.height-28);
	var wnd = window.open("","","scrollbars="+scroll+",resizable=no,width="+width+",height="+height+",left="+left+",top="+top);
	wnd.document.write(
		'<html><head>'+
		'<'+'script type="text/javascript">'+
		'function KeyPress()'+
		'{'+
		'	if(window.event.keyCode == 27) '+
		'		window.close();'+
		'}'+
		'</'+'script>'+
		'<title>'+alt+'</title></head>'+
		'<body style="margin:10" onKeyPress="KeyPress()">'+
		'<img src="'+src+'" border="0" alt="'+alt+'" />'+
		'</body></html>'
	);
	wnd.document.close();
	}
