var mer, mer1, mer_comm, mer_rent;
var condition;

function showComm(txt)
{
	j_hei = 220;
	j_wid = 420;
	if (navigator.appName.indexOf('Microsoft Internet Explorer') != -1)
		condition = (mer_comm && !mer_comm.closed);
	else
		condition = (mer_comm && !mer_comm.closed && mer_comm.closed != undefined);
	if (condition) { mer_comm.close(); }
	mer_comm = window.open("/_comm.php?txt="+txt, "winbox", "toolbar=0, location=0, directories=0, menubar=0, scrollbars=0, resizable=0, width="+ j_wid +", height="+ j_hei +", left="+(screen.width-j_wid)/2+", top="+(screen.height-j_hei)/2);
}

function showUsed(txt)
{
	j_hei = 220;
	j_wid = 420;
	if (navigator.appName.indexOf('Microsoft Internet Explorer') != -1)
		condition = (mer_comm && !mer_comm.closed);
	else
		condition = (mer_comm && !mer_comm.closed && mer_comm.closed != undefined);
	if (condition) { mer_comm.close(); }
	mer_comm = window.open("/_used.php?txt="+txt, "winbox", "toolbar=0, location=0, directories=0, menubar=0, scrollbars=0, resizable=0, width="+ j_wid +", height="+ j_hei +", left="+(screen.width-j_wid)/2+", top="+(screen.height-j_hei)/2);
}

function showRent(txt)
{
	j_hei = 220;
	j_wid = 420;
	if (navigator.appName.indexOf('Microsoft Internet Explorer') != -1)
		condition = (mer_rent && !mer_rent.closed);
	else
		condition = (mer_rent && !mer_rent.closed && mer_rent.closed != undefined);
	if (condition) { mer_rent.close(); }
	mer_rent = window.open("/_rent.php?txt="+txt, "winbox", "toolbar=0, location=0, directories=0, menubar=0, scrollbars=0, resizable=0, width="+ j_wid +", height="+ j_hei +", left="+(screen.width-j_wid)/2+", top="+(screen.height-j_hei)/2);
}

function wopen(address)
{
	j_wid = 570;
	j_hei = 600;

	if (navigator.appName.indexOf('Microsoft Internet Explorer') != -1)
		condition = (mer && !mer.closed);
	else
		condition = (mer && !mer.closed && mer.closed != undefined);

	if (condition)
		mer.close();

	mer = window.open("/_address.php?address="+address, "winbox", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width="+ j_wid +", height="+ j_hei +", left="+(screen.width-j_wid)/2+", top="+(screen.height-j_hei)/2);
}

function showImg(path,j_wid,j_hei)
{
	if (navigator.appName.indexOf('Microsoft Internet Explorer') != -1)
		condition = (mer1 && !mer1.closed);
	else
		condition = (mer1 && !mer1.closed && mer1.closed != undefined);

	if (condition)
		mer1.close();

	mer1 = window.open("/_popup.php?pic="+path, "winbox", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width="+ j_wid +", height="+ j_hei +", left="+(screen.width-j_wid)/2+", top="+(screen.height-j_hei)/2);
}

function showRaw(path,j_wid,j_hei)
{
	if (navigator.appName.indexOf('Microsoft Internet Explorer') != -1)
		condition = (mer1 && !mer1.closed);
	else
		condition = (mer1 && !mer1.closed && mer1.closed != undefined);

	if (condition)
		mer1.close();

	mer1 = window.open("/_popup_raw.php?pic="+path, "winbox", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width="+ j_wid +", height="+ j_hei +", left="+(screen.width-j_wid)/2+", top="+(screen.height-j_hei)/2);
}

function wopen_news(rid,j_wid,j_hei)
{
	if (navigator.appName.indexOf('Microsoft Internet Explorer') != -1)
		condition = (mer && !mer.closed);
	else
		condition = (mer && !mer.closed && mer.closed != undefined);

	if (condition) mer.close();
	mer = window.open("/_popup_news.php?file="+rid+"&w="+j_wid+"&h="+j_hei, "winbox", "toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0, width="+ j_wid +", height="+ j_hei +", left="+(screen.width-j_wid)/2+", top="+(screen.height-j_hei)/2);
}

