// codigo de archivo datos_ppll.js
var mi_url = document.location.href;

if(mi_url.indexOf("ideal.") > 0){
	var pkey = 'hnWqsj3pMffzBweOuE2ThVpv4bLiEmb7aAnI7UHbX9Tg7UX1iU3tqDIpIfaHOrEy';
	var s_vocid = 'http://comunidad.ideal.es/';
	var ak_vocid = 'http://vocid-cdn.ideal.es/';
	var forum = 'idealcom';
	var nombre_sso='ideal';
}

if(mi_url.indexOf("elcorreo.") > 0){
	var pkey = 'xG3uTIP1l9yyOHd8hKoZ6ZIeZK4JKqnGTH1G7S3UsLb45UHQV38QjbcsRLH75c2W';
	var s_vocid = 'http://comunidad.elcorreo.com/';
	var ak_vocid = 'http://vocid-cdn.elcorreo.com/';
	var forum = 'elcorreo';
	var nombre_sso='elcorreo';
}

if(mi_url.indexOf("diariovasco.") > 0){
	var pkey = 'JGyo191jJjtzxQgd6jiLNLK1ROg0BPBCjqCUPhcQYe4EOv4X7p8N6w6MQkl7eCxP';
	var s_vocid = 'http://gente.diariovasco.com/';
	var ak_vocid = 'http://vocid-cdn.diariovasco.com/';
	var forum = 'diariovasco';
	var nombre_sso='diariovasco';
}

if(mi_url.indexOf("hoy.") > 0){
	var pkey = 'TOQoGvTCAQJrcOynWIvBHevEMUEDHYNzpGg0jKlROc5WB4sqmp5p6XPU9gW0y4nR';
	var s_vocid = 'http://comunidad.hoy.es/';
	var ak_vocid = 'http://vocid-cdn.hoy.es/';
	var forum = 'hoydigital';
	var nombre_sso='hoy';
}

if(mi_url.indexOf("elcomercio.") > 0){
	var pkey = 'xpr5CPVYwZvz7sIUAZgSmtBwmUJ4hIEqrmpj0PQFKqvGvTK7vEMsBVvH1nTH4DW4';
	var s_vocid = 'http://comunidad.elcomercio.es/';
	var ak_vocid = 'http://vocid-cdn.elcomercio.es/';
	var forum = 'elcomerciocom';
	var nombre_sso='elcomercio';
}

if(mi_url.indexOf("laverdad.") > 0){
	var pkey = 'DlLe6r7jEuZyLqu759vFkxMs28ElyObwA9coqOoVJhrrtl6osIWKzNQZZQQFFJ80';
	var s_vocid = 'http://comunidad.laverdad.es/';
	var ak_vocid = 'http://vocid-cdn.laverdad.es/';
	var forum = 'laverdadcom';
	var nombre_sso='laverdad';
}

if(mi_url.indexOf("eldiariomontanes.") > 0){
	var pkey = 'sU9FYRAe4e69fTNgnqkZoN4dFoeBEQEAWgwSnTqQ4BLGqCRuLR6FqIKGZ4h4N3Ww';
	var s_vocid = 'http://comunidad.eldiariomontanes.es/';
	var ak_vocid = 'http://vocid-cdn.eldiariomontanes.es/';
	var forum = 'diariomontanes';
	var nombre_sso='eldiariomontanes';
}

if(mi_url.indexOf("diariosur.") > 0){
	var pkey = 'oTMLuKQ7JhrzbTM3svpvKuFK8ED9AakBofjppyZNnMJe3xnDgvA8GYvA3xwS2OLz';
	var s_vocid = 'http://comunidad.diariosur.es/';
	var ak_vocid = 'http://vocid-cdn.diariosur.es/';
	var forum = 'diariosur';
	var nombre_sso='diariosur';
}

if(mi_url.indexOf("lasprovincias.") > 0){
	var pkey = 'SV1M3rgrvLNRDcSPkbl0WgycJzGsGWMGhQD6FnJKnvU64GvI0JyUbUTG6E7P3B2A';
	var s_vocid = 'http://comunidad.lasprovincias.es/';
	var ak_vocid = 'http://vocid-cdn.lasprovincias.es/';
	var forum = 'lasprovincias';
	var nombre_sso='lasprovincias';
}

