function createPictureWindow(_pic,_width,_height) {
	wTop = (screen.height-_height)/3;
	wLeft = (screen.width-_width)/2;
	WinFeatures = "top="+wTop+",left="+wLeft+",width="+_width+",height="+_height+",maximize=no,minimize=no,Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,resize=no";
	_newPicture = window.open("zoom.php?id="+_pic+"&dir=pictures","frontendPictureWindow",WinFeatures);
}

function createDynamicWindow(Path,Width,Height,Title)
{
	var p = Math.ceil(Math.random()*10000);
	var q = Math.ceil(Math.random()*p);
	windowName = p+'X'+(Width*p)+(Height*q);
	WinFeatures = "top="+(screen.height-Height)/2+",left="+(screen.width-Width)/2+",width="+Width+",height="+Height+",Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no";
	w = window.open("",windowName,WinFeatures);
	w.document.open();
	w.document.write('<head><title>&quot;'+Title+'&quot;</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"></head>');
	w.document.write("<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><img src='"+Path+"' height='"+Height+"' width='"+Width+"' alt='&quot;"+Title+"&quot;'></body>"); 
	w.document.close();
}

function createDescriptionWindow(_file,_width,_height)
{
	wTop = (screen.height-_height)/3;
	wLeft = (screen.width-_width)/2;
	WinFeatures = "top="+wTop+",left="+wLeft+",width="+_width+",height="+_height+",maximize=no,minimize=no,Status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=yes,resize=no";
	_newDescription = window.open(_file,"frontendDescriptionWindow",WinFeatures);
}
// ---------------------------------------Browser determination----------------------------------------------//

dom = (document.getElementById);
IE4x = (document.all && (parseInt(navigator.appVersion) >= 4 ));
NC4x = (document.layers && (parseInt(navigator.appVersion) >= 4 ));
br4x = (parseInt(navigator.appVersion) >= 4);

//------------------------------------------- ÄÂÈÃÀÞÙÈÉÑß ÑËÎÉ ----------------------------------------------//
var movObjSpeed = 10;
var movObjTimer;
var movObjLeft = 10;
var movObjRight = 420;

function _show(_id,direction)	{
	//alert(_id+' | '+parent.window.name);
	parent.window.document.getElementById('descrLayer').innerHTML = _starring[_id];
	moveObj('descrCont','descrLayer',direction,'movObjTimer');
}

function b_getleft() {
    var gleft=(NC4x) ? eval(this.css.left):eval(this.css.pixelLeft);
    return gleft;
}

function makeMovingObj(obj,nest) {
	nest=(!nest)? '':'parent.window.document.'+nest+'.';
	this.css=(NC4x)? eval('parent.window.'+nest+'document.'+obj) : eval('parent.window.document.all.'+obj+'.style');
	this.scrollWidth=(NC4x)? this.css.document.width : eval('parent.window.document.all.'+obj+'.offsetWidth');
	this.left=b_getleft;
	return this;
}

function moveObj(nest,obj,direction,timer) {
	clearTimeout(movObjTimer);
	movObjPos = (IE4x) ? eval('parent.window.document.all.'+obj+'.style') : eval('parent.window.document.'+nest+'.document.'+obj);
	if (((direction>0) && (movObj.left() <= movObjRight)) || ((direction<0) && (movObj.left() >= movObjLeft))) {
		movObjPos.left = movObj.left()+(movObjSpeed*direction);
		movObjTimer=setTimeout("moveObj('"+nest+"','"+obj+"','"+direction+"','"+timer+"')", movObjSpeed);
	}
	else movObjPos.left = (direction>0)? movObjRight : movObjLeft;
}

function objInit(obj,nest) 
{
	thisObj = (IE4x) ? eval('parent.window.document.all.'+nest+'.style') : eval('parent.window.document.'+nest);
    thisObj.visibility='visible';	
	movObj = new makeMovingObj(obj,nest);
	movObjPos = (IE4x) ? eval('parent.window.document.all.'+obj+'.style') : eval('parent.window.document.'+nest+'.document.'+obj);
	movObjPos.left = movObjRight;	
}