/* $Id: popup.js,v 1.1.1.1 2004/04/02 01:58:49 dspaneve Exp $ */

function showPopup(name, URL, h, w, x, y, scrollbars){

  if (isEmpty(h)) h = 300;
  if (isEmpty(w)) w = 300;

  if (isEmpty(x)) x = 100;
  if (isEmpty(y)) y = 200;

  var defaultOptions = "location=no,menubar=no,resizable=yes,scrollbars=" + (scrollbars ? "yes" : "no") +
  	",status=no,titlebar=no,toolbar=no,directories=no";
 
  var dimensions = "height=" + h + ",width=" + w + ",top=" + x + ",left=" + y;

  if (window.win) win.close();
  win = window.open(URL, name, dimensions + "," + defaultOptions);
  win.focus();
}


function isEmpty(s) {
  if (typeof s == "undefined") return true;
  return ((s == null) || (s.length == 0))
}

function areYouSure() {
	var ARE_YOU_SURE = 
		"URGENT WARNING:  We believe there is a mistake!\n\n" +
		"You have not given us the information we need to mail you your potential commission check,\n" +
		"and information about your proven home business success system from QuickPros.\n" +
		"Click OK to continue.";
	var currentLocation = location.href;
	if (confirm(ARE_YOU_SURE)) {
		location.href = currentLocation;
		
	}
}

function find(email) {
	window.onunload = null;
	location.href = "http://www.quickpros.biz/find.htm?email=" + email;
}
function showFilter() {
	show("filter");
	hide("showFilter");
	show("hideFilter");
}
function hideFilter() {
	hide("filter");
	hide("hideFilter");
	show("showFilter");
}
function show(elemId) {
  var elem = getElement(elemId);
  if (elem == null) return;
  elem.style.display = "";
}
function hide(elemId) {
  var elem = getElement(elemId);
  if (elem == null) return;
  elem.style.display = "none";
}

function getElement(elemId) {
  if (isObject(elemId)) return elemId;
  if (document.getElementById) return document.getElementById(elemId);
  if (document.all != null) return document.all[elemId];
  return null;
}
function isObject(elem) {
  return (typeof elem == "object");
}
