showingSupportWindow = false;

function pageScrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}

function supportPopup() {
	var myPageHeight = (document.height !== undefined) ? document.height : document.body.offsetHeight;
	var myPageTop = (window.pageYOffset !== undefined) ? window.pageYOffset : document.documentElement.scrollTop;
	document.getElementById('supportTicket').style.height = myPageHeight + 'px';
	document.getElementById('supportTicket').style.visibility = 'visible';
	document.getElementById('supportContainer').style.top = myPageTop+200 + 'px';
	if (document.getElementById('supportIframe').title == '') {
		document.getElementById('supportIframe').src = 'http://www.gptstation.com/includes/hesk/index.php?a=add';
	} else {
		document.getElementById('supportIframe').src = 'http://www.gptstation.com/includes/hesk/index.php?a=add&su='+escape(document.getElementById('supportIframe').title);
	}
	showingSupportWindow = true;
}
function supportPopoff() {
	document.getElementById('supportTicket').style.visibility = 'hidden';
	showingSupportWindow = false;
}
function supportFadeTo() {
	var myPageTop = (window.pageYOffset !== undefined) ? window.pageYOffset : document.documentElement.scrollTop;
	currentTop = document.getElementById('supportContainer').style.top.substr(0, document.getElementById('supportContainer').style.top.indexOf('px'));
	if (currentTop != null && currentTop != "") {
		//currentTop = myPageTop + 200;
		
		if (Math.abs(currentTop - (myPageTop+200)) > 1) {
			document.getElementById('supportContainer').style.top = String(Math.round(Number(currentTop)*.7+(Number(myPageTop)+200)*.3)) + 'px';
			setTimeout("supportFadeTo();", 10);
		} else {
			document.getElementById('supportContainer').style.top = String(myPageTop+200) + 'px';
		}
	}
}
window.onscroll = function moveSupportTicket() { if (showingSupportWindow) { supportFadeTo(); } }
