var url = window.location.href;

function getValue(variable)
{
	var variable_pos = url.indexOf(variable);

	if (variable_pos != -1)
	{
		var pos_separador = url.indexOf("&", variable_pos);

		if (pos_separador != -1)
			return url.substring(variable_pos + variable.length + 1, pos_separador);
		else
			return url.substring(variable_pos + variable.length + 1, url.length);
	}
	else
		return "";
}

function loadMovie(name, width, height)
{
	var remplaza = /\+/gi;

	url = unescape(url);
	url = url.replace(remplaza, " ");

	document.write('<div id="flashcontent"');
	document.write('</div>');

	var so = new SWFObject(name, "base", width, height, "8", "#999999", null, null, null, "error/noflash");
	so.addParam("allowFullScreen", "true");

	so.addVariable("gUserName", getValue("userName"));
	so.addVariable("gPasswd", getValue("passwd"));
	so.addVariable("partner", "OPQA");
//	so.addVariable("refresh", Math.random());
	so.write("flashcontent");
}


function foot()
{
	document.write('<font color="#444444" size="-2" face="Arial, Helvetica, sans-serif">OPQA - Juegos OnLine Multijugador. Todos los contenidos de este sitio web son propiedad de OPQA Studios © 2003-2009 - Todos los derechos reservados.');
		document.write('<br><br>');
		
		
		document.write('<a href="http://www.opqa.com/foro/" target="_blank">FORO</a> - ');
		document.write('<a href="http://opqa.spreadshirt.net" target="_blank">SHOPQA</a> - ');
		document.write('<a href="politica/politica.htm" target="_blank" onClick="window.open(this.href,this.target,\'width=580,height=400,scrollbars=1\'); return false;">Política de Privacidad</a> - ');
		document.write('<a href="politica/condiciones.htm" target="_blank" onClick="window.open(this.href, this.target,\'width=580,height=400,scrollbars=1\'); return false;">Condiciones Generales</a> - ');
		document.write('<a href="mailto:webmaster@opqa.com">Contactar</a>');
		
		document.write('<br>');
		
		document.write('<a href="http://www.opqa.com/juegos/3OnLine/">3OnLine</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/4OnLine/">4OnLine</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/ajedrez/">Ajedrez</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/pintamonas/">Pintamonas</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/parchis/">Parchís</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/alfanumericos/">Alfanuméricos</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/domino/">Dominó</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/mas2/">Más2</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/billares/">Billares</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/cruzaletras/">Cruzaletras</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/escoba/">Escoba</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/musete/">Musete</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/chinchon/">Chinchón</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/oca/">Oca</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/bingo/">Bingo</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/eruditos/">Eruditos</a> - ');
		document.write('<a href="http://www.opqa.com/juegos/tute/">Tute</a>');

		document.write('<br>---<br><a href="http://www.ibiguia.com">Guía de Ibiza</a> - ');
		document.write('<a href="http://www.TopPlan.es">PlanTop</a> - ');
		document.write('<a href="http://www.juguetronica.es">Juguetronica</a>');

	document.write('</font>');
}


function bottomR()
{
/*
	document.write('<iframe name=afi468x60' + 
	' src="http://www.netfilia.com/contenidos/insert.html?cmf=83703&con_capa=1&contenido=468x60&web=37337&p=602395557&id=hifko42Rtvd5U&url='+escape(location.href)+'"' + 
	' width=468 height=60 frameBorder=no border=0 marginWidth=0 marginHeight=0 scrolling=no style="border-style:none;" >' + 
	'</iframe>');
*/

	document.write('<iframe name=afi728x90' + 
	' src="http://www.netfilia.com/contenidos/insert.html?cmf=83701&con_capa=1&contenido=728x90&web=37337&p=459858919&id=hiZW/bXZ6/7sk&url='+escape(location.href)+'"' + 
	' width=728 height=90 frameBorder=no border=0 marginWidth=0 marginHeight=0 scrolling=no style="border-style:none;" >' + 
	'</iframe>');
}


