﻿var IE6 = navigator.userAgent.toLowerCase().indexOf('msie 6') != -1 && navigator.userAgent.toLowerCase().indexOf('msie 7') == -1;

function e(elem) {
	return document.getElementById(elem);
}
function changeValue(obj,val) {
	document.getElementById(obj).value = val;
}
function openDiv(elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "";
	}
}
function closeDiv(elName) {
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
		theElemenet.style.display = "none";
	}
}
function toggleDisplay(divName){
	var tempDiv = document.getElementById(divName);
	if (!tempDiv) {
		return;
	}  
	 if (tempDiv.style.display==""){
	 	tempDiv.style.display="none";
	 }
	 else {	
	 	if (tempDiv.style.display=="none"){
			tempDiv.style.display="";
		}
	 }
}
function setInnerHTML(elName, value)
{
	var theElemenet = document.getElementById(elName);
	if (theElemenet) {
	    theElemenet.innerHTML = value;
	}
}
function openPopup(url, name, height, width)
{
	newwindow=window.open(url, name,'height='+height+',width='+width);
	if (window.focus) {newwindow.focus()}
	return false;
}
function writeObject(objStr)
{
    document.write(objStr)
}

//------IM----------
function callAllUserStat()
{
    try
    {
        window.frames['IMheaderFrame'].checkUsers();
    } catch(ex)
    {
        setTimeout("callAllUserStat();",200);
    }
}

function getUserStat(userId)
{
    try
    {
        window.frames['IMheaderFrame'].isUserOnline(userId);
    } catch(ex)
    {
        setTimeout("getUserStat("+userId+");",200);
    }
}