var popup_chat=new Array();
var ajax_invitation_id=0;

function allStart(message,redirect)
{
  if (message) alert(message);
  if (redirect) window.location.href=redirect;
}

function addBookmark(title,url)
{
  var msg_netscape="NetScape message";
  var msg_opera="This function does not work with this version of Opera.  Please bookmark us manually.";
  var msg_other="Your browser does not support automatic bookmarks.  Please bookmark us manually.";
  var agt=navigator.userAgent.toLowerCase();
  if (agt.indexOf("opera")!=-1)
    {
      if (window.opera && window.print) return true;
      else alert(msg_other);
    }    
  else if (agt.indexOf("firefox")!=-1) window.sidebar.addPanel(title,url,"");
  else if (agt.indexOf("netscape")!=-1) window.sidebar.addPanel(title,url,"")
  else if (window.sidebar && window.sidebar.addPanel) window.sidebar.addPanel(title,url,"");
  else alert(msg_other);
}

var countAlertMessage=0;

function getXMLHttpRequest()
{
  var req=false;
  try { req=new XMLHttpRequest(); }
  catch (trymicrosoft)
    {
      try { req=new ActiveXObject("Msxml2.XMLHTTP"); } 
      catch (othermicrosoft) 
        {
          try { req=new ActiveXObject("Microsoft.XMLHTTP"); }
          catch (failed) { request=false; }
        }
    }
  return req;
}

function checkSignupFields()
{
	user = document.getElementById("miniSignupUser").value;
	email = document.getElementById("miniSignupEmail").value;
	password = document.getElementById("miniSignupPassword").value;
	country = document.getElementById("miniSignupCountry").options[document.getElementById("miniSignupCountry").selectedIndex].value;
	read = document.getElementById("miniSignupTC").checked;

	if (user.length == 0)
	{
		alert("You must enter a username.");
		return false;
	}
	else if (email.length == 0)
	{
		alert("You must enter an email address.");
		return false;
	}
	else if (password.length < 6)
	{
		alert("Password must be over 6 characters in length.");
		return false;
	}
	else if (country == 0)
	{
		alert("You must select a country.");
		return false;
	}
	else if (read == false)
	{
		alert("You must accept the Dream Marriage Terms/Conditions.");
		return false;
	}
	return true;
}
