// JavaScript Document
function init(){
    // defaults
    var target = '92822';
    var EULA = '93481';
    var Privacy = '93483'; 

    if (Silverlight.ua.OS=='Windows')
    {
        target = '92799';
        EULA = '92803';
        Privacy = '92805'; 
    }
    else if (Silverlight.ua.OS=='MacIntel')
    {
        target = '92808';
        EULA = '92804';
        Privacy = '92806';
    }
    else if (Silverlight.ua.OS=='MacPPC')
    {
        target = '92807';
        EULA = '92815';
        Privacy = '92816';
    }
    document.getElementById("InstallSilverlightLink").href = Silverlight.fwlinkRoot + target;

    // send Atlas tracking for No Silverlight Installed
    slt101 = new Image();
    slt101.src = 'http://switch.atdmt.com/action/mrtyou_FY08HSWLP1Weighted_1';
    if (Silverlight.isInstalled("1.0"))
    {
      slt103 = new Image();
      slt103.src = 'http://switch.atdmt.com/action/mrtyou_FY08HSWLPWithSilverlightFinal_1';
    }
    else
    {
      slt102 = new Image();
      slt102.src = 'http://switch.atdmt.com/action/mrtyou_FY08HSWLPNOSilverlightWeighted_1';
    }

	if(document.getElementById){
		obj = document.getElementById("clipboard");
		obj.style.top = "450px";
		startTimer();
	}
}

function startTimer(){
	//set delay time in milliseconds (ex 1000 == 1 sec)
	var t=setTimeout("opacity('fadein', 0, 100, 1000)", 500);
	var t2=setTimeout("slideUp()", 1000);
}

function slideUp(){
	if(document.getElementById){
		if(parseInt(obj.style.top) > 25){
			obj.style.top = parseInt(obj.style.top) - 25 + "px";
			setTimeout("slideUp()", 0);obj.style.display = "block";
		}
		else if (parseInt(obj.style.top) > 10 ){
			obj.style.top = parseInt(obj.style.top) - 5 + "px";
			setTimeout("slideUp()", 0);
		}
		else if (parseInt(obj.style.top) <= 10 && parseInt(obj.style.top) > 0 ){
			obj.style.top = parseInt(obj.style.top) - 1 + "px";
			setTimeout("slideUp()", 0);
		}
	}
}


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.00); 
	object.MozOpacity = (opacity / 100); 
	object.KhtmlOpacity = (opacity / 100); 
	object.filter = "alpha(opacity=" + opacity + ")"; 
} 