//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;";
}
}
//FIN DE LAS FUNCIONES GENERALES PARA TRABAJAR CON COOKIES


var disqus_url = document.URL;
var hmac = "";

var datos_usuario = getCookie('registro');
$.getJSON( s_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];
});

var 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;
};

function logout(opcion){
	if(opcion){
		queid_logout();
	}
}

