function flashCM(URL,width,height,vars,bgColor) {
	var id=URL.split("/")[URL.split("/").length-1].split(".")[0];
	document.write("	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' "); 
	document.write("	width='"+width+"' height='"+height+"' id='"+id+"' align='middle'> ");
	document.write("	<param name='allowScriptAccess' value='always' /> ");
	document.write("	<param name='movie' value='"+URL+"' /> ");
	document.write("	<param name='FlashVars' value='"+vars+"' /> ");
	document.write("	<param name='menu' value='true' /> ");
	document.write("	<param name='quality' value='high' /> ");
	document.write("	<param name='bgcolor' value='"+bgColor+"' /> ");
	document.write("	<embed src='"+URL+"' flashVars='"+vars+"' menu='true' quality='high' ");
	document.write("	bgcolor='"+bgColor+"' width='"+width+"' height='"+height+"' name='"+id+"' align='middle' ");
	document.write("	allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /> ");
	document.write("	</object> ");
}

function downJava(url) {
	location.href = url;
}

function openJava(url) {
	window.open(url);void(0);
}

function closeJava() {
	window.close();
}

function openFit() {
	var intLeft = (screen.availWidth/2) - 512;
	var intTop = (screen.availHeight/2) - 384;
	window.open('index_emp.html','emp','width=1024,height=768,top='+intTop+',left='+intLeft+',scrollbars=no,resizable=no');void(0);
}

function openFull() {
	var intWidth = screen.availWidth - 10;
	var intHeight = screen.availHeight - 10;
	window.open('index_emp_full.html','emp','width='+intWidth+',height='+intHeight+',top=0,left=0,scrollbars=no,resizable=no');void(0);
}

function resizeFit(width,height) {
	autoSize(0, 0, 1024, 768);
}

function resizeFull() {
	var intWidth = screen.availWidth + 0;
	var intHeight = screen.availHeight + 20;
	autoSize(0, 0, intWidth, intHeight);
}

x = 0;
y = 0;
w = screen.availWidth;
h = screen.availHeight;
function win_move(tx, ty,tw,th) {
	cw = Math.abs(tw-w)>1
    ch = Math.abs(th-h)>1
	if (cw || ch) {
		w = w+(tw-w)*0.5;
		h = h+(th-h)*0.5;
		window.moveTo(x, y);
           x=(screen.width-w)/2;
		   y=(screen.height-h)/2 - 30;
		window.resizeTo(w, h);
	} else {
		clearInterval(id);
	}
}

function autoSize(x, y,w,h) {
	id = setInterval("win_move("+x+","+y+","+w+","+h+")", 10);
}