// JavaScript Document. Boris Panchenko, 2010.

function _onload()
{
	
	return true;
}
window.onload = _onload;



// Корзина покупок
function basketProductManagement(id,action) {
	$('#productID_'+id).html('обработка ...');
	$('#productID_'+id).load('/bpkernel/_ajax/basketProductManagement.php?id='+id+'&action='+action+'&rand='+Math.random());
}



// POP UP WIN
function popUpImg(URLStr, width, height)
{
	html = "<html><head><title></title></head><body bottommargin=0 leftmargin=0 marginheight=0 marginwidth=0 rightmargin=0 topmargin=0 bgcolor='#FFFFFF' style='overflow: hidden;'>\n"+
	"<div align='center'><a href='javascript: window.close();'><img width=" + width + " height=" + height + " src='"+ URLStr +
	"' border=0 alt='закрыть' style='margin: 25px 0px 0px 25px;' /></a></div></body></html>";
	var left = (screen.width - width)/2;
	var top = (screen.height - height)/2-200;
	width=width+50; height=height+50;
	var popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=yes,menub ar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	popUpWin.document.open();
	popUpWin.document.write(html);
	popUpWin.document.close();
	return true;
}
function popUpHTML(URLStr, width, height)
{
	var left = (screen.width - width)/2;
	var top = (screen.height - height)/2-100;
	var popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
// =======================
function messageWindow(title, msg)
{
	var width="300", height="125";
	var left = (screen.width/2) - width/2;
	var top  = (screen.height/2) - height/2;
	
	var styleStr  = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
	var msgWindow = window.open("","msgWindow", styleStr);
	
	var head = '<head><title>'+title+'</title></head>';
	var body = '<center>'+msg+'<br><p><form><input type="button" value="   Done   " onClick="self.close()"></form>';
	msgWindow.document.write(head + body);
}
function getAbsolutePosition(el) {
	var r = { x: el.offsetLeft, y: el.offsetTop };
	if (el.offsetParent) {
		var tmp = getAbsolutePosition(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
	}
	return r;
}
