function changestate(where)
{
	var state = (document.getElementById(where).style.display == 'block') ? 'none' : 'block';
	document.getElementById(where).style.display = state
}

function changesong(song) {
	window.location.href = song	
}

function splash() {
	setTimeout("document.getElementById('mia').style.opacity = '.05';", 150);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=5)';", 150);
	setTimeout("document.getElementById('mia').style.opacity = '.1';", 300);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=10)';", 300);
	setTimeout("document.getElementById('mia').style.opacity = '.15';", 450);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=15)';", 450);
	setTimeout("document.getElementById('mia').style.opacity = '.2';", 600);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=20)';", 600);
	setTimeout("document.getElementById('mia').style.opacity = '.25';", 750);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=25)';", 750);
	setTimeout("document.getElementById('mia').style.opacity = '.3';", 900);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=30)';", 900);
	setTimeout("document.getElementById('mia').style.opacity = '.35';", 1050);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=35)';", 1050);
	setTimeout("document.getElementById('mia').style.opacity = '.4';", 1200);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=40)';", 1200);
	setTimeout("document.getElementById('mia').style.opacity = '.45';", 1350);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=45)';", 1350);
	setTimeout("document.getElementById('mia').style.opacity = '.5';", 1500);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=50)';", 1500);
	setTimeout("document.getElementById('mia').style.opacity = '.55';", 1650);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=55)';", 1650);
	setTimeout("document.getElementById('mia').style.opacity = '.6';", 1800);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=60)';", 1800);
	setTimeout("document.getElementById('mia').style.opacity = '.65';", 1950);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=65)';", 1950);
	setTimeout("document.getElementById('mia').style.opacity = '.7';", 2100);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=70)';", 2100);
	setTimeout("document.getElementById('mia').style.opacity = '.75';", 2250);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=75)';", 2250);
	setTimeout("document.getElementById('mia').style.opacity = '.8';", 2400);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=80)';", 2400);
	setTimeout("document.getElementById('mia').style.opacity = '.85';", 2550);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=85)';", 2550);
	setTimeout("document.getElementById('mia').style.opacity = '.9';", 2700);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=90)';", 2700);
	setTimeout("document.getElementById('mia').style.opacity = '.95';", 2850);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=95)';", 2850);
	setTimeout("document.getElementById('mia').style.opacity = '1';", 3000);
	setTimeout("document.getElementById('mia').style.filter = 'alpha(opacity=100)';", 3000);
	
	
	setTimeout("document.getElementById('links').style.display = 'block'", 3000);
	
     
}

function openpage(language) {
	if (language == 'english')
	{
		page=window.open('english/news.html','page','height=526,width=800,toolbar=no,scrollbars=no')
	}
	else
	{
	page=window.open('chinese/index.html','page','height=526,width=800,toolbar=no,scrollbars=no')
	}
 }



function TextScroll(scrollname, divname, speed)
{
		var docdivname = document.getElementById(divname) //for ease of typing
		this.scrollCursor = 0;
		this.timeoutID = 0;
		
		document.getElementById(divname).style.overflow = 'hidden'; //set it to hidden now that we're sure they support javascript
		
	this.stopScroll = function() {
		clearTimeout(this.timeoutID);
	}
	
	this.scrollUp = function() {
		this.scrollCursor = (this.scrollCursor - speed) < 0 ? 0 : this.scrollCursor - speed;
		docdivname.scrollTop = this.scrollCursor;
		this.timeoutID = setTimeout(scrollname + ".scrollUp()", 60);
	}
	
	this.scrollDown = function() {
		this.scrollCursor += speed;
		docdivname.scrollTop = this.scrollCursor;
		this.timeoutID = setTimeout(scrollname + ".scrollDown()", 60);
	}
	
	this.top = function() {
			document.getElementById(divname).scrollTop = 0;
			this.scrollCursor = 0;
	}    
}

function bgchange() {
	//var firstimage = "url('bg2.jpg')"
	//firstimage.src = "bg2.jpg"
	//var secondimage = "url('bg.jpg')"
	//secondimage.src = "bg.jpg"
	//setTimeout("document.body.style.backgroundImage = 'url(bg2.jpg)'", 500);
	//setTimeout("document.body.style.backgroundImage = 'url(bg.jpg)'", 1000);
	
}

function changepic (image){
	document.getElementById('rightpic').style.display = 'block'
	document.getElementById('rightpic').src = "../pics/" + image + ".jpg"
}

function offpic (){
	document.getElementById('rightpic').style.display = 'none'
	document.getElementById('rightpic').src = ""
}

function displayon(where) {
	document.getElementById(where).style.display = 'block'
}

function offleveltwo() {
	document.getElementById('aboutlevel').style.display = 'none'
	document.getElementById('newslevel').style.display = 'none'
	document.getElementById('medialevel').style.display = 'none'
		
}


















