﻿function Aj(data) { $.ajax({ type: 'POST', url: 'Handler/index.ashx', data: 'd=' + data, success: function(msg) { ModifPage(msg); } }); }

function L()
{
	Aj('L');
}
function ModifPage(arg) 
{
	vals = arg.split('$#$');

	vals[0] = vals[0].replace("e1e0e2", "000");
	document.getElementById('divJugMsg').innerHTML = vals[0];
	document.getElementById('divTopSem').innerHTML = vals[1];
	document.getElementById('divTop50').innerHTML = vals[2];
	document.getElementById('divLast10').innerHTML = vals[3];
	transformHTML_Videos(vals[4]);
	transformHTML_Foro(vals[5]);
	transformHTML_HomeLinks(vals[6]);

    jQuery('#divTopSem').jCarouselLite({
		vertical: true,
		visible: 10,
		auto: 6000,
		scroll: 10,
		speed: 1000,
		size: 50
	});
   
    jQuery('#divTop50').jCarouselLite({
		vertical: true,
		visible: 10,
		auto: 6000,
		scroll: 10,
		speed: 1000,
		size: 50
	});
}

function transformHTML_Videos(val)
{
	arrayVal = val.split('|');

	html = "<ul class='ArrowList'>";
	for (var i = 0; i < arrayVal.length; i++) 
	{
		html += '<li><a class=\'pVideo\' href=\'' + arrayVal[i+1] + '\'>' + arrayVal[i] + '</a></li>';
		i++;
	}
	html += "</ul>";
	document.getElementById('divVideos').innerHTML = html;
}

function transformHTML_Foro(val)
{
	arrayVal = val.split('|');

	html = "<ul class='ArrowList'>";
	for (var i = 0; i < arrayVal.length-2; i++) 
	{
		html += '<li><a class=\'pVideo\' href=\'' + arrayVal[i+1] + '\'>' + arrayVal[i] + '</a></li>';
		i = i+2;
	}
	html += "</ul>";
	document.getElementById('divForo').innerHTML = html;
}

function transformHTML_HomeLinks(val) {
	arrayVal = val.split('|');

	html = '';
	for (var i = 0; i < arrayVal.length - 2; i++) {
		html += '<a class=\'a\' href=\'' + arrayVal[i + 1] + '\'>' + arrayVal[i] + '&nbsp&nbsp&nbsp</a>';
		i++
	}
	document.getElementById('divHome').innerHTML = html;
}

var timerID;
function redirectBonos(){timerID = self.setTimeout("red()", 1000);}
function red() { window.location = "http://www.pokermac.com.es/Bonos-Poker/"; }

// JScript File
var URI = "pokermac.com.es";
function InicioClick(){window.location = "http://" + URI;}
function ForoClick() { window.location = "http://foro." + URI; }
function NuevoClick() { window.location = "Pages/CrearCuenta.aspx"; }
function ContactoClick(){window.location = "http://" + URI + "/Pages/Contact.aspx";}
function TorneoClick(){window.location = "http://" + URI + "/Torneos-Poker/Torneos-Poker.aspx";}
function MisManosClick(){window.location = "http://" + URI + "/Manos-Poker/Manos-Poker.aspx";}
function MiPerfilClick(){window.location = "http://foro." + URI + "/default.aspx?g=cp_profile";}

function validaF5(e) {
var intKey = (window.Event) ? e.which : e.keyCode;
if (intKey == 116 || intKey == 34){
if (e.preventDefault){
e.preventDefault( );}
else{event.returnValue = false;
event.keyCode = 0;
return false;}
}}