var xmlhttp=false;

/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') 
	 xmlhttp = new XMLHttpRequest();


function SelectItem(item)
{
 switch(item)
  {
	case 'about': OpenDiv(220); LoadUrl('about.asp'); break;
	case 'support': OpenDiv(150); LoadUrl('support.asp'); break;
	case 'services': OpenDiv(230);  LoadUrl('services.asp');break;
	case 'news': OpenDiv(125); LoadUrl('news.asp'); break;
	case 'clients': OpenDiv(400);  LoadUrl('clients.asp');break;
	default: OpenDiv(1); break;
  }
}

function LoadUrl(sURL)
{
 xmlhttp.open("GET", sURL,true);
 xmlhttp.onreadystatechange=function() { 
  if (xmlhttp.readyState==4) { 
   var disp = document.getElementById('content'); 
   	disp.innerHTML = xmlhttp.responseText;  
  }
 }
 xmlhttp.send();
}


var timerId = null;
var delay=1;
var cHeight=0;
var dHeight=0;

function OpenDiv(targetHeight)
{
	dHeight = targetHeight;
	Slide();
}

function Slide()
{
	if (cHeight == dHeight)
	{
		clearTimeout(timerId);
		return;
		}
		
	var scale=3;
	if (Math.abs(cHeight - dHeight) < 4)
		scale = 1;
		
	if (cHeight < dHeight)
		cHeight = cHeight + scale;
	else
		cHeight = cHeight -scale;
		
	div = document.getElementById("content");
	div.style.height=cHeight;
	timerId = setTimeout("Slide()",delay);

}