function getDoca(url)
{
document.getElementById("content_center").innerHTML = url;
//  alert(url)
}


var xmlHttp
function getDoc(url_str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
 alert ("Browser does not support HTTP Request")
 return
}

var id = "content_center"

document.getElementById(id).innerHTML = 'loading content...';


var url=url_str // + '?' + params + '&t='+new Date().getTime()

xmlHttp.onreadystatechange= function() { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
            if (xmlHttp.status==200)
            {
                  document.getElementById(id).innerHTML = xmlHttp.responseText;
//                doFunc(xmlHttp, id);
            }
}

xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}


function doAfter(id)
{

axmlHttp=GetXmlHttpObject()
if (axmlHttp==null)
{
 alert ("Browser does not support HTTP Request")
 return
}
var url="content.php"
axmlHttp.onreadystatechange= function() { 
        if (axmlHttp.readyState==4 || axmlHttp.readyState=="complete")
            if (axmlHttp.status==200 && axmlHttp.responseText) 
                document.getElementById(id).innerHTML = axmlHttp.responseText;
}

axmlHttp.open("GET",url,true)
axmlHttp.send(null)

}


function ajaxAlert()
{ 
axmlHttp=GetXmlHttpObject()
if (axmlHttp==null)
{
 alert ("Browser does not support HTTP Request")
 return
}
var url="alerttext.php"
axmlHttp.onreadystatechange= function() { 
        if (axmlHttp.readyState==4 || axmlHttp.readyState=="complete")
            if (axmlHttp.status==200 && axmlHttp.responseText) 
		alert(axmlHttp.responseText);
}

axmlHttp.open("GET",url,true)
axmlHttp.send(null)
}



function getAjaxDoc(url_str, params, method, doFunc, id)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
 alert ("Browser does not support HTTP Request")
 return
}

var url=url_str
xmlHttp.onreadystatechange= function() { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
            if (xmlHttp.status==200){
                doFunc(xmlHttp, id);
		ajaxAlert();
	    }
}

if (method=="GET")
{
params = params + "&t=" +new Date().getTime()
xmlHttp.open("GET",url + "?" + params,true)
xmlHttp.send(null)
}
if (method=="POST")
{
xmlHttp.open("POST",url,true); 
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); 
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(params); 
}

}

var t, doxmlHttp;
function doIt()
{
doxmlHttp=GetXmlHttpObject()
if (doxmlHttp==null)
{
 alert ("Browser does not support HTTP Request")
 return
}

var Url ="portal_user.php";
doxmlHttp.open("GET", Url, true);
doxmlHttp.onreadystatechange = online_users_stateChanged;
doxmlHttp.send(null);

clearTimeout(t);
t = setTimeout("doIt();", 30000);

}


function online_users_stateChanged()
{

  if(doxmlHttp.readyState == "4")
     document.getElementById('online_users').innerHTML = doxmlHttp.responseText; 

}

function writeHTML(req, id) {
    document.getElementById(id).innerHTML = req.responseText;
}

function doNothing(req, id) {
}


function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
} 


function myalert(text)
{
   window.parent.scrollTo(0,0);
   window.alert(text);
}

function mywindow(link,win_height,win_width)
{
   popup_window=window.open(link,'URL','height='+win_height+',width='+win_width+',toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,location=no,margintop=0,marginleft=0,left=0,top=0');
   popup_window.focus();
}



function getFormValues(fobj){ 
var str = ""; 
for(var i = 0;i < fobj.elements.length;i++) { 
switch(fobj.elements[i].type){ 
case "button": 
case "text": 
case "textarea": 
case "password": 
if (!fobj.elements[i].disabled) str += fobj.elements[i].name + "=" + encodeURIComponent(fobj.elements[i].value) + "&"; 
break; 
case "hidden": 
//hidden cannot be disabled 
str += fobj.elements[i].name + "=" + encodeURIComponent(fobj.elements[i].value) + "&"; 
break; 
case "submit": 
str += fobj.elements[i].name + "=" + encodeURIComponent(fobj.elements[i].value) + "&"; 
break;
case "checkbox": 
case "radio": 
if(fobj.elements[i].checked && !fobj.elements[i].disabled) str += fobj.elements[i].name + "=" + encodeURIComponent(fobj.elements[i].value) + "&"; 
break; 
case "select-one": 
if (!fobj.elements[i].disabled) str += fobj.elements[i].name + "=" + encodeURIComponent(fobj.elements[i].options[fobj.elements[i].selectedIndex].value) + "&"; 
break; 
case "select-multiple": 
if (!fobj.elements[i].disabled){ 
for (var j = 0; j < fobj.elements[i].length; j++){ 
var optElem = fobj.elements[i].options[j]; 
if (optElem.selected == true){ 
str += fobj.elements[i].name + "[]" + "=" + encodeURIComponent(optElem.value) + "&"; 
} 
} 
} 
break; 
} 
} 

//Strip final &amp; 
str = str.substr(0,(str.length - 1)); 
return str; 
} 



function showDiv(id) {
    document.getElementById(id).style.visibility = "visible";
}


function unshowDiv(id) {
    document.getElementById(id).style.visibility = "hidden";
}



function show(id)
{
document.getElementById("hid1").style.display='block';
}
