// JavaScript Document

function getFile(pURL,pFunc,nameX) {
    if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc 
        xmlhttp=new XMLHttpRequest();
        xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4) { 
				if (xmlhttp.status==200) { 
					document.getElementById(nameX).innerHTML=xmlhttp.responseText;
					}
			}
		}
        xmlhttp.open("GET", pURL, true); // leave true for Gecko
        xmlhttp.send(null);
    } else if (window.ActiveXObject) { //IE 
        xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); 
        if (xmlhttp) {
            xmlhttp.onreadystatechange=function(){
			if (xmlhttp.readyState==4) { 
				if (xmlhttp.status==200) { 
					document.getElementById(nameX).innerHTML=xmlhttp.responseText;
					}
			}
		}
            xmlhttp.open('GET', pURL, false);
            xmlhttp.send();
        }
    }

}



function clearX(selection,selectionName){
	var codes = '<td class=\"off\"id=\"'+selection+'\">';
	codes += '<a href=\"#\" onclick=\"getFile(\'pages/controls/'+selection+'.php\',\'raw\',\''+selection+'\');yourLocation(\''+selectionName+'\');\">';
	codes += '<img src=\"../../img/hp/leftMenu/m_'+selection+'.jpg\" alt=\"'+selectionName+'\" border=\"0\" /></a></td>';
	document.getElementById(selection).innerHTML = codes;
	}

function site(selection, name){
	var codes = '<tr>';
    codes += '<td class=\"off\" onmouseover=\"this.className=\'on\'" onmouseout="this.className=\'off\'" id=\"'+selection+'\"><a href=\"#\">';
	codes += '<img src=\"../../img/hp/leftMenu/m_'+selection+'.jpg\" alt=\"'+name+'\" border=\"0\" /></a></td>';
  	codes += '</tr><tr>';
	codes += '<td></td>';
  	codes += '</tr>';
	document.getElementById(selection).innerHTML = file;
	}
	
function clear(name){
	document.getElementById(name).innerHTML= "";
	}
	
	
function yourLocation(selectX, selectS){

	document.getElementById('yourLocation').innerHTML=selectX;
	document.getElementById('yourLocationSub').innerHTML="";
	}
	
function yourLocationSub(selectX, selectS){
	
	var value = " / ";
	document.getElementById('yourLocationSub').innerHTML=selectX+value+selectS;
	document.getElementById('yourLocation').innerHTML="";
	
	document.title = 'Majors Group - '+selectX+' - '+ selectS;
}

function selected(selectX){
	var newWord = "<b><i>"+selectX+"</i></b>";
	document.getElementById(selectX).innerHTML = newWord;
}

//Change title
function changeTitle(title) { document.title = title; }