function ScaleSize()
{
document.getElementById("imgTag").style.width = document.body.clientWidth;
document.getElementById("imgTag").style.height = document.body.clientHeight;
}

/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}

function callServer() {
  // Get the city and state from the web form
  var rating = document.getElementById("rating").value;
  var reason = document.getElementById("reason").value;
  var post_id = document.getElementById("post_id").value;
  // Only go on if there are values for both fields
  if ((reason == null) || (reason == "")) return;

  // Build the URL to connect to
  var url = "/post?rating=" + escape(rating) + "&reason=" + escape(reason) + "&post_id=" + escape(post_id) + "&f=Rating";

  // Open a connection to the server
  xmlHttp.open("GET", url, true);

  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = updatePage;

  // Send the request
  xmlHttp.send(null); }

function getPosts() {
  var blog_id = document.getElementById("b").value;
	var url = "/php/admin/remote?b=" + escape(blog_id) + "&event=getposts";
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = function() {
	if (xmlHttp.readyState == 4) {
		var response = xmlHttp.responseText;
		document.getElementById('entrylist').innerHTML = response; } }
  xmlHttp.send(null); }

function getCategories() {
  var blog_id = document.getElementById("post_blogid").value;
  var post_id = document.getElementById("post_id").value;
	var url = "/php/admin/remote?b=" + escape(blog_id) + "&p=" + escape(post_id) + "&event=getcats";
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = function() {
	if (xmlHttp.readyState == 4) {
		var response = xmlHttp.responseText;
		document.getElementById('post_category').innerHTML = response; } }
  xmlHttp.send(null); }

function postRate(post_id, rate) {
	if (rate=="plus") { var rating = "+1"; }
	else if (rate=="neg") { var rating = "-1"; }
	var url = "/post?rating=" + escape(rating) + "&post_id=" + escape(post_id) + "&f=Rating";
	xmlHttp.open("GET", url, true);
	xmlHttp.onreadystatechange = function() {
	if (xmlHttp.readyState == 4) {
		var response = xmlHttp.responseText;
		document.getElementById('currate'+post_id).innerHTML = response; } }
  xmlHttp.send(null); }

function MM_jumpMenu(targ, selObj, restore) {
  eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
  if ( restore ) selObj.selectedIndex = 0; }
