var browser_name = navigator.appName;
var stat = 0;
var win  = 0;

function w(url, name, width, height, scroll) {
	if(typeof win == 'object') {
		win.close();
	}

	if(typeof scroll == 'string') {
		switch(scroll) {
			case 'v':
				width = parseInt(width) + 20;
				break;

			case 'h':
				height = parseInt(height) + 20;
				break;

			case 'b':
			default:
				width = parseInt(width) + 20;
				height = parseInt(height) + 20;
				break;
		}

		scrollVal = 'yes';

	} else {
		scrollVal = 'no';
	}

	win = window.open(url, 'wx', 'width='+width+', height='+height+', toolbar=no, status=no, location=no, menubar=no, resizable=yes, scrollbars='+scrollVal);
	win.document.open();
	win.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'+"\n"+'<HTML><HEAD><TITLE>'+name+'</TITLE><STYLE>HTML, BODY { padding: 0; margin: 0; background: #FFFFFF;  height: 100%;} IMG { display: block; border: 0; margin: auto; } </STYLE></HEAD><BODY onclick="window.close();"><IMG src="'+url+'" alt="'+name+'"></BODY></HTML>');
	win.document.close();
	win.focus();
}

function InsertFlashMovie(swf, width, height, bgcolor) {
	if (document.all) {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'" id="mainFla">');
		document.write('<param name="movie" value="'+swf+'">');
	} else {
		document.write('<object type="application/x-shockwave-flash" data="'+swf+'" width="'+width+'" height="'+height+'" id="mainFla">');
	}
	document.write('<param name="quality" value="high">');
	document.write('<param name="menu" value="false">');
	document.write('<param name="bgcolor" value="#'+bgcolor+'">');
	document.write('<param name="wmode" value="transparent">');
	document.write('</object>');
}
