// JavaScript Document
/*window.onload = window.onresize = function totalHeight(){
	var contentHeight = document.getElementById('contentFrame').offsetHeight;
	if(!window.innerWidth){
		var windowHeight = document.documentElement.clientHeight;
	} else {
		var windowHeight = window.innerHeight;
		}
	var copyrightHeight = document.getElementById('copyright').offsetHeight;
	
	if(contentHeight + copyrightHeight< windowHeight){
		document.getElementById('mainContent').style.height = windowHeight + "px";
		document.getElementById('copyright').style.bottom = 0;
		document.getElementById('leftFrame').style.height = windowHeight + 'px';
		} else {
			document.getElementById('mainContent').style.height = contentHeight + copyrightHeight + 'px';
			document.getElementById('leftFrame').style.height = contentHeight + copyrightHeight + 'px';
			}
	}*/
	
var bShowMenu = false;
	
function fnChangeLang(i) {
	var sGoal = "/goal/switchlanguage/";
	if (i == 1031) {
		sGoal += "German"; }
	else if (i==1033) {
		sGoal += "English"; }
	else if (i==1034) {
		sGoal += "Spanish"; }
	else if (i==1036) {
		sGoal += "French"; }
	else if (i==1040) {
		sGoal += "Italian"; }
	else if (i==1041) {
		sGoal += "Japanese"; }
	else if (i==2052) {
		sGoal += "Chinese"; }
	else if (i==1042) {
		sGoal += "Korean"; }
	else {
		sGoal += i;
	}
	urchinTracker(sGoal);
	document.location = "/Default.aspx?langtype=" + i;
}

function fnChangeColor(sThis, bColor){
	if(bColor){
		sThis.style.color = "#4f91cd";
	}else{
		sThis.style.color = "#002d62";
	}
}
function fnShow(){
	if(!bShowMenu){
		document.getElementById("languagemenu").style.display = "block";
		bShowMenu = true;
	}
}
function fnHidden(){
	if(bShowMenu){
		document.getElementById("languagemenu").style.display = "none";
		bShowMenu = false;
	}
}
function fnShowMenu (){
	if(!bShowMenu){
		fnShow();
	}else{
		fnHidden();
	}
}

function fnchangesizeflash(nWidth, nHeight){
	var h = parseInt(nHeight)
	if (h > 33) { h += 100; }
	if (!document.getElementById("top")) {return;}
	document.getElementById("top").style.width	=	nWidth + "px";
	document.getElementById("top").style.height	=	h.toString() + "px";
	//document.getElementById("menuHeight").innerHTML = "Height: " + h.toString() ;
	//alert( nHeight);
	//document.getElementById("menu").style.width	=	nWidth + "px";
	//document.getElementById("menu").style.height	=	nHeight + "px";
} 

function downloadFile(s) {
	urchinTracker("/goal/download/" + s);
	var sUrl = "http://ftp.accuray.msinteractive.com/DownloadFile.aspx?file=" + escape(s);
	var o = window.open(sUrl,"Download","height=100,width=300,scrollbars=no,menubar=no");
}

function callAJAX(e){
	var callback = {
		success: function(o) {
			document.getElementById('accContent').innerHTML =  o.responseText;
				var version = 0;
				if (navigator.appVersion.indexOf("MSIE")!=-1){
					var temp = navigator.appVersion.split("MSIE");
					version = parseFloat(temp[1]);
				}
				if (version<7){
					//alert("This id IE6+ < 7")                                   
				} else {
					window.location.hash = e;
				}
			},
		failure: function(o) {
				alert("Content not loaded");
				}
				} 
	var transaction = YAHOO.util.Connect.asyncRequest('GET', e, callback, null);
} 