function topR()
{
/*
	document.write('<iframe name=afi330x80' + 
	' src="http://www.netfilia.com/contenidos/insert.html?cmf=84108&con_capa=1&contenido=330x80&web=37337&p=1031478663&id=hiYRC8i7j0Vuk&url='+escape(location.href)+'"' + 
	' width=330 height=80 frameBorder=no border=0 marginWidth=0 marginHeight=0 scrolling=no style="border-style:none;" >' + 
	'</iframe>');
*/


	document.write('<iframe name=afi120x90' + 
	' src="http://www.netfilia.com/contenidos/insert.html?cmf=84223&con_capa=1&contenido=120x90&web=37337&p=552669715&id=hik/m.FS0bNFk&url='+escape(location.href)+'"' + 
	' width=120 height=90 frameBorder=no border=0 marginWidth=0 marginHeight=0 scrolling=no style="border-style:none;" >' + 
	'</iframe>');
}

function bottomL()
{
	document.write('<iframe name=afi234x60' + 
	' src="http://www.netfilia.com/contenidos/insert.html?cmf=84109&con_capa=1&contenido=234x60&web=37337&p=193419367&id=hiVXEA2w3WVgA&url='+escape(location.href)+'"' + 
	' width=234 height=60 frameBorder=no border=0 marginWidth=0 marginHeight=0 scrolling=no style="border-style:none;" >' + 
	'</iframe>');
}

function topL()
{
/*
	document.write('<iframe name=afi468x60' + 
	' src="http://www.netfilia.com/contenidos/insert.html?cmf=84110&con_capa=1&contenido=468x60&web=37337&p=1108514437&id=hifko42Rtvd5U&url='+escape(location.href)+'"' + 
	' width=468 height=60 frameBorder=no border=0 marginWidth=0 marginHeight=0 scrolling=no style="border-style:none;" >' + 
	'</iframe>');
*/	
	// TopL 728x90
	document.write('<iframe name=afi728x90' + 
	' src="http://www.netfilia.com/contenidos/insert.html?cmf=83998&con_capa=1&contenido=728x90&web=37337&p=1636983004&id=hiZW/bXZ6/7sk&url='+escape(location.href)+'"' + 
	' width=728 height=90 frameBorder=no border=0 marginWidth=0 marginHeight=0 scrolling=no style="border-style:none;" >' + 
	'</iframe>');
}

function miniScreen(swf, width, height)
{
	document.write('<table width="100%" height="100%" align="center" valign="middle"><tr><td>');
		document.write('<table border="0" cellspacing="0" cellpadding="0" align="center"><tr><td align="center">');
			document.write('<table border="0" cellspacing="0" cellpadding="0"><tr><td>');
				//topL();
				//document.write('</td><td width="15"></td><td>');
				//topbottomL();
			document.write('</td></tr></table>');
		document.write('</td></tr><tr><td height="15">');
		document.write('</td></tr><tr><td align="center">');
				loadMovie(swf, width, height);
		document.write('</td></tr><tr><td align="center">');
				foot();
		document.write('</td></tr><tr><td height="15">');
		document.write('</td></tr><tr><td align="center">');
				document.write('<table border="0" cellspacing="0" cellpadding="0"><tr><td>');
				//bottomR();
				document.write('</td></tr></table>');
		document.write('</td></tr>');
	document.write('</td></tr></table>');
		document.write('</table>');
}


function normalScreen(swf, width, height)
{
	document.write('<table width="100%" height="100%" align="center" valign="middle"><tr><td>');
		document.write('<table border="0" cellspacing="0" cellpadding="0" align="center"><tr><td align="center">');
			document.write('<table border="0" cellspacing="0" cellpadding="0"><tr><td>');
				//topL();
//				document.write('</td><td width="15"></td><td>');
//				topR();
			document.write('</td></tr></table>');
		document.write('</td></tr><tr><td height="15">');
		document.write('</td></tr><tr><td align="center">');
				loadMovie(swf, width, height);
		document.write('</td></tr><tr><td align="center">');
				foot();
		document.write('</td></tr><tr><td height="15">');
		document.write('</td></tr><tr><td align="center">');
				document.write('<table border="0" cellspacing="0" cellpadding="0"><tr><td>');
//				bottomL();
//				document.write('</td><td width="15"></td><td>');
				//bottomR();
				document.write('</td></tr></table>');
		document.write('</td></tr>');
	document.write('</td></tr></table>');
		document.write('</table>');
}
