﻿
var xmlHttpTestimonial;
function BindCustomerTestimonials(ContainerControl)
{
    var PgName = GetPageName(window.location.href);
    
    if (PgName=='' || PgName=='Default1.aspx')
    {
        xmlHttpTestimonial=GetXmlHttpObject();
        if (xmlHttpTestimonial==null)
        {
            alert ("Your browser does not support AJAX!");
            return;
        }
        var url="AJAXPage.aspx?gMode=GetCustomerTestimonials";
        xmlHttpTestimonial.onreadystatechange=function()
        {
            if (xmlHttpTestimonial.readyState==4)
            {
                var RetValue='';
                RetValue=xmlHttpTestimonial.responseText;
                if (RetValue==''){}
                else
                {
                    document.getElementById(ContainerControl).innerHTML=RetValue;
                }
            }
        }
        xmlHttpTestimonial.open("GET",url,true);
        xmlHttpTestimonial.send(null);
    }
}


var xmlHttpAddViewsCount;
function AddViewsCount(ViewsType,ViewsValue)
{
    xmlHttpAddViewsCount=GetXmlHttpObject();
    if (xmlHttpAddViewsCount==null)
    {
        alert ("Your browser does not support AJAX!");
        return;
    }
    var url="AJAXPage.aspx?gMode=AddViewsCount&ViewsType=" + ViewsType + "&ViewsValue=" + ViewsValue;
    xmlHttpAddViewsCount.onreadystatechange=function()
    {
        if (xmlHttpAddViewsCount.readyState==4)
        {
            var RetValue='';
            RetValue=xmlHttpAddViewsCount.responseText;
        }
    }
    xmlHttpAddViewsCount.open("GET",url,true);
    xmlHttpAddViewsCount.send(null);
}

var xmlHttpMostPopSearch;
function BindMostPopularSearch()
{   
    xmlHttpMostPopSearch=GetXmlHttpObject();
    if (xmlHttpMostPopSearch==null)
    {
        alert ("Your browser does not support AJAX!");
        return;
    }
    var url="AJAXPage.aspx?gMode=GetMostPopularSearch";
    xmlHttpMostPopSearch.onreadystatechange=function()
    {
        if (xmlHttpMostPopSearch.readyState==4)
        {
            var RetValue=xmlHttpMostPopSearch.responseText;
            document.getElementById("TdMostPopularSearch").innerHTML=RetValue;
        }
    }
    xmlHttpMostPopSearch.open("GET",url,true);
    xmlHttpMostPopSearch.send(null);
}

//var xmlHttpCourier;
//function BindCourier(val)
//{

//    var CityId = val.value
//    if (CityId!=0)
//    {
//        xmlHttpCourier=GetXmlHttpObject();
//        if (xmlHttpCourier==null)
//        {
//            alert ("Your browser does not support AJAX!");
//            return;
//        }
//        var url="AJAXPage.aspx?gMode=GetBindCourier&CityId=" + CityId ;
//        xmlHttpCourier.onreadystatechange=function()
//        {
//            if (xmlHttpCourier.readyState==4)
//            {
//                var RetValue=xmlHttpCourier.responseText;
//                document.getElementById("TdCourier").innerHTML=RetValue;
//            }
//        }
//        xmlHttpCourier.open("GET",url,true);
//        xmlHttpCourier.send(null);    
//    }
    
//}
