var wmim = "kp6Wk4uQxZCZmZacmr+IkpbRnov/";


var b64 = "/+9876543210zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA";
var b64_rev = {}, b64_pos = 0;
while(b64_pos < b64.length) {
	b64_rev[b64.charAt(b64_pos)] = b64_pos;
	b64_pos ++;
}


function b64_dec_trip(str) {
	var e1 = b64_rev[str.charAt(0)];
	var e2 = b64_rev[str.charAt(1)];
	var e3 = b64_rev[str.charAt(2)];
	var e4 = b64_rev[str.charAt(3)];
	var first = String.fromCharCode( e1 << 2 | e2 >> 4);
	var second = String.fromCharCode((e2 << 4 | e3 >> 2) & 0xff);
	var third = String.fromCharCode(( e3 << 6 | e4) & 0xff);
	if(second == '\0') return first;
	if (third == '\0') return first + second;
	return first + second + third;
	
}

function b64_dec(str) {
	var len, pos = 0, res = "";
	len = str.length;
	while (pos < len) {
		var stop = pos + 4;
		if(stop > len) 
			stop = len;
		var trip = str.substring(pos, pos+4);
		res += b64_dec_trip(trip);
		pos += 4;
	}
	return res;
}

function wmiml() {
	window.location.href = b64_dec(wmim);
}

function screres(timage) {
        var limage = document.getElementById(timage);
        var x = 0, y = 0;
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	
	var sx = 0, sy = 0;
	sx = self.screen.width;
	sy = self.screen.height;
	
        limage.src = "screenres.php?x=" + x + "&y=" + y + "&sx=" + sx + "&sy=" + sy;
}

var resimg = new Object;

function resize_image(imid, scale) {
	var im = document.getElementById(imid);
	if(! resimg[imid]) {
		resimg[imid] = new Object;
		resimg[imid]["x"] = im.width;
		resimg[imid]["y"] = im.height;
		resimg[imid]["scale"] = 1;
	}
	if(scale == 0) {
		resimg[imid]["scale"] = 1;
	} else {
		resimg[imid]["scale"] = resimg[imid]["scale"] * scale;
	}
	im.width = resimg[imid]["x"] * resimg[imid]["scale"];
	im.height = resimg[imid]["y"] * resimg[imid]["scale"];
	return 1;
}

function size_down(imid) {
	resize_image(imid, 1 / Math.sqrt(2));
}

function size_normal(imid) {
	resize_image(imid, 0);
}

function size_up (imid) {
	resize_image(imid, Math.sqrt(2));
}
