// JavaScript Document
function OpenImage(img)
{
	foto=new Image();
	foto.src=(img);
	ControlImage(img);
	return false;
}

function ControlImage(img)
{
	if((foto.width!=0)&&(foto.height!=0))
	{
		ViewImage(img);
	}
	else
	{
		interval_a="ControlImage('"+img+"')";
		interval_b=setTimeout(interval_a,20);
	}
}

function ViewImage(img)
{
	width=foto.width+60;
	height=foto.height+30;

	if(typeof output != 'undefined')
	{
		try
		{
			if (output.closed == false) throw "offen";
		}
		
		catch (e)
		{
			if (e=="offen")
			{
				output.close();
			}
		}
	}
	
	screenwidth = screen.width;
	screenheight = screen.height;
	pos_x = (screenwidth/2)-(width/2);
	pos_y = (screenheight/2)-(height/2);

	output=window.open("","output","left="+pos_x+",top="+pos_y+",width="+width+",height="+height+",location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes");
	output.document.writeln("<html><head><title>Zertifikat<\/title>");
	output.document.writeln("<link href=\"css/digitalproofxxl.css\" rel=\"stylesheet\" type=\"text/css\" media=\"print, screen\" \/><\/head>");
	output.document.writeln("<body>");
	output.document.writeln("<p style=\"text-align: center; margin: 15px;\"><a href=\"javascript:self.close()\"><img src=\""+img+"\" border=\"10\" alt=\"hier klicken zum schlie&szlig;en\" title=\"hier klicken zum schlie&szlig;en\"></a><\/p>");
	output.document.writeln("<\/body><\/html>");
	output.document.close();
	output.focus();
}

function keycheck (Ereignis)
{
	if (!Ereignis) Ereignis = window.event;
	if (Ereignis.which)
	{
		Tastencode = Ereignis.which;
	}
	else if (Ereignis.keyCode)
	{
		Tastencode = Ereignis.keyCode;
	}
	if(Tastencode == 13) return false;
}
