function showPic(info,file,widt,heigh,x) {
var sw=widt;
var sh=heigh;
if(widt<400)
{
	sw=400;
}

if(heigh<400)
{
	sh=400;
}

var w=(window.screen.availWidth-sw)/2;
var h=(window.screen.availHeight-sh)/2;

var config;
var s=0;
if((window.screen.availHeight-50)<heigh)
{
	s=1;
}	
var w_badb=window.open('#', 'avi'+x, config='scrollbars='+s+',height='+sh+',width='+sw+',menubar=0,left='+w+',top='+h);
w_badb.document.open();

w_badb.document.write('<html><head><title>'+info+'</title></head><body onclick="window.close();" bgcolor="#FFFFFF" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" style="height:100%;"><table align=center style="height:100%;"><tr><td><img src="'+file+'" width="'+widt+'" height="'+heigh+'" alt="'+info+'" border="0"></td></tr></table></body></html>');
w_badb.document.close();
return false;
}


var req;

function Initialize()
{

	try
	{
		req=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			req=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(oc)
		{
			req=null;
		}
	}

	if(!req&&typeof XMLHttpRequest!="undefined")
	{
		req=new XMLHttpRequest();
	}
	
}
var iId;
function SendQuery(itemId)
{
	Initialize();
	iId=itemId;
	var url="/basket/basket.aspx?id="+itemId;
	
	if(req!=null)
	{
		req.onreadystatechange = Process;
		req.open("GET", url, true);
        req.send(null);
        
	}
	
}

function Process()
{
var d=document.getElementById("status"+iId);
	if (req.readyState == 4) 
        {
        // only if "OK"
			if (req.status == 200) 
			{
				if(req.responseText=="")
					;
					//
				else
				{
					//
					var b=document.getElementById("basket_basketSum");
					var bsk=document.getElementById("basket_bsk");
					bsk.style.visibility="visible";
					b.innerHTML="ИТОГО:<br>"+req.responseText;
					d.style.visibility="hidden";
				}
			}
			else 
			{
				
				d.innerHTML="Ошибка!<br>"+req.statusText;
			}
		}
}

function addbasket(itemId)
{
	
	var d=document.getElementById("status"+itemId);
	d.style.visibility="visible";
	SendQuery(itemId);
}


function searchCatalog()
{
var st=document.getElementById("searchText");

if (st.value.length==0) 
	{
	alert("Введите условие поиска!");
	st.focus();
	return 0;
	}
var f=document.getElementById("frmSearch");
f.searchValue.value=st.value;
	
f.submit();
return 1;
}

function addBookmark() {
var title="Подарки и сувениры. Интернет-магазин sHop.bXd.ru";
var url="http://shop.bxd.ru";
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}