function printContents()
{
	iWidth = window.screen.width;
	iHeight = window.screen.height;
    wt = 630;
    ht = 460;
    lt = (iWidth - wt) / 2;
    tp = (iHeight - ht) / 2;
    window.open("print.php", '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes'); 
}

function printContentsEn(url)
{
	iWidth = window.screen.width;
	iHeight = window.screen.height;
    wt = 630;
    ht = 460;
    lt = (iWidth - wt) / 2;
    tp = (iHeight - ht) / 2;
    window.open(url+"/print.php?lang=en", '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes'); 
}

function preview(file, desc, width, height)
{
 if (desc == null) {
   desc = '';
 }
 var left = (screen.width - width) / 2;
 var top = (screen.height - height + 20) / 2;
 window.open("preview.php?file="+file+"&desc="+desc, "_preview_", "width="+width+",height="+height+",top="+top+",left="+left);
}

function previewEn(url, file, desc, width, height)
{
 if (desc == null) {
   desc = '';
 }
 var left = (screen.width - width) / 2;
 var top = (screen.height - height + 20) / 2;
 window.open(url+"/preview.php?lang=en&file="+file+"&desc="+desc, "_preview_", "width="+width+",height="+height+",top="+top+",left="+left);
}

function fitColumns() 
{
	var left = document.getElementById('leftColumn').offsetHeight;
	var subpage = document.getElementById('mainColumn').offsetHeight;
//	alert(left + ' --- ' + subpage + ' --- ' + subpage2);
	if (left + 50 > subpage)
		document.getElementById('mainColumn').style.height = (left + 50) + 'px';
}

with (navigator) if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1)
{
	document.write('<scr'+'ipt language="VBScript">\nMM_flash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n</scr'+'ipt>');
}

function MM_checkPlugin(plgIn)
{
  	var result = false;

 	if (navigator.appName.indexOf('Microsoft')==-1 || (navigator.plugins && navigator.plugins.length))
  	{
  		result = navigator.plugins[plgIn] != null ? true : false;
  	}
  	else
  	{
  		if (navigator.appName.indexOf('Microsoft')!=-1 && navigator.appVersion.indexOf('Mac')==-1)
		{
			result = MM_flash;
		}
	}
	result = result == true ? true : false;
	return result;  		
}

var flashExists = MM_checkPlugin("Shockwave Flash");

function printFlash(file, width, height, id)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
					+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" '
					+ 'width="'+width+'" height="'+height+'" id="'+id+'" align="middle">'
					+ '<param name="allowScriptAccess" value="sameDomain" />'
					+ '<param name="movie" value="'+file+'" />'
					+ '<param name="quality" value="high" />'
					+ '<param name="bgcolor" value="#cccccc" />'
					+ '<param name="wmode" value="transparent" />'
					+ '<embed src="'+file+'" quality="high" bgcolor="#cccccc" wmode="transparent"'
					+ ' width="'+width+'" height="'+height+'" name="'+id+'" align="middle"'
					+ ' allowScriptAccess="sameDomain" type="application/x-shockwave-flash"'
					+ ' pluginspage="http://www.macromedia.com/go/getflashplayer" />'
					+ '</object>');
}

function printHeader(file, width, height, id)
{
	document.write('<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
					+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" '
					+ 'width="'+width+'" height="'+height+'" id="'+id+'" align="middle">'
					+ '<param name="allowScriptAccess" value="sameDomain" />'
					+ '<param name="movie" value="'+file+'" />'
					+ '<param name="quality" value="high" />'
					+ '<param name="bgcolor" value="#cccccc" />'
					+ '<param name="wmode" value="transparent" />'
					+ '<embed src="'+file+'" quality="high" bgcolor="#cccccc" wmode="transparent"'
					+ ' width="'+width+'" height="'+height+'" name="'+id+'" align="middle"'
					+ ' allowScriptAccess="sameDomain" type="application/x-shockwave-flash"'
					+ ' pluginspage="http://www.macromedia.com/go/getflashplayer" />'
					+ '</object></div>');
}

function printHeaderVars(file, width, height, id, vars)
{
    document.write('<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
                    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" '
                    + 'width="'+width+'" height="'+height+'" id="'+id+'" align="middle">'
                    + '<param name="allowScriptAccess" value="sameDomain" />'
                    + '<param name="movie" value="'+file+'" />'
                    + '<param name="quality" value="high" />'
                    + '<param name="bgcolor" value="#cccccc" />'
                    + '<param name="wmode" value="transparent" />'  
                    + '<param name="flashVars" value="'+vars+'" />'     
                    + '<embed src="'+file+'" quality="high" bgcolor="#cccccc" wmode="transparent"'
                    + ' width="'+width+'" height="'+height+'" name="'+id+'" align="middle" flashvars="'+vars+'"'
                    + ' allowScriptAccess="sameDomain" type="application/x-shockwave-flash"'
                    + ' pluginspage="http://www.macromedia.com/go/getflashplayer" />'
                    + '</object></div>');
}

function showTable(item)
{
	document.getElementById(item).style.display = 'block';
}

var flashOnPage = false;

function fitStrips() {
	document.write('<div id="strips"></div>');
	
	iSize = (document.body.offsetWidth - 776) / 2;
	if (navigator.appName.indexOf('Microsoft') != -1) {
		if (flashOnPage == true) {
			document.getElementById("strips").style.top = '-1px';
			document.getElementById("header").style.margin = '-1px 0 0 0';
			document.getElementById("paper").style.margin = '-1px 0 0 0';
		}
	}
	document.getElementById("strips").style.width = iSize + 'px';
	if (navigator.appName == "Opera") {
		document.getElementById("strips").style.top = 0 + 'px';
	}
}

function fitStripsSub() {
	document.write('<div id="strips"></div>');
	
	iSize = (document.body.offsetWidth - 776) / 2;
	if (navigator.appName.indexOf('Microsoft') != -1) {
		document.getElementById("header").style.margin = '-1px 0 0 0';
		if (flashOnPage == true) {
			document.getElementById("paper").style.margin = '-3px 0 0 0';
		}
	}
	document.getElementById("strips").style.width = iSize + 'px';
	if (navigator.appName == "Opera") {
		document.getElementById("strips").style.top = 0 + 'px';
	}
	
}