function openUrl(url)
{
	window.location = url;
}

/**
 * Finds the position of any object on a page
 * got this code from http://www.quirksmode.org/js/findpos.html
 */
function findPos(obj) {
	var curleft = 0;
	var curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

/**
 * This returns the version of the browser. However, it is not particularly helpful, because for any 
 * modern browser it will always return "4" no matter if we're in IE 6, 7 or Firefox
 */
function getBrowserVersion() {
	return parseInt(navigator.appVersion);
}

/**
 * Returns true if we are running in IE, false otherwise
 */
function isIE() {
	browser_type = navigator.appName;
	
	if (browser_type == "Microsoft Internet Explorer") {
		return true;
	}
	else {
		return false;
	}
}

/**
 * Returns true if we are running IE 6 or earlier
 */
function isIE6 () {
	if (isIE) {
		if (typeof document.body.style.maxHeight != "undefined") {
			// IE 7
			return false;					
		} 
		else {
			 // IE6, older browsers
			return true;
		}
	}
	else {
		return false;
	}
}

/** 
 * gets the value of a URL query param
 * from http://www.netlobo.com/url_query_string_javascript.html
 * @param name the name of the query param whose value you wish to return
 */
function getQueryParam(name)
{
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	var results = regex.exec( window.location.href );
	if( results == null )
	  return "";
	else
	  return results[1];
}
