	var openInFrameLogin = function(hash)    {	        var $trigger = $(hash.t);        		var $modalWindow = $(hash.w);        		var $modalContainer = $('iframe', $modalWindow);        		var myUrl = 'http://concurso.peloton.cl/portal/login/login.php?width=720&height=550'; 				var myTitle = 'Login Pelot�n 2009 TVN';		        var newWidth = 0, newHeight = 0, newLeft = 0, newTop = 0;        $modalContainer.html('').attr('src', myUrl);        $('#jqmTitleText').text(myTitle);        myUrl = (myUrl.lastIndexOf("#") > -1) ? myUrl.slice(0, myUrl.lastIndexOf("#")) : myUrl;        var queryString = (myUrl.indexOf("?") > -1) ? myUrl.substr(myUrl.indexOf("?") + 1) : null;        if (queryString != null && typeof queryString != 'undefined')        {            var queryVarsArray = queryString.split("&");            for (var i = 0; i < queryVarsArray.length; i++)            {                if (unescape(queryVarsArray[i].split("=")[0]) == 'width')                {                    var newWidth = queryVarsArray[i].split("=")[1];                }                if (escape(unescape(queryVarsArray[i].split("=")[0])) == 'height')                {                    var newHeight = queryVarsArray[i].split("=")[1];                }                if (escape(unescape(queryVarsArray[i].split("=")[0])) == 'jqmRefresh')                {                    // if true, launches a "refresh parent window" order after the modal is closed.                    hash.refreshAfterClose = queryVarsArray[i].split("=")[1]                } else                {                    hash.refreshAfterClose = false;                }            }            // let's run through all possible values: 90%, nothing or a value in pixel            if (newHeight != 0)            {                if (newHeight.indexOf('%') > -1)                {                    newHeight = Math.floor(parseInt($(window).height()) * (parseInt(newHeight) / 100));                }                var newTop = Math.floor(parseInt($(window).height() - newHeight) / 2);            }            else            {                newHeight = $modalWindow.height();            }            if (newWidth != 0)            {                if (newWidth.indexOf('%') > -1)                {                    newWidth = Math.floor(parseInt($(window).width() / 100) * parseInt(newWidth));                }                var newLeft = Math.floor(parseInt($(window).width() / 2) - parseInt(newWidth) / 2);            }            else            {                newWidth = $modalWindow.width();            }            // do the animation so that the windows stays on center of screen despite resizing        			$modalWindow.css({                width: newWidth,                height: newHeight,                opacity: 1            }).jqmShow().animate({                width: newWidth,                height: newHeight,                top: newTop,                left: newLeft,                marginLeft: 0,                opacity: 1            }, 'fast');							        }        else        {            // don't do animations            $modalWindow.jqmShow();        }    }  var openInFrameRegistro = function(hash)    {	        var $trigger = $(hash.t);        		var $modalWindow = $(hash.w);        		var $modalContainer = $('iframe', $modalWindow);        		var myUrl = 'http://concurso.peloton.cl/portal/registro/registro.php?width=720&height=550'; 				var myTitle = 'Registro Pelot�n 2009 TVN';		        var newWidth = 0, newHeight = 0, newLeft = 0, newTop = 0;        		$modalContainer.html('').attr('src', myUrl);        		$('#jqmTitleText').text(myTitle);        		myUrl = (myUrl.lastIndexOf("#") > -1) ? myUrl.slice(0, myUrl.lastIndexOf("#")) : myUrl;        		var queryString = (myUrl.indexOf("?") > -1) ? myUrl.substr(myUrl.indexOf("?") + 1) : null;        if (queryString != null && typeof queryString != 'undefined')        {            var queryVarsArray = queryString.split("&");            for (var i = 0; i < queryVarsArray.length; i++)            {                if (unescape(queryVarsArray[i].split("=")[0]) == 'width')                {                    var newWidth = queryVarsArray[i].split("=")[1];                }                if (escape(unescape(queryVarsArray[i].split("=")[0])) == 'height')                {                    var newHeight = queryVarsArray[i].split("=")[1];                }                if (escape(unescape(queryVarsArray[i].split("=")[0])) == 'jqmRefresh')                {                    // if true, launches a "refresh parent window" order after the modal is closed.                    hash.refreshAfterClose = queryVarsArray[i].split("=")[1]                } else                {                    hash.refreshAfterClose = false;                }            }            // let's run through all possible values: 90%, nothing or a value in pixel            if (newHeight != 0)            {                if (newHeight.indexOf('%') > -1)                {                    newHeight = Math.floor(parseInt($(window).height()) * (parseInt(newHeight) / 100));                }                var newTop = Math.floor(parseInt($(window).height() - newHeight) / 2);            }            else            {                newHeight = $modalWindow.height();            }            if (newWidth != 0)            {                if (newWidth.indexOf('%') > -1)                {                    newWidth = Math.floor(parseInt($(window).width() / 100) * parseInt(newWidth));                }                var newLeft = Math.floor(parseInt($(window).width() / 2) - parseInt(newWidth) / 2);            }            else            {                newWidth = $modalWindow.width();            }            // do the animation so that the windows stays on center of screen despite resizing        			$modalWindow.css({                width: newWidth,                height: newHeight,                opacity: 1            }).jqmShow().animate({                width: newWidth,                height: newHeight,                top: newTop,                left: newLeft,                marginLeft: 0,                opacity: 1            }, 'fast');							        }        else        {            // don't do animations            $modalWindow.jqmShow();        }    }	  var closeModalLogin = function(hash)    {        var $modalWindow = $(hash.w);        $modalWindow.fadeOut('5', function()        {            hash.o.remove();            //refresh parent            if (hash.refreshAfterClose === 'true')            {                window.location.href = document.location.href;            }        });				thisMovie("pelotonElite").loginOk();    };   var closeModalRegistro = function(hash)    {        var $modalWindow = $(hash.w);        $modalWindow.fadeOut('5', function()        {            hash.o.remove();            //refresh parent            if (hash.refreshAfterClose === 'true')            {                window.location.href = document.location.href;            }        });		thisMovie("pelotonElite").loginOk();    };			function thisMovie(movieName) {		if (navigator.appName.indexOf("Microsoft") != -1) {			return window[movieName];		} else {			return document[movieName];		}	}	function abrirLogin(){		$('#modalWindow').jqm({target: '#jqmContent', trigger: false,modal:true,onShow: openInFrameLogin, onHide: closeModalLogin }).jqmShow(); 	}	function abrirRegistro(){		$('#modalWindow').jqm({target: '#jqmContent', trigger: false,modal:true,onShow: openInFrameRegistro, onHide: closeModalRegistro }).jqmShow(); 	}		function getXMLHTTPRequest(){	   try{	                req = new XMLHttpRequest();	        } catch (err1) {	                 try{	         req = new ActiveXObject("Msxml2.XMLHTTP");	    } catch (err2){	        try{	        req = new ActiveXObject("Microsoft.XMLHTTP");	      } catch (err3) {	        req = false;	      }	    }	  }	  return req;	}		function cerrarSesion(){								var http = getXMLHTTPRequest();		var miRand=parseInt(Math.random()*99999999);		var url = "cerrarSesion.php";							http.open("GET",url,true);			http.onreadystatechange = function(){			  if(http.readyState == 4){					return true;			  }		}			http.send(null);					alert('Su sesión fue cerrada');										}