var http = createRequestObject();

function bordercolor(c) {
document.getElementById("main-text").style.border = '2px solid '+c;
}

function loadtext(t) {

document.getElementById("main-frame").innerHTML = '<IFRAME SRC=http://www.angus.mu/content.inc.php?f= WIDTH=99% HEIGHT=93% SCROLLING=yes FRAMEBORDER=0 marginwidth=0 marginheight=0 style="overflow: hidden: border: none;" ALLOWTRANSPARENCY id=content></Iframe>';

if (t != 'multimedia') {
document.getElementById("content").src = "http://www.angus.mu/content.inc.php?f="+t;
} else {
document.getElementById("main-frame").innerHTML = '';
http.open('get', 'includes/'+t+'.inc.php');
http.onreadystatechange = subreturn
http.send(null);
}


}


function subreturn() {

if(http.readyState == 4){
document.getElementById("main-frame").innerHTML = http.responseText;
}

}


function bordercolorsub(c) {
document.getElementById("sub-text").style.border = '2px solid '+c;
}

function loadtextsub(t) {
document.getElementById("content-sub").src = "http://www.angus.mu/content.inc.php?f="+t;
}



function changeimg() {
var nr=Math.floor(Math.random()*6)
var nr1=Math.floor(Math.random()*6)


var i = 0;
while (6>i) {
var img = document.getElementById("img_"+i).src;
img1 = img.split("_");
document.getElementById("img_"+i).src = img1[0]+"_off.png";
i++;
}

var img = document.getElementById("img_"+nr).src;
img1 = img.split("_");
document.getElementById("img_"+nr).src = img1[0]+"_on.png";


var img = document.getElementById("img_"+nr1).src;
img1 = img.split("_");
document.getElementById("img_"+nr1).src = img1[0]+"_on.png";
 

}

//window.setTimeout("changeimg();",6000);


function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{       
        ro = new XMLHttpRequest();
    }             
    return ro;
}
