 var showedmenu='';
 var imr=true;
 function showMenu(that){
 hideall();
  document.getElementById(that).style.display="block";
  showedmenu=that;
 }
 function hideMenu(that){
  showedmenu='';
  setTimeout("hideit('"+that+"')",100);
 }
  function hideit(that){
  if(!showedmenu)document.getElementById(that).style.display="none";
 }
 function hideall(){
 for(i=2;i<7;i++)  if(i!=4) document.getElementById("submenu"+i).style.display="none"; 
 document.getElementById("subsearch").style.display="none";
 }
 
 function ask(url,question){
 var q=question;
 if(q=='') q="Are you sure?";
 if(confirm(q)) window.location=url;
 }
 
 function showPic(path,img,w,h){
	var winO=window.open('displaypic.php?img='+img+'&path='+path, "imgwin", "width="+w+",height="+h+",menubar=no,toolbar=no,statusbar=no,addressbar=no,scrollbar=no");
 }
 
 function newWin(url,w,h){
 var winO=window.open(url, "newWin", "width="+w+",height="+h+",menubar=no,toolbar=no,statusbar=no,addressbar=no,scrollbars=1");
 }
 
 function runIM(){
	//chatMainWin=window.open("im.php", "imMainWin", "width=350,height=580,menubar=no,toolbar=no,statusbar=no,addressbar=no,scrollbar=no");
	//imr=false;
	//up_launchUL();
 }
 
 function IMto(tid){
  if(currUSr) {
  
  $.ajax({
  url: '/system_general_ajax.php?isblocked='+tid,

  success: function( data ) {
    if (data=='false') jqac.arrowchat.chatWith(tid);
	if (data=='true')  alert('You cannot IM this person. Their settings disallow it.');
  }
});

	
  
  
  }
//  up_launchWM(currUSr , tid );
  else alert("You MUST login before using the IM!");
	//runIM();
	//chatWin=window.open("im_chat.php?invite=1&id="+tid, "chatWin"+tid, "width=350,height=340,menubar=no,toolbar=no,statusbar=no,addressbar=no,scrollbar=no");
 }
 
 function hotlist(tid){
	newWin("hotlist_add.php?id="+tid,300,150)
 }
 function runChatRooms(){
	//ChatRooms=window.open("http://transgenderdate.com/wc2.php","chatrooms", "width=800,height=600,menubar=no,toolbar=no,statusbar=no,addressbar=no,scrollbar=no");
}


function getXmlHttpRequestObject() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else if(window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		alert("Cannot start the Instant Messenger in this browser!");
		window.close();
	}
}
//var receiveReq = getXmlHttpRequestObject();
var mTimer;

/*
function getText() {
	//if(currUSr == 0) return;
	if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
	try{
		receiveReq.open("GET", 'im_core.php?action=getIMCALLlist', true);
		receiveReq.onreadystatechange = handleReceiveChat; 
		receiveReq.send(null);
		}catch(e) { location.reload(); }
	}			
}

function handleReceiveChat() {
	if (receiveReq.readyState == 4) {
	

		var xmldoc = receiveReq.responseXML;


		var message_nodes = xmldoc.getElementsByTagName("call"); 
		var n_messages = message_nodes.length
		var datastore='';
		
//	alert(message_nodes.length);
		for (i = 0; i < n_messages; i++) {
			var username = message_nodes[i].getElementsByTagName("username");
//			username[0].firstChild.nodeValue
			if(username[0].firstChild.nodeValue != 0) up_launchWM( currUSr, username[0].firstChild.nodeValue);
		

		}

		mTimer=setTimeout("getText();",20000);
		
	
	}
}*/
/*
function runIMWin(tid){
	up_launchWM( currUSr, tid);
}*/
/*window.onload=getText;*/
