function  embedFlash(fileName, lib, tm, w, h)				{			
	var flob='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'" id="picture" align="middle">';
	flob+='<param name="allowScriptAccess" value="sameDomain" />';
	flob+='<param name="movie" value="'+fileName+'?' + tm + '" />';
	flob+='<param name="quality" value="high" />';
	flob+='<PARAM NAME=FlashVars VALUE="'+lib+'">';
	flob+='<param name="allowFullScreen" value="true" />';
	flob+='<PARAM NAME=wmode VALUE="transparent">';
	flob+='<param name="bgcolor" value="#ffffcc" />';
	flob+='<embed src="'+fileName+'?' + tm + '" quality="high" wmode="transparent" FlashVars="'+lib+'" bgcolor="#ffffcc" width="'+w+'" height="'+h+'" name="picture" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	flob+='</object>';
	document.write(flob);
}

var win = null;
function openImage(url,w,h,txt)
{
	var scroll = 0;
	w = w +20;
	h = h +20;
	//if (txt == ' '){h = h - 80;}
	var LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	var TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	if(screen.height > h || screen.width > w) { scroll = 1; }
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,status=no';
	win = window.open('','Image',settings);
	if(win.window.focus){win.window.focus();}
	var doc = win.document;
	if (txt == ' ')
	{
		doc.write("<html><body style='margin:0; padding:10px; overflow-y:auto'><img src='" + url + "'></body></html>");
	}else
	{
		doc.write("<html><body style='margin:0; padding:10px; overflow-y:auto'><img src='" + url + "'><div style='border-top:1px solid #9b9b9b; font-family:Arial; font-size:12px; margin-top:10px; padding:7px 0 0 0; width:99.9%'>" + txt + "</div></body></html>");
	}

	doc.close();
}

function add2basket(id, a)
{
	if(id || a)
	{
		$.getJSON('/basket.html?id='+id+'&a='+a, function(data)
		{
			if(data)
			{
				$('#basket_goods').text(data.goods);
				$('#basket_total, #basket_total_inv').text(data.total);
				$('#basket_points_inv').text(data.points);
			}
		});
	}
}

$(document).ready(function(){add2basket(false, 1);});
