function fade(el, from, to, interval, callBack) {
    if (el == new String(el)) el = document.getElementById(el);

    var dif = Math.abs(to - from);
    
    var pi = Math.PI;
    var i = 0;
    
    var opacs = [];
    
    for (var theta=0; theta < 90; theta+=8) { 
        	if (to > from) 
			var step = Math.sin((theta*pi)/180);
		else 
			var step = Math.cos((theta*pi)/180);
		
		opacs.push(dif*step);
    }
        
	var inter = setInterval(
		function() {
			if (++i < opacs.length) {
				el.style.opacity = Math.max(0.01, opacs[i]); 
			} else {
				el.style.opacity = to;

				clearInterval(inter);
				if (callBack != null) callBack();
			}
		}, interval); 
}

function transitionOIE() {
    fade('featuredApp', 1.0, 0, 5, null);
    setTimeout("fade('AppListingH', 1.0, 0, 5, null)", 150);
    setTimeout("fade('AppListing', 1.0, 0, 5, null)", 150);
    setTimeout("document.getElementById('featuredApp').style.display='none';", 600);
    setTimeout("window.location='oie.html';", 800);
}

function transitionOT() {
    fade('featuredApp', 1.0, 0, 5, null);
    setTimeout("fade('AppListingH', 1.0, 0, 5, null)", 150);
    setTimeout("fade('AppListing', 1.0, 0, 5, null)", 150);
    setTimeout("document.getElementById('featuredApp').style.display='none';", 600);
    setTimeout("window.location='ot.html';", 800);
}

function transitionMT() {
    fade('featuredApp', 1.0, 0, 5, null);
    setTimeout("fade('AppListingH', 1.0, 0, 5, null)", 150);
    setTimeout("fade('AppListing', 1.0, 0, 5, null)", 150);
    setTimeout("document.getElementById('featuredApp').style.display='none';", 600);
    setTimeout("window.location='http://menuetapp.com';", 800);
}

 function download() {
                document.getElementById('downloadArrow').style.display='block';
                setTimeout("fade('downloadArrow', .999999, 0, 5, null)", 150);
}