var i=0;

function doFadeIn() {	
	setblend('myblend', i);
	i=i+5;
	if (i<=100) {
		window.setTimeout('doFadeIn()', 50);
	} else {
		//window.setTimeout('doFadeOut()', 1000);
	}
 }

function doFadeOut() {	
	setblend('myblend', i);
	i=i-5;
	if (i>=0) {
		window.setTimeout('doFadeOut()', 50);
	} else {
		window.setTimeout('doFadeIn()', 1000);
	}
 }
 
function setblend(vID, vAlpha) {
	if (document.getElementById(vID)){
		var oe = document.getElementById(vID);
        oe.style.MozOpacity = i/100; //for FF
        oe.style.filter = "Alpha(Opacity=" + i + ")"; //for IE
	}
  }

function sleep(ms){ 
	var zeit=(new Date()).getTime(); 
	var stoppZeit=zeit+ms; 
	while((new Date()).getTime()<stoppZeit){}; 
} 

function getURL(uri) {
	uri.dir = location.href.substring(0, location.href.lastIndexOf('\/'));
	uri.dom = uri.dir; if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
	uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) {uri.path = uri.dom.substr(pos+1); uri.dom = uri.dom.substr(0,pos);}
	uri.page = location.href.substring(uri.dir.length+1, location.href.length+1);
	pos = uri.page.indexOf('?');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
	pos = uri.page.indexOf('#');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
	uri.ext = ''; pos = uri.page.indexOf('.');if (pos > -1) {uri.ext =uri.page.substring(pos+1); uri.page = uri.page.substr(0,pos);}
	uri.file = uri.page;
	if (uri.ext != '') uri.file += '.' + uri.ext;
	if (uri.file == '') uri.page = 'index';
	uri.args = location.search.substr(1).split("?");
	return uri;
}
               