var AjaxResult = function(response){
	eval(response)
}

function del(Id, El){
	if(confirm("Удалить?"))
	$.post(
		'/req/delete.php',
		{id:Id,el:El},
		AjaxResult
	)
}

function move(Id, Dir, El){
	$.post('/req/move.php',{id:Id,dir:Dir,el:El},AjaxResult)
}

function tobasket(Id){
	var Qty = $('#qty'+Id).val()
	if(Qty) $.post('/req/tobasket.php', {id:Id,qty:Qty}, AjaxResult)
}

function recalc(Id){
	var Qty = $('#qty'+Id).val()
	$.post('/req/recalc.php',{id:Id,qty:Qty},AjaxResult)
}

function enlarge(url){
	var topPosition = document.documentElement.scrollTop
	topPosition += 30;
	$('div.bigimage').remove()
	$('<div id="bigimage" class="bigimage" style="background:#2f0b0f; border:2px solid #e3a859; padding:15px 15px 5px; position:absolute; top:'+topPosition+'px; left:15%; color:#e3a859; text-align:center; font-weight:bold; font-family: verdana; cursor:pointer; z-index:15; display:none" onclick="$(this).animate({opacity:\'hide\'},250)"><img src="'+url+'" alt="" border="0" /><br />Закрыть</div>')
	.appendTo('body')
	.animate({opacity:'show'},300);
}

function playSound(val){
	if(!val) return;
	document.getElementById('play').SetVariable("SoundLink",val);
}
