// JavaScript Include for Floating Feedback Button
// Adapted for ECS by CELT
var Type = 'Z';
function StartFloat() {
if(document.all) {
	document.all.FeedbackFloater.style.pixelLeft = 800; //document.body.clientWidth - document.all.FeedbackFloater.offsetWidth;
	document.all.FeedbackFloater.style.visibility = 'visible';
	Type = 'A';
	}
else if(document.layers) {
	document.FeedbackFloater.left = 800; //window.innerWidth - document.FeedbackFloater.clip.width - 16;
	document.FeedbackFloater.visibility = 'show';
	Type = 'B';
	}
else if(document.getElementById) {
	document.getElementById('FeedbackFloater').style.left = 800; //(window.innerWidth - 35) + 'px';
	document.getElementById('FeedbackFloater').style.visibility = 'visible';
	Type = 'C';
	}


	// Horizontal
	if (Type == 'A') { 
		
		if (document.body.clientWidth > 872) {
			document.all.FeedbackFloater.style.pixelLeft = 800; 
		} else {
			document.all.FeedbackFloater.style.pixelLeft = document.body.clientWidth - 72;
		}
	} else if (Type == 'B') { 
		if (window.innerWidth > 872) {
			document.FeedbackFloater.left = 800; 
		} else {
			document.FeedbackFloater.left = window.innerWidth - 72; 
		}
	} else if (Type == 'C') { 
		if ((window.innerWidth - 35) > 872) {
			document.getElementById('FeedbackFloater').style.left = 800 + 'px'; 
		} else {
			document.getElementById('FeedbackFloater').style.left = (window.innerWidth - 35 - 72) + 'px'; 
		}
	}
	

if (document.all) { window.onscroll = Float; }
else { setInterval('Float()', 100); }

if (document.all) { window.onresize = FloatHorizontal; }
else { setInterval('FloatHorizontal()', 100); }

}

function Float() {
//Vertical
	//window.status = document.body.scrollTop;
	if (Type == 'A') { document.all.FeedbackFloater.style.pixelTop = document.body.scrollTop; }
	else if (Type == 'B') { document.FeedbackFloater.top = window.pageYOffset; }
	else if (Type == 'C') { document.getElementById('FeedbackFloater').style.top = window.pageYOffset + 'px'; }
	
}

function FloatHorizontal() {
	// Horizontal
	if (Type == 'A') { 
		
		if (document.body.clientWidth > 872) {
			document.all.FeedbackFloater.style.pixelLeft = 800; 
		} else {
			document.all.FeedbackFloater.style.pixelLeft = document.body.clientWidth - 72;
		}
	} else if (Type == 'B') { 
		if (window.innerWidth > 872) {
			document.FeedbackFloater.left = 800; 
		} else {
			document.FeedbackFloater.left = window.innerWidth - 72; 
		}
	} else if (Type == 'C') { 
		if ((window.innerWidth - 35) > 872) {
			document.getElementById('FeedbackFloater').style.left = 800 + 'px'; 
		} else {
			document.getElementById('FeedbackFloater').style.left = (window.innerWidth -17 - 72) + 'px'; 
		}
	}
}
	

function CELT_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}