// Load PM Window
function loadPMWindow(){
var pmWindow = window.open("/messenger.php","pmWindow","status=0,toolbar=0,menubar=0,directories=0,resizable=0,scrollbars=1,width=225,height=420");
pmWindow.focus();
}

// Ping Activity
function pingActivity(user_id,hash_id){
    
var randnum1 = Math.floor(Math.random()*1000000);

pingback.open("GET", "/ajax_activity.php?r="+randnum1+"&u="+user_id+"&p="+hash_id,true);
pingback.onreadystatechange=function() {
if (pingback.readyState==4) {
  if(pingback.responseText != "OK"){
  //document.write(pingback.responseText);
  }
}
}
pingback.send(null);

}

// PM List
var stopCounter;

function loadPMList(user_id,hash_id,hideclose){
    var append = "";
    if(hideclose == "yes"){
        append = "&hideclose=yes";
    }
ajaxpage("/ajax_pm_list.php?u="+user_id+"&p="+hash_id+append, "pm_list_expand");
}

function showPMList(){
var pm_list_expand_outer = document.getElementById('pm_list_expand_outer');
pm_list_expand_outer.className = 'pml_show';
clearTimeout(stopCounter);
}

function timeoutPMList(){
stopCounter = setTimeout("hidePMList()", 1000);
}

function hidePMList(){
var pm_list_expand_outer = document.getElementById('pm_list_expand_outer');
pm_list_expand_outer.className = 'pml_hide';
}

function loadIM(username){
var im = window.open("/im.php?u="+username,"im_"+username,"status=0,toolbar=0,menubar=0,directories=0,resizable=0,scrollbars=0,width=600,height=420");
im.focus();
}

// New IM Check
function imPing(user_id,hash_id){
ajaxpage("/ajax_imnotify.php?u="+user_id+"&p="+hash_id, "imnotify");
}

// Friends List
var stopCounterFL;

function loadFriendsList(user_id,hash_id,hideclose){
    var append = "";
    if(hideclose == "yes"){
        append = "&hideclose=yes";
    }
ajaxpage("/ajax_friends_list.php?u="+user_id+"&p="+hash_id+append, "friends_list_expand");
}

function showFriendsList(){
var friends_list_expand_outer = document.getElementById('friends_list_expand_outer');
friends_list_expand_outer.className = 'fl_show';
clearTimeout(stopCounterFL);
}

function timeoutFriendsList(){
stopCounterFL = setTimeout("hideFriendsList()", 1000);
}

function hideFriendsList(){
var friends_list_expand_outer = document.getElementById('friends_list_expand_outer');
friends_list_expand_outer.className = 'fl_hide';
}

// Logout Confirmation
function confLogOut(){
    if(confirm("Are you sure you wish to log out?")){
        return true;
    }
    else{
        return false;
    }
}


// Ajax functions
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}


var commentxmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  commentxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   commentxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   commentxmlhttp = false;
  }
 }
@end @*/
if (!commentxmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		commentxmlhttp = new XMLHttpRequest();
	} catch (e) {
		commentxmlhttp=false;
	}
}
if (!commentxmlhttp && window.createRequest) {
	try {
		commentxmlhttp = window.createRequest();
	} catch (e) {
		commentxmlhttp=false;
	}
}


var pingback=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  pingback = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   pingback = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   pingback = false;
  }
 }
@end @*/
if (!pingback && typeof XMLHttpRequest!='undefined') {
	try {
		pingback = new XMLHttpRequest();
	} catch (e) {
		pingback=false;
	}
}
if (!pingback && window.createRequest) {
	try {
		pingback = window.createRequest();
	} catch (e) {
		pingback=false;
	}
}


var xmlrequest=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlrequest = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlrequest = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlrequest = false;
  }
 }
@end @*/
if (!xmlrequest && typeof XMLHttpRequest!='undefined') {
	try {
		xmlrequest = new XMLHttpRequest();
	} catch (e) {
		xmlrequest=false;
	}
}
if (!xmlrequest && window.createRequest) {
	try {
		xmlrequest = window.createRequest();
	} catch (e) {
		xmlrequest=false;
	}
}


var chatrequest=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  chatrequest = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   chatrequest = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   chatrequest = false;
  }
 }
@end @*/
if (!chatrequest && typeof XMLHttpRequest!='undefined') {
	try {
		chatrequest = new XMLHttpRequest();
	} catch (e) {
		chatrequest=false;
	}
}
if (!chatrequest && window.createRequest) {
	try {
		chatrequest = window.createRequest();
	} catch (e) {
		chatrequest=false;
	}
}