var popUpWin=0;

function _onload()
{
a1 = new Image(); a2 = new Image();
a1.src = "/_img/rollover/_over.gif";
a2.src = "/_img/rollover/_over.gif";
return true;
}
//window.onload = _onload;

function Over(name)
{
src = "_img/rollover/" + name + "_over.gif";
var img = document.getElementById(name);
img.src = src;
return true;
}

function Out(name)
{
src = "_img/rollover/" + name + ".gif";
var img = document.getElementById(name);
img.src = src;
return true;
}

function popUpImg(URLStr, width, height)
{
	if(popUpWin) { if(!popUpWin.closed) popUpWin.close(); }
	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;
	
	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)
{
	if(popUpWin) { if(!popUpWin.closed) popUpWin.close(); }
	
	var left = (screen.width - width)/2;
	var top = (screen.height - height)/2-100;
	
	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 EchoBigPicture(num) {
	$("#boxForBigPicture_"+num).toggle('fast');
	$("#boxForBigPicture_"+num).html('<img src="upload/page' + num + '_big.jpg"/>');
	$("#boxForBigPicture_"+num).css({'position' : 'absolute', 'left' : event.clientX, 'top' : event.clientY});
}

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;
}