﻿// ****************************************************************************************** functions for cookie handle:

var FechCad = new Date ();RECcookie (FechCad);FechCad.setTime (FechCad.getTime() + (12 * 31 * 24 * 60 * 60 * 1000));
function leeValCok (offset) {
  var FinC = document.cookie.indexOf (";", offset);
  if (FinC == -1)
    FinC = document.cookie.length;
  return unescape(document.cookie.substring(offset, FinC));
}

function RECcookie (fecha) {
  var b = new Date(0), tm = b.getTime();
  if (tm > 0) fecha.setTime (fecha.getTime() - tm);
}

function GrabaCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function LeeCookie (nombre) {
  var ar = nombre + "=", arL = ar.length, cooL = document.cookie.length, X = 0;
  while (X < cooL) {var Y = X + arL;if (document.cookie.substring(X, Y) == ar)return leeValCok (Y);
  X = document.cookie.indexOf(" ", X) + 1; if (X==0) break;}
  return null;
}


function TizGet(c,def){ /* © 2002  - DGB v1.0 || get parameter of query string*/
 var ls = location.search, result = false;
 if(ls.indexOf(c)>=0){
  var txtRst = ls.substring(ls.indexOf(c),ls.length);
  var txtCmp = txtRst.substring(0,txtRst.indexOf('&'));
  if (txtCmp=='') txtCmp = txtRst.substring(0,txtRst.length);
  result = txtCmp.substring((txtCmp.indexOf('=')+1),txtCmp.length);
 }
 if(result=='false'||result==false){if(def)result=def};
 return(unescape(result));
}
actual = TizGet('quetemp',tempActual);
qpublico = TizGet('qpublico','0');
if(qpublico=='0'){//mirar a ver si hay cookier registrada
	qpublico = LeeCookie("PublicoUsuario");
	if(!qpublico){
		qpublico = '0';
	}
}

itemsolo = TizGet('qitem','false');

document.write('<scr'+'ipt src="contenidos/temporada' + actual + '/actuaciones.js"></scr'+'ipt>');	