var isNN, isIE, exits, delay, skip, mywins, mytime;


if (parseInt(navigator.appVersion) >= 4) {
    if (navigator.appName == "Netscape") {
	isNN = true;
    } else {
	isIE = true;
    }
}

function errorIgnore(e) { return true; }





if ( document.cookie.indexOf( 'gregsbLoadXchange=' )==-1)
{

window.onerror = errorIgnore;


if (isNN) {
    document.captureEvents(Event.UNLOAD | Event.LOAD | Event.ERROR | Event.CLICK);
}


var t=1;
if (window.top.frames!=null)
{
   if (window.top.frames[1]!=null)
   {
       if (window.top.frames[1].name=="myFairyWindow") {t=0;}
   }
}


if ((window.name == "myFairyWindow" )||(t==0)) { 
    window.open = null;
}
else {   
  //  window.onunload=openExitWin;
} 
  document.cookie='gregsbLoadXchange=HeyGuys!;path=/';
}

function uniqueval()
{ var date = new Date() ; return date.getTime(); }

var im_refresh = 5000; 
var session_timeout = 0;
var im_start_time = uniqueval();
var time_elapsed;
var wincount = 1;
var newimwin = new Array();

var newim = 0;
var im_id = 0;
var imcheckimg = new Image;
var unique = uniqueval();
function new_message()
{
   im_id = imcheckimg.width;
   var unique = uniqueval();
   document.NewImSound.play(); 
   newimwin[wincount] = window.open("im.php?id="+im_id, unique, 'scrollbars=no,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width=450,height=350');
   newimwin[wincount].focus();
   wincount++;
}
function newimcheck()
{
   newim = imcheckimg.height;
   if(newim == 2)
      new_message();
}
function imcheck()
{
   var unique = uniqueval();
   time_elapsed = unique - im_start_time;
   if(time_elapsed > 7200000)
      session_timeout = 1;

   imcheckimg = new Image ;
   imcheckimg.src = "imcheck.php?user=&uniqueval="+unique;
   imcheckimg.onload = newimcheck;
   if(session_timeout == 0)
      setTimeout("imcheck()",im_refresh);
}
function write_message(username)
{
   var unique = uniqueval();
   newimwin[wincount] = window.open("im.php?action=writenew&user="+username, unique, 'scrollbars=no,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width=450,height=350');
   newimwin[wincount].focus();
   wincount++;
}



function changestat(mess)
{
  window.status="";
  window.status=mess;
}

function changeback()
{
  window.status="";
}

function addfriend(username)
{
   var unique = uniqueval();
   newfwin = window.open("addfriend.php?friend="+username, unique, 'scrollbars=no,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width=200,height=200');
   newfwin.focus();
}

function addhot(username)
{
   var unique = uniqueval();
   newfwin = window.open("addhotlist.php?hotuser="+username, unique, 'scrollbars=no,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width=200,height=200');
   newfwin.focus();
}

function lostpass() {
lostpasswin = window.open('lostpassword.php', 'lostpass', 'scrollbars=no,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width=200,height=200');
lostpasswin.focus();
}


// variables to keep track of the previous state to change its color
			var strPrevColor = null;
			var intPrevIndex = -1;
// here we set up an array to house the associated pages and
			var NavArray = new Array(8);
			// insert your associated pages here in place of the #s
			NavArray[0]="./find_your_match.php?page=joining_people";
			NavArray[1]="./find_your_match.php";
			NavArray[2]="./find_your_match.php";
			NavArray[3]="./find_your_match.php";
			NavArray[4]="./find_your_match.php";
			NavArray[5]="./find_your_match.php?page=faq_dating";
			NavArray[6]="./find_your_match.php?page=faq_dating";
			NavArray[7]="./find_your_match.php?page=faq_dating";

			
			function MouseOverChangeClass(elem,strColor) {
				// don't bother to show the  rollover state if button is already clicked
				if (elem.className != strColor + "_click") {
					elem.className = strColor + "_over";
				}

			}
			
			function MouseOutChangeClass(elem, strColor) {
			// if button has been clicked, don't do anything, otherwise turn us off
				if (elem.className != strColor + "_click") {
					elem.className = strColor + "_off";
				}
			}
			
			function MouseClickChangeClassLaunch(elem, strColor) {
				// button has just been clicked, it needs to be set to the right state and
				//  previous clicked button turned off
				if (elem.id != intPrevIndex) {
					var i = elem.id;
					window.location = NavArray[i];
					elem.className = strColor + "_click";
					var strElemPrevId = intPrevIndex;
					if (intPrevIndex != -1) {
						var ElemPrev = document.getElementById(strElemPrevId);
						ElemPrev.className = strPrevColor + "_off";
					}
					intPrevIndex = i;
					strPrevColor = strColor;
				}
			}
			

		
