﻿var xmlHttp1

function GetXmlHttpObject() {
    var xmlHttp1 = null;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp1 = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp1 = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp1;

}

/////////////////////////////////////////////////////////////////////////////////
function getSMS(type)
{ 
xmlHttp1=GetXmlHttpObject();


if (xmlHttp1==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }  

if(type!='love') {
document.getElementById('love').style.background= "#e9e9e9";
document.getElementById('love').style.borderBottomStyle= "solid"; }
if(type!='sardar') {
document.getElementById('sardar').style.background= "#e9e9e9";
document.getElementById('sardar').style.borderBottomStyle= "solid"; }
if(type!='funny') {
document.getElementById('funny').style.background= "#e9e9e9";
document.getElementById('funny').style.borderBottomStyle= "solid"; }
if(type!='quotes') {
document.getElementById('quotes').style.background= "#e9e9e9";
document.getElementById('quotes').style.borderBottomStyle= "solid"; }

document.getElementById(type).style.background= "#ffffff";
document.getElementById(type).style.borderBottomStyle= "none"; 

var url="/js/getsms.aspx";
url=url+"?t="+type;

xmlHttp1.onreadystatechange=stateChanged1;

xmlHttp1.open("GET",url,true);
xmlHttp1.send(null);

}
function stateChanged1() {
    if (xmlHttp1.readyState == 4) {
        document.getElementById('dv_sms').innerHTML = xmlHttp1.responseText;
    }
    else {
        document.getElementById('dv_sms').innerHTML = "<b>Loading...</b>";
    }
}

///////////////////////////////////////////////////////////////////////////////////////

function newuser() {
    xmlHttp1 = GetXmlHttpObject();
    if (xmlHttp1 == null) { alert("Your browser does not support AJAX!"); return; }
    var url = "/js/newuser.aspx";
    xmlHttp1.onreadystatechange = stateChangeNewUser;
    xmlHttp1.open("GET", url, true);
    xmlHttp1.send(null);
}

function stateChangeNewUser() {
    document.getElementById('nu').style.visibility = "visible";
    if (xmlHttp1.readyState == 4) {
        document.getElementById('nu').innerHTML = xmlHttp1.responseText;
    }
    else {
        document.getElementById('nu').innerHTML = "<b>Loading...</b>";
    }
}

//////////////////////////////////////////



