
function instant_popup()
{if(readCookie('sessionhidepopup')==null)
{var varcontent=document.getElementById('CurPopupContainer');xmlHttpInsPop=GetXmlHttpObject();if(xmlHttpInsPop==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttpInsPop.onreadystatechange=function()
{if(xmlHttpInsPop.readyState==4||xmlHttpInsPop.readyState=="complete")
{var retText=xmlHttpInsPop.responseText;if(retText!='N'&&retText!='')
{if(varcontent)
{varcontent.innerHTML=retText;hideUserOriPopUp();hideUserPopUp();showUserPopUp();}}}}
xmlHttpInsPop.open("GET","/Network/get_instant_message.php?sid="+Math.random(),true);xmlHttpInsPop.send(null);}}
function hideUserPopUp()
{var curuserpopup=document.getElementById('curuserpopup');if(curuserpopup!=null)
{curuserpopup.style.display="none";}}
function hideUserOriPopUp()
{var userpopup=document.getElementById('userpopup');if(userpopup!=null)
{userpopup.style.display="none";}}
function showUserPopUp()
{var curuserpopup=document.getElementById('curuserpopup');if(curuserpopup!=null)
{curuserpopup.style.display="block";}}
function positionit(){var curpopobj=document.all?document.all.curuserpopup:document.getElementById('curuserpopup');var logpopobj=document.all?document.all.userpopup:document.getElementById('userpopup');var swidth=screen.width;var sheight=screen.height;var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var dsocleft=document.all?iebody.scrollLeft:pageXOffset;var dsoctop=document.all?iebody.scrollTop:pageYOffset;if(curpopobj)
{if(swidth==800)
{if(document.all||document.getElementById){curpopobj.style.left=parseInt(dsocleft)+200+"px";curpopobj.style.top=dsoctop+125+"px";}}else if(swidth==1280&&sheight==1024)
{if(document.all||document.getElementById){curpopobj.style.left=parseInt(dsocleft)+400+"px";curpopobj.style.top=dsoctop+300+"px";}}else
{if(document.all||document.getElementById){curpopobj.style.left=parseInt(dsocleft)+308+"px";curpopobj.style.top=dsoctop+215+"px";}}}
if(logpopobj)
{if(swidth==800)
{if(document.all||document.getElementById){logpopobj.style.left=parseInt(dsocleft)+200+"px";logpopobj.style.top=dsoctop+100+"px";}}else if(swidth==1280&&sheight==1024)
{if(document.all||document.getElementById){logpopobj.style.left=parseInt(dsocleft)+450+"px";logpopobj.style.top=dsoctop+225+"px";}}else
{if(document.all||document.getElementById){logpopobj.style.left=parseInt(dsocleft)+308+"px";logpopobj.style.top=dsoctop+150+"px";}}}}
function hideUserPopUpSession()
{var content=document.getElementById('CurPopupContainer');xmlHttpHups=GetXmlHttpObject();if(xmlHttpHups==null)
{alert("Browser does not support HTTP Request")
return}
xmlHttpHups.onreadystatechange=function()
{if(xmlHttpHups.readyState==4||xmlHttpHups.readyState=="complete")
{var retText=xmlHttpHups.responseText;if(retText=="Logout")
{alert('You have been logout from this session. Please login again.');eraseCookie('sessionhidepopup');hideUserOriPopUp();hideUserPopUp();window.location.reload();}else{hideUserOriPopUp();hideUserPopUp();createCookie('sessionhidepopup','Y','1');}}}
xmlHttpHups.open("GET","/Network/set_instant_message.php?sid="+Math.random(),true);xmlHttpHups.send(null);}
function createCookie(name,value,days)
{if(days)
{var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function eraseCookie(name){createCookie(name,"",-1);}
