﻿// JScript File
/*
function DoCallback(url, params)
{
	// url:    URL to invoke
	// params: string object to pass to the remote URL
	//Add some parameters to the query string
	var pageUrl = url+'?'+params;
	//var pageUrl = url;
	// Initialize the XmlHttp object
	try
	{
		//Mozilla Browsers
		//xmlRequest = new XMLHttpRequest();
		xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (e)
	{
		try
		{
			//IE
			//xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
			xmlRequest = new XMLHttpRequest();
		}
		catch (e)
		{
			//Something else that won't work with this code...
			xmlRequest=false;
		}
	}
	// Post our XmlRequest and get our desired string
	xmlRequest.open("POST", pageUrl, false);
	xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	//xmlRequest.send(params);
	xmlRequest.send(null);
	// Return the XmlHttp object
	return xmlRequest;
}*/
function DoCallback(url, params)
{
	// url:    URL to invoke
	// params: string object to pass to the remote URL
	//Add some parameters to the query string	
	//debugger;
	var pageUrl = url+'?'+params+'&'+Math.random();
	var xmlHttp=null;
	try
	{
		//Mozilla Browsers		
		//xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHttp=new XMLHttpRequest();

	}
	catch (e)
	{
		try
		{
			//IE
			//xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");

			//xmlRequest = new XMLHttpRequest();
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");			
		}
		catch (e)
		{
			//Something else that won't work with this code...
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

			//xmlRequest=false;
		}
	}
	// Post our XmlRequest and get our desired string
	xmlHttp.open("GET", pageUrl, false);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	xmlHttp.send(null);
	// Return the XmlHttp object
	return xmlHttp;
}

//******************               VL 06 2007-10-28                 **********************
//******************* Get Search Results on click of Top Search Button*********************
function GetSearchResults(searchstring)
{
    //debugger;
    exp="\\.";
    emailregexp = new RegExp(exp);
    result = searchstring.match(emailregexp);
    while(result != null)
    {
        searchstring = searchstring.replace(".","dddottt");
        result = searchstring.match(emailregexp);
    }
    var xml=new DoCallback('/XMLResponse.aspx','command=TopSearchResults&SearchString='+searchstring);
    
	var resp=xml.responseText;	
	return resp;
	
}
//******************* Get Search Results Code Ends Here *****************************

//******************            HT 1-Nov-2007               **********************

//******************* Delete Chat Start Here *********************

function DeleteNodeId(NodeId,PortalId,URL)

{
//    debugger;
    var xml=new DoCallback('/XMLResponse.aspx','command=DeleteChatNode&Nodeid='+NodeId+"&PortalId="+PortalId+"&ChatURL="+URL);
    var resp=xml.responseText;
    return resp;      
}
//******************* Delete Chat End Here*******************


//******************            HT 17-Dec-2007               **********************

//******************* Chat Deshboard Start Here *********************

function GetChatDeshBoard()
{
    //debugger;
    var xml=new DoCallback('/XMLResponse.aspx','command=GetChatDeshBoard');
    var resp=xml.responseText;
    return resp;      
}
//******************* Chat Deshboard End Here*******************

//******************            HT 17-Dec-2007               **********************

//******************* Classified Deshboard Start Here *********************

function GetClassifiedDeshBoard()
{
 //   debugger;
    var xml=new DoCallback('/XMLResponse.aspx','command=GetClassifiedDeshBoard');
    var resp=xml.responseText;
    return resp;      
}
//******************* Classified Deshboard End Here*******************
