function changeBG(position, what) {
    inputs = document.getElementById(position).getElementsByTagName("a");
	for (i=0; i<inputs.length; i++) {
		inputs[i].style.color="";
	}
	document.getElementById("menu_1").style.color="#666666"; 
	document.getElementById(what).style.color="#ffd700"; 
}

function changeBG2(position, what) {
	
	inputs = document.getElementById(position).getElementsByTagName("a");
	for (i=0; i<inputs.length; i++) {
		inputs[i].style.color="";
	}
	document.getElementById("menu_7").style.color="#666666"; 
	document.getElementById(what).style.color="#ffd700"; 
}

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function test_DoFSCommand(command, args) {
	var testObj = isInternetExplorer ? document.all.test : document.test;
	//
	if (command=="ajaxTEST") {
		var target="contentwrapper";
		getAXAH(args,target);
	}
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub test_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call test_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
function getNewHttpObject() {
    var objType = false;
    try {
        objType = new ActiveXObject('Msxml2.XMLHTTP');
    } catch(e) {
        try {
            objType = new ActiveXObject('Microsoft.XMLHTTP');
        } catch(e) {
            objType = new XMLHttpRequest();
        }
    }
    return objType;
}

function getAXAH(url,elementContainer){
//    document.getElementById(elementContainer).innerHTML = '<div id="loader">&nbsp;<img src="/images/loading.gif" alt="Loading..." /></div>';
    var theHttpRequest = getNewHttpObject();
    theHttpRequest.onreadystatechange = function() {processAXAH(elementContainer);};
    theHttpRequest.open("GET", url);
    theHttpRequest.send(false);

        function processAXAH(elementContainer){
           if (theHttpRequest.readyState == 4) {
               if (theHttpRequest.status == 200) {
                   document.getElementById(elementContainer).innerHTML = theHttpRequest.responseText;
               } else {
                   document.getElementById(elementContainer).innerHTML="<h1>Error!<br>HTTP request return the following status message:</h1><br><p>" + theHttpRequest.statusText +":<br>"+url+"</p>";
               }
           }
        }
}

function getIMAGE(url,elementContainer){
//    document.getElementById(elementContainer).innerHTML = '<div id="loader">&nbsp;<img src="/images/loading.gif" alt="Loading..." /></div>';
    var theHttpRequest = getNewHttpObject();
    theHttpRequest.onreadystatechange = function() {processAXAH(elementContainer);};
    theHttpRequest.open("GET", url);
    theHttpRequest.send(false);

        function processAXAH(elementContainer){
           if (theHttpRequest.readyState == 4) {
               if (theHttpRequest.status == 200) {
                 document.getElementById(elementContainer).innerHTML = '<img src="'+url+'" />';
//                   document.getElementById(elementContainer).style.backgroundImage = "url(\"" +url+ "\")";
			   } else {
                   document.getElementById(elementContainer).innerHTML="<p><span class='redtxt'>Error!<\/span> HTTP request return the following status message: " + theHttpRequest.statusText +"<\/p>";
               }
           }
        }
}
