function popUp (url, width, height) {			
	//center the pop-up	
	if (parseInt(navigator.appVersion) >= 4 ) {
		xposition = (screen.width - width) / 2;
		yposition = (screen.height - height) / 2;}

	args = "width=" + width + ","
	+ "height=" + height + ","
	+ "location=0," 
	+ "menubar=0,"
	+ "resizable=1,"
	+ "scrollbars=1,"
	+ "status=1," 
	+ "titlebar=1,"
	+ "toolbar=0,"
	+ "hotkeys=0,"
	+ "screenx=" + xposition + ","  //NN Only
	+ "screeny=" + yposition + ","  //NN Only
	+ "left=" + xposition + ","     //IE Only
	+ "top=" + yposition;           //IE Only
	
	window.open(url,'popup',args );
}

function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1) 
      return element;

    elements.push(element);
  }

  return elements;
}

function toggle(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = '';
	}
}

function searchCheck() {
	
	$('searchBox').style.color = "#FFFFFF";
	
	if ($('searchBox').value == "search") {
		$('searchBox').value = "";		
	}
}

function getWindowHeight() {
	
	var windowHeight=0;
	
	if (typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	}	else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
			} else {
				if (document.body && document.body.clientHeight) {
					windowHeight = document.body.clientHeight;
				}
			}
	}
	
	return windowHeight;
}


function setFooter() {
	
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
			
		if (windowHeight > 0) {
			
			var contentHeight = document.getElementById('container').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight = footerElement.offsetHeight;
		
			if (windowHeight-(contentHeight+footerHeight) >= 0) {
				
				if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0) {	
					footerHeight = footerHeight - 16;
				} else if (navigator.userAgent && navigator.userAgent.indexOf("Gecko") >= 0) {
					footerHeight = footerHeight + 20;
				}
								
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			} else {
				footerElement.style.position='static';
			}
		}
	}
}
