/**********************************************                  TEXT TOGGLE***********************************************/function showText(evt) {    getText(evt);    //return false;}function getText(evt) {    var url = evt;        if (window.XMLHttpRequest) {        xhr = new XMLHttpRequest();    } else {        if (window.ActiveXObject) {            try {                xhr = new ActiveXObject("Microsoft.XMLHTTP");            } catch (e) { }        }    }        if (xhr) {        xhr.onreadystatechange = showContents;        xhr.open("GET",url,true);        xhr.send(null);    } else {        alert("Sorry, but we couldn't create an XMLHttpRequest");    }}function showContents() {    var txtObj = document.getElementById("featured_content");    if (xhr.readyState == 4) {        txtObj.innerHTML = (xhr.status == 200) ? xhr.responseText : "There was a problem with the request" + xhr.status;    }} 

	var story = new Array("/wp-content/themes/new/featured/story1.html", "/wp-content/themes/new/featured/story2.html", "/wp-content/themes/new/featured/story3.html");
	var storyLength = story.length;
	var currentStoryNum = 0;

setTimeout ( "doSomething()", 10000 );

function doSomething() {
  // (do something here)
  setTimeout ( "doSomething()", 10000 );

	function orderText() {
		currentStoryNum++;
		if (currentStoryNum == storyLength) { currentStoryNum = 0; }
		showText(story[currentStoryNum]);
	}
	shiftOpacity('featured_content', 1000)
	orderText();
}





function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function shiftOpacity(id, millisec) {
    //if an element is invisible, make it visible, else make it ivisible
        opacity(id, 0, 100, millisec);

}  