
// File: Main.js
// Project: Service Audio

function openServicePopup(ident)
{
	offset = new Offset();
	offset.x = parseInt((screen.width / 2)) - 230;
	offset.y = parseInt(screen.height) / 4;

	window.open("/" + getURLPrefix() + "Main.py/serviceAudioPopup?ident=" 
		+ ident, "ServiceAudio", "width = 461, height = 300, " + 
		"scrollbars = 0, resizable = 0, top = " + 
		offset.y + ", left = " + offset.x); 
}

function Offset()
{
	this.x = 100;
	this.y = 100;
}


// Miscellaneous Functions
// --------------------------

function userAgentSupportsSearchField()
{
	userAgent = navigator.userAgent;
	if (userAgent.indexOf("AppleWebKit/") + 1) {
		version = userAgent.substring(
			userAgent.indexOf("AppleWebKit/") + 12);
		version = version.substring(0, version.indexOf(" "))
		version = parseFloat(version);
		return version >= 312;
	} else
		return false;
}

function userAgentIsNotIE()
{
	userAgent = navigator.userAgent;
	return !(userAgent.indexOf("Microsoft") + 1);
}

function getComputedHeight(element)
{
	style = document.defaultView.getComputedStyle(element, "");
	if (!style)	return alert("Error: Couldn't Compute Style!");
	return parseFloat(style.getPropertyValue("height"));
}

function setElementOpacity(element, opacity)
{
	element.style.filter = 
		"alpha(opacity=" + opacity * 100.0 + ")";
	if (opacity >= 1.0)
		opacity = 0.999;
	element.style.opacity = opacity;
}

function String_strip()
{
	return this.replace(/^\s*|\s*$/g, "");
}

function getURLPrefix()
{
	return "";
}


