// --------------------------------------------------
// newwindow() - shows LINK in a pop-up window
// --------------------------------------------------
function newwindow(link) {
	var stat = 'status=yes,scrollbars=yes'
	wwin = window.open(link, "newwind")
} // newwindow()

// --------------------------------------------------
// popimg()
// --------------------------------------------------
function popimg(img,ww,wh) {
	if (mybw.gecko) {
		var ww0 = parseInt(ww) + 8;
		var wh0 = parseInt(wh) + 49;
	}
	if (mybw.ie) {
		var ww0 = parseInt(ww) + 10;
		var wh0 = parseInt(wh) + 28;
	}
	
	st="dependent,status=0,scrollbars=no,width="+ww0+",height="+wh0

	var wx=(screen.width/2)-(ww0/2)
	var wy=(screen.height/2)-(wh0/2)

	var rnd = Math.random();
	
	newin = window.open("","popwindow",st);

	if (mybw.ie5up || mybw.gecko && !mybw.ie5) {
		newin.blur()
		window.focus()
	}
	newin.resizeTo(ww0,wh0)
	newin.moveTo(wx,wy)
	newin.focus()

	inp=mybw.v5up?
	("<div id='divinp'><input class=button type=button value='закрыть' onclick='self.close()'></div>"):
	("<form name=f1><input class=button type=button value='закрыть' onclick='self.close()'></form>")

	b="<html><head><title>изображение</title>"+
	"<link rel='stylesheet' type='text/css' href='/cms.css'>"+
	"</head><body onclick='javascript:self.close()' style='cursor:pointer;cursor:hand' marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>"+
	"<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td align=center>"+
	"<img border=0 src='"+img+"' width='"+ww+"' height='"+wh+"' title='закрыть' alt='закрыть'>"+
	"</td></tr></table>"+
	// inp+
	"</body></html>";

	wref=newin.document
	wref.write(b)
	wref.close()
} // popimg()

// --------------------------------------------------
// popwindow() - shows LINK in a pop-up window
// --------------------------------------------------
function popwindow(link,ww,wh) {
	var stat = 'dependent,reisze=no,status=0,scrollbars=no,width='+ww+',height='+wh
	var wX=(screen.width/2)-(ww/2)
	if (mybw.ie) wX-=20
	var wY=(screen.height/2)-(wh/2)
	if (mybw.ie) wY-=20

	wwin = window.open(link, "newwin", stat)
	if (mybw.ie5up && !mybw.ie5 || mybw.gecko) {
		wwin.blur()
		window.focus()
	}
	wwin.resizeTo(ww,wh)
	wwin.moveTo(wX,wY)
	wwin.focus()
} // popwindow()

// --------------------------------------------------
// popflash() - shows FLASH in a pop-up window
// --------------------------------------------------
function popflash(link,ww,wh) {
	var stat = 'dependent,status=1,scrollbars=no,width='+ww+',height='+wh
	var wX=(screen.width/2)-(ww/2)
	if (mybw.ie) wX-=20
	var wY=(screen.height/2)-(wh/2)
	if (mybw.ie) wY-=20
	
	dx=0
	dy=45

	wwin = window.open("","newflashwin",stat)
	if (mybw.ie5up && !mybw.ie5) {
		wwin.blur()
		window.focus()
	}
	wwin.resizeTo(ww,wh)
	wwin.moveTo(wX,wY)
	wwin.focus()

	inp="<div style='position:absolute;bottom:5px'><input style='cursor:hand;font:11px tahoma' type=button value='закрыть' onclick='self.close()'></div>\n"

	b = "<html><head><title>Мультимедийные баннеры</title></head><body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0'>"
	b+= "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width="+(ww-dx)+" height="+(wh-dy)+"> \n"
	b+= "<param name=movie value='"+link+"'>\n"
	b+= "<param name=quality value=high>\n"
	b+= "<embed src='"+link+"' quality=high bgcolor=#ffffff width="+(ww-dx)+" height="+(wh-dy)+" type='application/x-shockwave-flash'></embed></object><br>\n"
	//b+= inp
	b+= "</body></html>"

	wref=wwin.document
	wref.write(b)
	wref.close()
} // popflash()

// --------------------------------------------------
// showpop() - shows INFO in a pop-up window
// --------------------------------------------------
function showpop(w,h,title,info) {
st="dependent,status=0,scrollbars=no,width="+w+",height="+h

var wX=(screen.width/2)-(w/2)
if (mybw.ie) wX-=20
var wY=(screen.height/2)-(h/2)
if (mybw.ie) wY-=20

newin=window.open("","popWindow",st)

if (mybw.ie5up && !mybw.ie5) {
	newin.blur()
	window.focus()
}
newin.resizeTo(w,h)
newin.moveTo(wX,wY)
newin.focus()

inp=mybw.v5up?
("<div id='divinp'><input class=button type=button value='закрыть' onclick='self.close()'></div>"):
("<form name=f1><input class=button type=button value='закрыть' onclick='self.close()'></form>")

b="<html><head><title>"+title+"</title>"+
"<link rel='stylesheet' type='text/css' href='css/store.css'>"+
"</head><body bgcolor=#eeeeee>"+
"<table width=100% border=0 cellspacing=0 cellpadding=1><tr width=100%><td align=center>"+
 info+
"</td></tr></table>&nbsp;"+
 inp+
"</body></html>";

wref=newin.document
wref.write(b)
wref.close()
} // showpop()

// --------------------------------------------------
// popreg()
// --------------------------------------------------
function popreg(w,h) {
	popwindow('reg_form.php',w,h-5);
} // popreg()

