<!--

var myHttpRequest = false;
var state = 'hidden';
var testObj;

function OpenPop(theURL,winName,w,h) {
		// window.close();
		var left = (screen.width/2)-(w/2);
		var top = (screen.height/2)-(h/2);
  		var newWin = window.open(theURL,winName,'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
  		newWin.focus();
		}

function initFade() 
{
	testObj = document.getElementById('popup');

	show('popup');

	for (var i=0;i<21;i++) {	
		setTimeout('setOpacity('+i+')',50*i);
		if ( i==1 ) { show('popup'); }
	}
	//return false;
}

function setOpacity(value)
{
	testObj.style.opacity = value/10;
	testObj.style.filter = 'alpha(opacity=' + value*5 + ')';
}

function show(layer_ref) {

	state = 'visible';

	if (document.all) { 
		eval( "document.all." + layer_ref + ".style.visibility = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = state;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
	hza.style.visibility = state;
}
}

function hide(layer_ref) {

	state = 'hidden';
		
	if (document.all) { //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.visibility = state");
	}
	if (document.layers) { //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = state;
	}
	if (document.getElementById &&!document.all) {
		hza = document.getElementById(layer_ref);
	hza.style.visibility = state;
}
}

if(window.XMLHttpRequest)
    myHttpRequest = new XMLHttpRequest();
else if(window.ActiveXObject)
    myHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");


function OpenWindow(theURL,winName,features) 
{ 		
  	window.open(theURL,winName,features);			
}

function PlaySound(soundobj) 
{
	var thissound=document.getElementById(soundobj);
	thissound.Play();
}

function printInitContent(source, content)
{
	if(myHttpRequest)
	{
		var data = document.getElementById(content);
		data.innerHTML = data.innerHTML + "<br />" + source;
		myHttpRequest.send(null);
	}
} 

function printTextContent(source, content)
{
	if(myHttpRequest)
	{
		var data = document.getElementById(content);
		data.innerHTML = (source);
		myHttpRequest.send(null);
	}
} 

function loadContent(source, content)
{
	var MyHttpLoading = 'LOADING...';
	var ErrorMSG = '<p><br>ERROR!</p>';
	var i = 0;

	myHttpRequest = GetHttpR()
	if(myHttpRequest)
  	{
		var data = document.getElementById(content);
		var robo = document.getElementById('hidden');
			// document.getElementById(content).innerHTML = MyHttpLoading; 
		myHttpRequest.open("GET",source, true);
		myHttpRequest.onreadystatechange = function()
		{
			if(myHttpRequest.readyState==4)
          	{
				robo.innerHTML = myHttpRequest.responseText;
				if (robo.innerHTML == data.innerHTML) 
				{ 
					robo.innerHTML = myHttpRequest.responseText;      					
				}
				else
				{ 
					data.innerHTML = myHttpRequest.responseText; 
          		}
			}
          	else		
          	{	
				// document.getElementById(content).innerHTML = MyHttpLoading; 
          	}	// still working
		}
		if (i < 2) 
		{ 
			myHttpRequest.send(null);	
			i++; 
		}		
	}
  	else 
  	{ 
  		document.getElementById(content).innerHTML = ErrorMSG + source; 
  	}

}

function loadImage(source, content)
{
     if(myHttpRequest)
     {
          var data = document.getElementById(content);

          myHttpRequest.open("GET",source);

          myHttpRequest.onreadystatechange = function()
          {
               if(myHttpRequest.readyState==4)
                   data.innerHTML = myHttpRequest.responseText;
          }

          myHttpRequest.send(null);
     }
} 

function GetHttpR()
{

    var GetHttpR_ret = false;
    try
    {
        // Firefox, Opera 8.0+, Safari
        GetHttpR_ret=new XMLHttpRequest();
    }
    catch (e)
    {
        // Internet Explorer
        try
        {
            GetHttpR_ret=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            try
            {
                GetHttpR_ret=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e)
            {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    return GetHttpR_ret;
}



//-->
