<!--

var arrDialog= new Array();
function openDialog(gsid, sgid, lid, b, sg, code, reg)
{
	l = (screen.width / 2) - 255;
	t = 5;
	index = gsid+'_'+sgid+'_'+lid;
	arrDialog[index] = window.open('http://main.zylom.com/deluxe/downloaddialog.jsp?gsid='+gsid+'&sgid='+sgid+'&lid='+lid+'&bp='+b+'&sg='+sg+'&c='+code+'&r='+reg, ('dd_'+index), 'left='+l+', top='+t+', width=500, height=300, titlebar=no, toolbar=no, menubar=no, scrollbars=no, status=no, resizable=no');

	arrDialog[index].opener = self;
	arrDialog[index].focus();
}

if ( typeof( window[ 'pluginOK' ] ) == "undefined" )
{
		var pluginOK = false;
}


function receiveNotification(method, param)
{
	switch(method)
	{
		case 'ZGP_STATE':
		case 'ZylomGamesPlayerState':
			if(param == 'STATE_EXTENSION_STARTED')
			{
				try
				{
					document.getElementById('ZylomInstallerExtension').Send('',''); //dummy 'Send' as communication-test
					pluginOK = true;
				}
				catch (e){}
			}
		break;
	}
}

function errorWithPlugin()
{
	pluginOK = false;
}

function start(gsid, sgid, lid, b)
{
	if (pluginOK)
	{
		var ddindex = gsid+'_'+sgid+'_'+lid;
		if(!arrDialog[ddindex] || arrDialog[ddindex].closed)
		{
			openDialog(gsid, sgid, lid, b, true);
		}
		else if(arrDialog[ddindex].name = 'dd_'+ddindex)
		{
			arrDialog[ddindex].focus();
		}
	}
	else if (self.handleStartError)
	{
		handleStartError(1, gsid, sgid, lid, b);
	}
}

function download(gsid, sgid, lid, b, r)
{
        try
        {
            pageTracker._trackPageview('/download/' + sgid);
        }catch(e){}

	if (!pluginOK)
	{
		window.location = 'http://main.zylom.com/servlet/DownloadDownloadable?g=' + gsid + '&s=' + sgid;
	}
	else
	{
		var ddindex = gsid+'_'+sgid+'_'+lid;
		if(!arrDialog[ddindex] || arrDialog[ddindex].closed)
		{
			openDialog(gsid, sgid, lid, b, false, 'undefined', r);
		}
		else if(arrDialog[ddindex].name = 'dd_'+ddindex)
		{
			arrDialog[ddindex].focus();
		}
	}
}

function activate(gsid, sgid, lid, code)
{
	
	if (pluginOK)
	{
		var ddindex = gsid+'_'+sgid+'_'+lid;
		if(!arrDialog[ddindex] || arrDialog[ddindex].closed)
		{
			openDialog(gsid, sgid, lid, 0, false, code);
		}
		else if(arrDialog[ddindex].name = 'dd_'+ddindex)
		{
			arrDialog[ddindex].focus();
		}
	}
	else if (self.handleActivateError)
	{
		handleActivateError(1, gsid, sgid, lid, code);
	}
}

if (!(document.getElementById('ZylomInstallerExtension')))
{
  var cabVersion = '1.2.2';
  if((navigator.plugins) && (navigator.plugins['Zylom Plugin']))
  {
  	function ZylomNotification_ZylomInstallerExtension(method, param){ receiveNotification(method, param); }

  	document.open();
  	document.write('<div id="pluginlayer" style="position: absolute; left:-1px; top:-1px; width:1; height:1;">');
  	document.write('<embed type="application/x-zylomgamesplayer;version=2.0.0.0" ');
  	document.write(' width="1" height="1"');
  	document.write(' id="ZylomInstallerExtension"');
  	document.write(' ZGP_extensionCabURL="http://main.zylom.com/activex/ZylomDeluxeInstaller.' + cabVersion + '.cab"');
  	document.write(' ZGP_extensionName="ZylomDeluxeInstaller"');
  	document.write(' ZGP_updateCabURL=""');
  	document.write(' ZGP_foregroundColorBGR="0x000000"');
  	document.write(' ZGP_backgroundColorBGR="0xFFFFFF"');
  	document.write(' partnerName="Zylom"');
  	document.write('></embed></div>');
  	document.close();
  }
  else if (
    (navigator.userAgent) && (navigator.userAgent.indexOf("MSIE") >= 0) && (navigator.appVersion.indexOf("Win") != -1)
    && !((navigator.userAgent.indexOf("MSIE 7.") >= 0) && (navigator.userAgent.indexOf("NT 6.") >= 0))
    )
  {
  	document.open();
  	document.write('<script for="ZylomInstallerExtension" event="Receive(method, param)" language="javascript">javascript:receiveNotification(method, param);</script>');
  	document.write('<div style="position: absolute; left:-1px; top:-1px; width:1; height:1;">');
  	document.write(' <object id="ZylomInstallerExtension" ');
  	document.write(' 	classid="clsid:BFF1950D-B1B4-4ae8-B842-B2CCF06D9A1B" ');
  	document.write('	width="1" height="1" ');
  	document.write('	onerror="javascript:errorWithPlugin();">');
  	document.write('  <param name="ZGP_extensionCabURL" value="http://main.zylom.com/activex/ZylomDeluxeInstaller.' + cabVersion + '.cab">');
  	document.write('  <param name="ZGP_extensionName" value="ZylomDeluxeInstaller">');
  	document.write('  <param name="ZGP_updateCabURL" value="">');
  	document.write('  <param name="ZGP_foregroundColorBGR" value="0x000000">');
  	document.write('  <param name="ZGP_backgroundColorBGR" value="0xFFFFFF">');
  	document.write('  <param name="partnerName" value="zylom">');
  	document.write(' </object>');
  	document.write('</div>');
  	document.close();
  }
}


//-->