function showVoting(){
	if(document.getElementById('voting').style.display == 'block'){
		document.getElementById('voting').style.display = 'none';
		document.getElementById('vote_sign').src = "/img/plus2.gif";
	}else{
		document.getElementById('voting').style.display = 'block';
		document.getElementById('vote_sign').src = "/img/minus2.gif";
	}
}


var resId=0;
var imgWndw;

function imgOpen(imgLink,Title) {
  if (typeof(window.resizeBy)=='undefined') return true;
  imgWndw=window.open('',imgLink.target,'width=100,height=100'+
    ',toolbar=no,menubar=no,location=no,status=no,'+
    'resizable=yes,scrollbars=no,left='+(screen.width>>>2)+
    ',top='+(screen.height>>>4));
  self.focus();
  var imgTitle=(Title)?Title:imgLink.href;
  with (imgWndw.document){
    open();
    write('<ht'+'ml><he'+'ad><ti'+'tle>'+imgTitle+'</ti'+'tle>'+
    '</he'+'ad><bo'+'dy leftmargin="0" topmargin="0" '+
    'rightmargin="0" bottommargin="0" marginwidth="0" '+
    'style="margin:0;padding:0;position:fixed;overflow:none;" '+
    'marginheight="0"><img src="'+imgLink.href+'" border="0" '+
    ' alt="'+imgTitle+'" title="'+imgTitle+'" class="r" /></bo'+
    'dy></ht'+'ml>');
    close();
  }
  resId=setInterval('imgResize()',100);
  return false
}

function imgResize() {
  var w=imgWndw.document.images[0].width;

  if (w>screen.availWidth) w=screen.availWidth;

  var h=imgWndw.document.images[0].height;

  if (h>screen.availHeight) h=screen.availHeight;
  if (w>50 && h>50) {

    var ww=(imgWndw.innerWidth)?imgWndw.innerWidth:((document.body)?
      imgWndw.document.body.clientWidth:null);
    var wh=(imgWndw.innerHeight)?imgWndw.innerHeight:((document.body)?
      imgWndw.document.body.clientHeight:null);
    if (ww && wh) {
      imgWndw.resizeBy(w-ww,h-wh);
    }
    imgWndw.focus();
    clearInterval(resId)
  }
}

function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function na_preload_img()
{
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null)
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  }
}

function na_change_img_src(name, nsdoc, rpath, preload)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  }
}

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  }
}

function popup(link,width,height){
	var icq = window.open(link, "send message", "width="+ width + ",height="+height + ",scrollbars=1");
}


var http_request = false;
function makeRequest() {
	http_request = false;
	
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();

		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
		try {
			http_request = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch (e) {}
		}
	}

	if (!http_request) {
		alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}

}

function makeQuery(path) {
	var url = path;
	http_request.open('POST', url, true);
	http_request.send('5');
	http_request.onreadystatechange = alertContents;
}

function alertContents() {
	t = document.getElementById('captcha');

	if (http_request.readyState == 4) { // COMPLETED
		if (http_request.status == 200) { // HTTP STATUS
			t.innerHTML=http_request.responseText;
		} 
		else {
			alert('There was a problem with the request.');
		}
	}
}