﻿// JScript File

function makeAPOST(urlToSend,params)
{
    var xmlhttp,e,ex;
    var strRes="";    
    
    try{
        xmlhttp = new XMLHttpRequest();
     }catch(e)
     {
        try{
            xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.3.0");
        }catch(ex)
        {
            alert("Exception occurred in xmlhttp in Print script");
        }
     }     
     
     xmlhttp.open("POST",urlToSend,false);
     // Content type is important for posting ***********************************
     xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
     xmlhttp.send(params);
     strRes = xmlhttp.responseText;     
     return strRes;
}


//function MakeARequest(urlToSend,params,sendType,IsAsync)
//{
//    var xmlhttp,e,ex;
//    var strRes="";    
//    
//    try{
//        xmlhttp = new XMLHttpRequest();
//     }catch(e)
//     {
//        try{
//            xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.3.0");
//        }catch(ex)
//        {
//            alert("Exception occurred in xmlhttp in Print script");
//        }
//     }     
//     
//     xmlhttp.open(sendType,urlToSend,IsAsync);
//     // Content type is important for posting ***********************************
//     xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
//     if(sendType=="POST")
//        xmlhttp.send(params);
//     else
//        xmlhttp.send(null);   
//     strRes = xmlhttp.responseText;     
//     return strRes;
//}


