function InitAjax()
{
	var ajax = false;
	try
	{
		ajax = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			ajax = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(E)
		{
			ajax = false;
		}
	}
	if(!ajax && typeof XMLHttpRequest!='undefined')
	{
		ajax = new XMLHttpRequest(); 
	}
	return ajax;
}
function getinfo(id,url)
{
	var show = document.getElementById(id);
	var ajax = InitAjax();
	
	ajax.open('get',url,true);
	ajax.onreadystatechange = function()
	{
		if(ajax.readyState == 4 && ajax.status == 200)
			show.innerHTML = ajax.responseText;
	}
	ajax.setRequestHeader("If-Modified-Since","0");
	ajax.send(null);
}
function postinfo(id,url,str)
{
	var show = document.getElementById(id);
	var ajax = InitAjax();
	
	ajax.open('post',url,true);
	ajax.setRequestHeader("content-type","application/x-www-form-urlencoded");
	ajax.onreadystatechange = function()
	{
		if(ajax.readyState == 4 && ajax.status == 200)
			show.innerHTML = ajax.responseText;
	}
	ajax.send(str);
}

function $$() 
{
  var elements = new Array();   
  for (var i = 0; i < arguments.length; i++) 
  { 
    var element = arguments[i]; 
    if (typeof element == 'string') 
      element = document.getElementById(element); 
    if (arguments.length == 1) 
      return element;       
    elements.push(element); 
  }   
  return elements; 
}
function DrawImage(ImgD,iwidth,iheight)
{
	var flag=false;
	var image=new Image();
	if(!iwidth)
		iwidth = 100;
	if(!iheight)
		iheight = 80;
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
	flag=true;
	if(image.width/image.height>= iwidth/iheight){
	if(image.width>iwidth){ 
	ImgD.width=iwidth;
	ImgD.height=(image.height*iwidth)/image.width;
	}else{
	ImgD.width=image.width; 
	ImgD.height=image.height;
	}

	}
	else{
	if(image.height>iheight){ 
	ImgD.height=iheight;
	ImgD.width=(image.width*iheight)/image.height; 
	}else{
	ImgD.width=image.width; 
	ImgD.height=image.height;
	}
	}
	}
}