﻿// JScript File

		function CreateXMLDOM()
		{
			var AVersions =[ "MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","Microsoft.XmlDom"];
			// code for IE
				
			for (var i = 0;i < AVersions.length;i++)
				{
					try 
						{
							var oXmlDom = new ActiveXObject(AVersions[i]);
							return oXmlDom; 
						}
					catch (oError)
						{
							//loi
						}
				}
			
		}
		function Checkorder(id,value)		
		{
			alert(id);
			alert(value);			
		}
		function valuess(giatri)
			{																		
				alert(giatri);
			}
		function LoadData(obj,content,idloai,page)
		{
			//var idchannel = txtidchannel.value;
			var linkXml
			var DivLoading = document.getElementById(obj);
			DivLoading.innerHTML ="<table width=100% height=100%><tr><td   align='center'  valign='center' width='100%'><IMG src='images/ajaxload.gif' border=0></td></tr></table>";
			linkXml ="html/controlcenter.aspx?Content="+ content +"&idmenu=" + idloai +"&page="+ page ;
            // code for Mozilla, etc.
			if (window.XMLHttpRequest)
				{
					
					var xmlhttp=new XMLHttpRequest()
				}
				// code for IE
			else if (window.ActiveXObject)
				{
					var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")

				}
			if (xmlhttp!=null)
				{
					xmlhttp.onreadystatechange=function ()
						{
							
							if (xmlhttp.readyState==4)
							{
								
								if (xmlhttp.status==200)
									
									{
										
										var Divnoidung = document.getElementById(obj);
										Divnoidung.innerHTML =xmlhttp.responseText;
										if (content=="Contact")
										{
											Divnoidung.style.height="600px";
										}
									}
								else if (xmlhttp.status==404)
									{
										LoadData(obj,content,idloai,page);
									}
							}
						}
					xmlhttp.open("GET",linkXml,true)
					xmlhttp.send(null)
				}
				else
				{
					alert("Your browser does not support XMLHTTP.")
				
				}			
			}		
			
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 handleResponse(  )
	{
    if(request.readyState == 4)
		{
        if(request.status == 200)
        {
            //alert(request.responseText);
        } 
        else 
        {
            alert("Please use this function the Exployer Internet Browser.");
        }
    }//end outer if
}
function httpRequest(reqType,url,asynch){
    //Mozilla-based browsers
    if(window.XMLHttpRequest)
    {
        request = new XMLHttpRequest(  );
    } 
    else if (window.ActiveXObject)
		{
        request=new ActiveXObject("Msxml2.XMLHTTP");
        if (! request)
        {
            request=new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    //the request could still be null if neither ActiveXObject
    //initialization succeeded
    if(request)
    {
        initReq(reqType,url,asynch);
        HideCash(this.value);ProfileSidebarCenter (5);LoadData('ViewCenter','Shopping','1','1','1')
    }
    else 
    {
        alert("Your browser does not permit the use of all "+
              "of this application's features!");
    }
}
function LinkDownload(Link)
{
     window.open(Link); 
}
