function popupItem(item, width, height) {
	window.open(
	item,
	'_blank',
	'toolbar=0,location=0,statusbar=0,menubar=0,width='+width+',height='+height+',left=20,top=20,scrollbars=yes'
	);
}

function ShowImageWindow(picname, width, height, title) 
{
	if(self && self.screen && self.screen.width)
	{
		pos="";
		if(width>self.screen.width)
		{
			winwidth=self.screen.width-20;
			pos+=",left=0";
		}
		else
		{
			winwidth=width;
			pos+=",left="+((self.screen.width-width+17)/2);
		}
		if(height>self.screen.height)
		{
			winheight=self.screen.height-60;
			pos+=",top=0";
		}
		else
		{
			winheight=height;
			pos+=",top="+((self.screen.height-height)/2);
		}
			
	}
	var params='toolbar=no,height='+winheight+',width='+winwidth+',location=no,scrollbars=no,status=no,menubar=no,resizable=no'+pos;
	picwin=window.open("","_blank",params);
	picwin.document.write('<html><title>'+title+'</title>');
	picwin.document.write('<body style="padding: 0; margin: 0;">');
	picwin.document.write('<img src="'+picname+'" width="'+width+'" height="'+height+'" border="0"/>');
	picwin.document.write('</body></html>');
}

function createControl(DivID, URL) {
  var d = document.getElementById(DivID);
  d.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="brother" width="1000" height="520" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+URL+'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="menu" value="false" /><embed menu="false" src="'+URL+'" quality="high" bgcolor="#ffffff" width="1000" height="520" swLiveConnect=true id="brother" name="brother" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
}

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function brother_DoFSCommand(command, args) {
	var brotherObj = isInternetExplorer ? document.all.brother : document.brother;
	//
	if (command.indexOf("showBlock")!=-1) {
		showBlock(args);
	}
	//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub brother_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call brother_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

function showBlock(block) {
	var blockcontainer = document.getElementById('blockcontainer');
	var maincontainer = document.getElementById('maincontainer');
	maincontainer.style.height=maincontainer.offsetHeight+'px';
	height = blockcontainer.offsetHeight;
	if(isInternetExplorer) height=blockcontainer.offsetHeight+112;
	divs = blockcontainer.getElementsByTagName('DIV');
	for(i=0; i<divs.length; i++) {
		if(divs[i].id.indexOf('block')!=-1) {
			divs[i].style.display='none';
		}
	}
	document.getElementById(block).style.display='block';
	maincontainer.style.height=maincontainer.offsetHeight+blockcontainer.offsetHeight-height+'px';
}



function moveToLeft() {
	if(isInternetExplorer) var a = brother.TCallLabel("_root", "left");
}

function moveToRight() {
	if(isInternetExplorer) var a = brother.TCallLabel("_root", "right");
}

function moveToCenter() {
	if(isInternetExplorer) var a = brother.TCallLabel("_root", "center");
}

function changeFont(radio) {
	if(radio.checked){
		document.getElementById("text").className = radio.value;
		document.getElementById("from").className = "textfield "+radio.value;
	}
}