
function close_box (){
		opacity('textDiv', 100, 0, 600);
		setTimeout("document.getElementById('textDiv').style.visibility = 'hidden'", 600);
		if (document.getElementById("reset"))
		{
		document.getElementById("reset").selected=true;
		}
		else
		{
		// do nothing	
		}
		}
	
function open_box (location){
			//closebox();
			document.getElementById('textDiv').style.visibility = 'visible';
			opacity('textDiv', 0, 95, 600);
			document.getElementById('textFrame').src = location;
			//document.getElementById('bioframe').style.width = "300";
			//document.getElementById('bioframe').style.height = "350";
		}
		
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));
            //setTimeout("changeRoll(" + i + ",'" + id + "')",(timer * speed));
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            //setTimeout("changeRoll(" + 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 changeRoll(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.height = opacity;
	//object.width = opacity +130;
} 

function go(id)
{
	box = document.getElementById(id);
	destination = box.options[box.selectedIndex].value;
	if (destination) open_box (destination);

}

// insert html from id into id2
function changeblock( id , id2 )
{
	document.getElementById(id2).innerHTML=document.getElementById(id).innerHTML;
}

// 
function popthebox( id )
{
	box = document.getElementById(id);
	idvalue = box.options[box.selectedIndex].value;
	
	switch (idvalue)
	{
			case "txtonload": 
			changeblock('txtonload','aboutusbodyright');
			break;
			case "seminar1": 
			changeblock('seminar1','aboutusbodyright');
			break;
			case "advanceteach":
			changeblock('advanceteach','aboutusbodyright');
			break;
			case "sermons":
			changeblock('sermons','aboutusbodyright');
			break;
			case "futureseminars":
			changeblock('futureseminars','aboutusbodyright');
			break;
			default:
			
	}

	
	
}
