

function ir_a_tienda(parametros) {
	var url_tienda = "http://www.latrastiendadigital.com/"+nombre_tienda+"/default.asp?" + parametros;
	var pop_tienda = open(url_tienda, "pop_tienda", "scrollbars=1,menubar=1,titlebar=1,resizable=1,status=1,location=1");
}



// Variables para Cookies
var quiere_info;

var dias_semana = Array('domingo', 'lunes', 'martes', 'miercoles', 'jueves', 'viernes', 'sabado');
var meses = Array('enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre');

// Funciones para Cookies
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

function grabar_info(nombre, dato) {
    tope = new Date();
    fixDate(tope);
    tope.setTime(tope.getTime() + 1000 * 60 * 60 * 24);
    setCookie(nombre, dato, tope);
}

function recuperar_info(nombre) {
    quiere_info = getCookie(nombre);
	if(!quiere_info) {
		quiere_info = "";
	}
}

function recuperar_info_auto(nombre) {
    quiere_info = getCookie(nombre);
	if(!quiere_info) {
		quiere_info = "";
	}
}

//Zooming

 function ftvlaunch(video,quality,pid) {
	  var LeftPosition = (screen.width) ? (screen.width-665)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-430)/2 : 0;
	  var popwin = window.open('http://videonoticias.vocento.com/videoplayer/index.cfm?id='+video+'&mode=normal&quality='+ quality +'&pid='+ pid,'MTV6_window','toolbar=no,width=665,height=430,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}

//Tour de France 2005 video player launch:

function tourlaunchNL(video,quality,pid,langid) {
	  var LeftPosition = (screen.width) ? (screen.width-648)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-460)/2 : 0;
	  var popwin = window.open('http://videonoticias.vocento.com/tourdefrance2005/videoplayer/index.cfm?id='+video+'&mode=normal&quality='+ quality +'&pid='+ pid + '&lang='+ langid,'MTV6_window','toolbar=no,width=648,height=460,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}

function tourlaunch(video,quality,pid,langid) {
	switch(langid)
	{
		case "1":
			tourlaunchNL(video,quality,pid,"NL");
			break;
		case "2":
			tourlaunchBE(video,quality,pid,"BE");
			break;
	}
}

function tourlaunchBE(video,quality,pid,langid) {
	  var LeftPosition = (screen.width) ? (screen.width-665)/2 : 0;
	  var TopPosition = (screen.height) ? (screen.height-457)/2 : 0;
	  var popwin = window.open('http://videonoticias.vocento.com/tourdefrance2005/videoplayer/index.cfm?fuseaction=homebe&id='+video+'&mode=normal&quality='+ quality +'&pid='+ pid + '&lang='+ langid,'MTV7_window','toolbar=no,width=665,height=457,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}