if(mi_url.indexOf("elnortedecastilla.") > 0){
	var pkey = 'uFV6WGrHeEFs4RTUJez5fW9TLbaWeVSEMgQhArXFlu4tGY9wXtAZdzjDYdRgdyis';
	var s_vocid = 'http://comunidad.elnortedecastilla.es/';
	var ak_vocid = 'http://vocid-cdn.nortecastilla.es/';
	var forum = 'elnortedecastilla';
	var nombre_sso='elnortedecastilla';
}

if(mi_url.indexOf("larioja.") > 0){
	var pkey = 'nDQRKQ1Fk4ouD0IxvlajPOW6Y28kbGns4795VRT1LGEaBH8r2g8A8GYHjo6Zr0W2';
	var s_vocid = 'http://comunidad.larioja.com/';
	var ak_vocid = 'http://vocid-cdn.larioja.com/';
	var forum = 'lariojadigital';
	var nombre_sso='larioja';
}

if(mi_url.indexOf("lavozdigital.") > 0){
	var pkey = 'LaGNBMUkUBbs7LnDKnuvABjVPjJN4IzJlSpE1iTUTJv8yCnZIHu1t0d7kaiJvOex';
	var s_vocid = 'http://comunidad.lavozdigital.es/';
	var ak_vocid = 'http://vocid-cdn.lavozdigital.es/';
	var forum = 'lavozdigital';
	var nombre_sso='lavoz';
}


// codigo archivo disqus_ppll.js
//FUNCIONES GENERALES PARA TRABAJAR CON COOKIES
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 setCookie(name, value, expires, path, domain, secure) {
document.cookie = name + "=" + escape(value) +
((expires == null) ? "" : "; expires=" + "") +
((path == null) ? "" : "; path=" + path) +
((domain == null) ? "" : "; domain=" + domain) +
((secure == null) ? "" : "; secure");
}
function delCookie (name,path,domain) {
if (getCookie(name)) {
document.cookie = name + "=" +" "+"; expires=Thu, 01-Jan-70 00:00:01 GMT;";
}
}
/////////

var disqus_url = document.URL;
var hmac = "";

var datos_usuario = getCookie('registro');
$.getJSON( ak_vocid+'apoyo/disqus/getHash.php?callback=?',
{'id': getCookie('id'),
'mail': getCookie('mail'),
'avatar': getCookie('avatar'),
'forum' : forum,
'datos_usuario': datos_usuario
},
	function(data) {
		hmac = data[0];
		cargaDisqus();
	});

function cargaDisqus(){
		disqus_config = function(){
		this.sso = {
		name: nombre_sso,
		button: "",
		icon: "",
		url: s_vocid+'login.php?r='+disqus_url,
		logout: "javascript:logout(1)",
		width: "600",
		height: "400"
		};
		this.page.remote_auth_s3 = hmac;
		this.page.api_key = pkey;
		};
	}
//logout
function logout(opcion){
	if(opcion){
		queid_logout();
	}
}

// comentarios.disqus.js
var disqus_shortname=forum;
var COMENTARIOS_DISQUS = {};

COMENTARIOS_DISQUS.obtenerComentarios = function() {
	if (typeof(disqus_shortname) != 'undefined') {
		(function() {
			var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
			dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
			(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
		})();
	}
}

COMENTARIOS_DISQUS.obtenerNumeroComentarios = function() {
	DISQUSWIDGETS = {};

	DISQUSWIDGETS.displayCount = function(datos) {
		var texto = 'Comentarios';
		if(datos.counts[0].comments == 1) {
			texto = 'Comentario';
		}
		$('.anclaopina').html('<span id="num-comentarios" class="art_ch5_comentarios">' + datos.counts[0].comments + '</span>' + texto);
	}

	if (typeof(disqus_shortname) != 'undefined' && typeof(disqus_identifier) != 'undefined') {
		$.getScript('http://' + disqus_shortname + '.disqus.com/count.js?q=1&0=1,' + disqus_identifier, function(data) {
		});
	}
}

COMENTARIOS_DISQUS.obtenerNumeroComentariosPortada = function() {
	//alert($('[data-disqus-identifier]').size());
	if (typeof(disqus_shortname) != 'undefined') {
		(function () {
			var s = document.createElement('script'); s.async = true;
			s.type = 'text/javascript';
			s.src = 'http://' + disqus_shortname + '.disqus.com/count.js';
			(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
		}());
	}
}

function getNumComentariosPortada(id) {
	return false;
}
