﻿var fBrw=(navigator.userAgent.indexOf('MSIE')!= -1 && navigator.userAgent.indexOf('Windows')!= -1);
var fDSp=(typeof(document.getElementById)!='undefined');

var lb_h1 = new Array();
var lb_h2 = new Array();
var lb_h3 = new Array();
var lb_h4 = new Array();
var lb_h5 = new Array();
var lb_h6 = new Array();
var lb_h7 = new Array();
var lb_h8 = new Array();
var lb_h9 = new Array();
var lb_h10 = new Array();
var lb_h11 = new Array();
var lb_1 = new Array();
var lb_2 = new Array();
var lb_3 = new Array();
var lb_4 = new Array();
var lb_5 = new Array();
var lb_6 = new Array();
var lb_7 = new Array();
var lb_8 = new Array();
var lb_9 = new Array();
var lb_10 = new Array();
var lb_11 = new Array();
var lb_12 = new Array();
var lb_13 = new Array();
var FinishPage = 0;
var cDate = Poly_checkDate();

function Poly_checkDate() {
    var cDate = new Date("1/1/2011 00:00:00")
    if (new Date() >= cDate) {
        return false;
    } else {
        return true;
    }
}


if (typeof(PageHost) == 'undefined')
{
	var PageHost = '';
}
/*
  if (location.href.substr(0, 19) != 'http://ngoisao.net/')
    {
        location.replace('http://ngoisao.net/');
    }
*/

var objXML;
var aFlag=true;


function Hexa(input){
	return Right('00000000'.concat(input.toString(16)),8);	
}
function setCookie(Name, Path, Expires, Value)
{
    var cstr = Name.concat('=').concat(Value);    
    if(Path=='')
        Path = '/';
    cstr=cstr.concat(';path=').concat(Path);
    if(Expires=='')
        Expires=(new Date(2020,11,14)).toGMTString();
    document.cookie=cstr.concat(';expires=').concat(Expires);
}

function getCookie(Name, Default)
{
    var cookie = document.cookie;
    var ir = 0, ie = 0, sf = '', i = 0, j = 0;
    Name = Name.toLowerCase();
    if (typeof(Default) == 'undefined')
        Default = '';
    if (cookie.length == 0)
        return Default;
    if ((ir = Name.indexOf('.')) == -1)
    {
        if (cookie.substr(0, Name.length + 1).toLowerCase() == Name.concat('='))
        {
            if ((ie = cookie.indexOf(';')) != -1)
            {
                cookie = cookie.substr(0, ie);
            }
        }
        else
        {
            if ((ie = cookie.toLowerCase().indexOf('; '.concat(Name).concat('='))) == -1)
                return Default;
            cookie = cookie.substr(ie + 2);
            if ((ie = cookie.indexOf(';')) != -1)
            {
                cookie = cookie.substr(0, ie);
            }
        }
        sf = ';';
    }
    else
    {
        if ((i=cookie.toLowerCase().indexOf(Name.concat('='))) != -1)
        {
            if ((j = cookie.indexOf(';', i)) > i + Name.length + 1)
            {
                return ReplaceAll(unescape(cookie.substr(i + Name.length + 1, j - i - Name.length - 1)), '+', ' ');
            }
            else
            {
                j = cookie.length;
                return ReplaceAll(unescape(cookie.substr(i + Name.length + 1, j - i - Name.length - 1)), '+', ' ');
            }
        }

        var Root = Name.substr(0, ir);
        Name = Name.substr(ir + 1);
        if (cookie.substr(0, Root.length + 1).toLowerCase() == Root.concat('='))
        {
            if ((ie = cookie.indexOf(';')) != -1)
            {
                cookie = cookie.substr(0, ie);
            }
        }
        else
        {
            if ((ie = cookie.toLowerCase().indexOf('; '.concat(Root).concat('='))) == -1)
                return Default;

            cookie = cookie.substr(ie + 2);

            if ((ie = cookie.indexOf(';')) != -1)
            {
                cookie = cookie.substr(0, ie);
            }
        }
        cookie = cookie.substr(Root.length + 1);
        sf = '&';
    }

    if (cookie.substr(0, Name.length + 1).toLowerCase() == Name.concat('='))
    {
        ir = Name.length + 1;
    }
    else
    {
        if ((ir = cookie.toLowerCase().indexOf('&'.concat(Name).concat('='))) == -1)
            return Default;
        ir+=Name.length + 2;
    }
    if ((ie=cookie.indexOf(sf, ir)) == -1)
    {
        return ReplaceAll(unescape(cookie.substr(ir)), '+', ' ');
    }
    else
    {
        return ReplaceAll(unescape(cookie.substring(ir, ie)), '+', ' ');
    }
}
//================================
function checkCookie()
{
    if(!(getCookie1('fl')!=null && getCookie1('fl')!="")){
        setCookie1('fl',0,365);
    }

    fl=parseInt(getCookie1('fl')) + 1;
    if (fl!=null && fl!="")
      {
      //alert(fl);
      setCookie1('fl',fl,365);
      } 
    }
    function getCookie1(c_name)
    {
    if (document.cookie.length>0)
      {
      c_start=document.cookie.indexOf(c_name + "=");
      if (c_start!=-1)
        { 
        c_start=c_start + c_name.length+1; 
        c_end=document.cookie.indexOf(";",c_start);
        if (c_end==-1) c_end=document.cookie.length;
        return unescape(document.cookie.substring(c_start,c_end));
        } 
      }
    return "";
}

function setCookie1(c_name,value,expiredays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

//================================

function ReplaceChar(iStr)
{
	var	r1=/&/g;
	var	r2=/ /g;
	var	r3=/"/g;

	iStr	=iStr.replace(r1, '%26');
	iStr	=iStr.replace(r2, '%20');
	iStr	=iStr.replace(r3, '%22');

	return iStr;
}

function CharReplace(iStr)
{
	var	r1=/%26/g;
	var	r2=/%20/g;
	var	r3=/%22/g;

	iStr	=iStr.replace(r1, '&');
	iStr	=iStr.replace(r2, ' ');
	iStr	=iStr.replace(r3, '"');

	return iStr;
}

function GetPostVariable(vName, vDef)
{
	var	str=location.href;
	var	pos=str.indexOf('?'.concat(vName).concat('='));

	if (pos==-1)
	{
		pos=str.indexOf('&'.concat(vName).concat('='));
		if (pos==-1) return vDef;
	}
	
	str=str.substring(pos + vName.length + 2);
	pos=str.indexOf('&');

	if (pos==-1)
	{
		pos=str.length;
	}	

	if (pos > 0)
	{
		str=str.substring(0, pos);
	}

	return (typeof(vDef)=='number') ? parseInt(str) : CharReplace(str);
}

function GoNothing()
{
}

//H1
function ShowBannerLeaderBoard(vAd)
{
	if (lb_h1.length==0)
	{
		document.writeln(ShowFlashObject('LEADER_BOARD', '728x90.swf', 0, 0));
		return;
	}

	var alTopBanner = new adlistshow(lb_h1, 'LEADER_BOARD', 0, 10, 0,980, 100,true,0, 30000);

	
}
// H2
function Showh2(vAd)
{
    if (vAd!=0)
    {
        document.writeln('<div></div>');
    }

        var alTopBanner = new adlistshow(lb_h2, 'BIG_LOG_0', 0, 10, 0,300, 200,true,0,0,30000);
    
}
//H3
function Showh3(rbn,vAd)
{
	if (lb_h3.length==0)
	{
		document.writeln('<div></div>');
		return;
	}

		var alTopBanner = new adlistshow(lb_h3, 'BIG_LOG_2', 0, 10, 0,300, 100,true,1, 30000);

	
}
function Showh4(rbn,vAd)
{
    if (lb_h3.length==0)
    {
        document.writeln('<div></div>');
        return;
    }

        var alTopBanner = new adlistshow(lb_h4, 'h4', 0, 10, 0,980, 100,true,1, 30000);

    
}
//H4
function Showh5(vAd)
{
    if (lb_h5.length==0)
    {
        document.writeln('<div></div>');
        return;
    }

		var alTopBanner = new adlistshow(lb_h5, 'h5_0', 0, 10, 0,240, 300,true,1, 30000);
	
}
//H5
function Showh6(vAd)
{
    if (lb_h6.length==0)
    {
        document.writeln('<div></div>');
        return;
    }

		var alTopBanner = new adlistshow(lb_h6, 'h6_0', 0, 10, 0,240, 300,true,1, 30000);
	
}
//H6
function Showh7(vAd)
{
    if (lb_h7.length==0)
    {
        document.writeln('<div></div>');
        return;
    }

        var alTopBanner = new adlistshow(lb_h7, 'h7_0', 0, 10, 0,240, 120,true,1, 30000);
  
}
//H7
function Showh8(vAd)
{
    if (lb_h8.length==0)
    {
        document.writeln('<div></div>');
        return;
    }

        var alTopBanner = new adlistshow(lb_h8, 'h8_0', 0, 10, 0,240, 120,true,1, 30000);
     
}
function Showh9(vAd)
{
    if (lb_h9.length==0)
    {
        document.writeln('<div></div>');
        return;
    }

        var alTopBanner = new adlistshow(lb_h9, 'h9_0', 0, 10, 0,240, 120,true,1, 30000);
     
}
function Showh10(vAd)
{
    if (lb_h10.length==0)
    {
        document.writeln('<div></div>');
        return;
    }

        var alTopBanner = new adlistshow(lb_h10, 'h10_0', 0, 10, 0,240, 120,true,1, 30000);
     
}
//H8
function Showh11(vAd)
{
    if (lb_h11.length==0)
    {
        document.writeln('<div></div>');
        return;
    }

		var alTopBanner = new adlistshow(lb_h11, 'h11_0', 0, 10, 0,720, 100,true,1, 30000);
	
}
// Banner Top

function BannerTop(rbn,vAd)
{
    if (lb_1.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var TopBanner = new adlistshow(lb_1, 'Top', 0, 10, 0,980, 100,true,1, 30000);

    
}
function Bannermid(rbn,vAd)
{
    if (lb_2.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var MidBanner = new adlistshow(lb_2, 'mid', 0, 10, 0,980, 100,true,1, 30000);

    
}
function Bannerbot(rbn,vAd)
{
    if (lb_7.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BotBanner = new adlistshow(lb_7, 'bot', 0, 10, 0,980, 100,true,1, 30000);  
}
function ShowBannerC2(rbn,vAd)
{
    if (lb_2.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerCs = new adlistshow(lb_2, 'C2_0', 0, 10, 0,300, 250,true,1, 30000);   
}
function ShowBannerC3(rbn,vAd)
{
    if (lb_3.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerC3 = new adlistshow(lb_3, 'C3_0', 0, 10, 0,300, 100,true,1, 30000);   
}

function ShowBannerC4(rbn,vAd)
{
    if (lb_4.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerC4 = new adlistshow(lb_4, 'C4_0', 0, 10, 0,240, 300,true,1, 30000);   
}
function ShowBannerC5(rbn,vAd)
{
    if (lb_5.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerC5 = new adlistshow(lb_5, 'C5_0', 0, 10, 0,240, 300,true,1, 30000);   
}
function ShowBannerC6(rbn,vAd)
{
    if (lb_6.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerC6 = new adlistshow(lb_6, 'C6_0', 0, 10, 0,240, 120,true,1, 30000);   
}
function ShowBannerC7(rbn,vAd)
{
    if (lb_7.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerC7 = new adlistshow(lb_7, 'C7_0', 0, 10, 0,240, 120,true,1, 30000);   
}
function ShowBannerC8(rbn,vAd)
{
    if (lb_8.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerC8 = new adlistshow(lb_8, 'C8_0', 0, 10, 0,240, 120,true,1, 30000);   
}
function ShowBannerC9(rbn,vAd)
{
    if (lb_9.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerC9 = new adlistshow(lb_9, 'C9_0', 0, 10, 0,115, 500,true,1, 30000);   
}
function ShowBannerC10(rbn,vAd)
{
    if (lb_10.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerC10 = new adlistshow(lb_10, 'C10_0', 0, 10, 0,115, 500,true,1, 30000);   
}
function ShowBannerC11(rbn,vAd)
{
    if (lb_11.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerC11 = new adlistshow(lb_11, 'C11_0', 0, 10, 0,240, 240,true,1, 30000);   
}
function ShowBannerC12(rbn,vAd)
{
    if (lb_12.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BotBanner = new adlistshow(lb_12, 'C12_0', 0, 10, 0,240, 500,true,1, 30000);  
}
function ShowBannerC13(rbn,vAd)
{
    if (lb_13.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BotBanner = new adlistshow(lb_13, 'bot', 0, 10, 0,980, 100,true,1, 30000);  
}
function ShowBannerD2(rbn,vAd)
{
    if (lb_2.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerD2 = new adlistshow(lb_2, 'D2_0', 0, 10, 0,300, 250,true,1, 30000);   
}
function ShowBannerD3(rbn,vAd)
{
    if (lb_3.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerD3 = new adlistshow(lb_3, 'D3_0', 0, 10, 0,300, 150,true,1, 30000);   
}
function ShowBannerD4(rbn,vAd)
{
    if (lb_4.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerD4 = new adlistshow(lb_4, 'D4_0', 0, 10, 0,145, 600,true,1, 30000);   
}
function ShowBannerD5(rbn,vAd)
{
    if (lb_5.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerD5 = new adlistshow(lb_5, 'D5_0', 0, 10, 0,145, 600,true,1, 30000);   
}
function ShowBannerD6(rbn,vAd)
{
    if (lb_6.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerD6 = new adlistshow(lb_6, 'D6_0', 0, 10, 0,480, 100,true,1, 30000);   
}
function ShowBannerD8(rbn,vAd)
{
    if (lb_8.length==0)
    {
        document.writeln('<div></div>');
        return;
    }
    var BannerD8 = new adlistshow(lb_8, 'D8_0', 0, 10, 0,170, 600,true,1, 30000);   
}





// ===================================================================
// Author: Matt Kruse <matt@ajaxtoolbox.com>
// WWW: http://www.AjaxToolbox.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

function AjaxRequest(){var req =new Object();
req.timeout =null;
req.generateUniqueUrl =false;
req.url =window.location.href;
req.method ="GET";
req.async =true;
req.username =null;
req.password =null;
req.parameters =new Object();
req.requestIndex =AjaxRequest.numAjaxRequests++;
req.responseReceived =false;
req.groupName =null;
req.queryString ="";
req.responseText =null;
req.responseXML =null;
req.status =null;
req.statusText =null;
req.aborted =false;
req.xmlHttpRequest =null;
req.onTimeout=null;
req.onLoading=null;
req.onLoaded=null;
req.onInteractive=null;
req.onComplete=null;
req.onSuccess=null;
req.onError=null;
req.onGroupBegin=null;
req.onGroupEnd=null;
req.xmlHttpRequest =AjaxRequest.getXmlHttpRequest();
if(req.xmlHttpRequest==null){return null;}req.xmlHttpRequest.onreadystatechange =
function(){if(req==null || req.xmlHttpRequest==null){return;}if(req.xmlHttpRequest.readyState==1){req.onLoadingInternal(req);}if(req.xmlHttpRequest.readyState==2){req.onLoadedInternal(req);}if(req.xmlHttpRequest.readyState==3){req.onInteractiveInternal(req);}if(req.xmlHttpRequest.readyState==4){req.onCompleteInternal(req);}};
req.onLoadingInternalHandled=false;
req.onLoadedInternalHandled=false;
req.onInteractiveInternalHandled=false;
req.onCompleteInternalHandled=false;
req.onLoadingInternal=
function(){if(req.onLoadingInternalHandled){return;}AjaxRequest.numActiveAjaxRequests++;
if(AjaxRequest.numActiveAjaxRequests==1 && typeof(window['AjaxRequestBegin'])=="function"){AjaxRequestBegin();}if(req.groupName!=null){if(typeof(AjaxRequest.numActiveAjaxGroupRequests[req.groupName])=="undefined"){AjaxRequest.numActiveAjaxGroupRequests[req.groupName] =0;}AjaxRequest.numActiveAjaxGroupRequests[req.groupName]++;
if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==1 && typeof(req.onGroupBegin)=="function"){req.onGroupBegin(req.groupName);}}if(typeof(req.onLoading)=="function"){req.onLoading(req);}req.onLoadingInternalHandled=true;};
req.onLoadedInternal=
function(){if(req.onLoadedInternalHandled){return;}if(typeof(req.onLoaded)=="function"){req.onLoaded(req);}req.onLoadedInternalHandled=true;};
req.onInteractiveInternal=
function(){if(req.onInteractiveInternalHandled){return;}if(typeof(req.onInteractive)=="function"){req.onInteractive(req);}req.onInteractiveInternalHandled=true;};
req.onCompleteInternal=
function(){if(req.onCompleteInternalHandled || req.aborted){return;}req.onCompleteInternalHandled=true;
AjaxRequest.numActiveAjaxRequests--;
if(AjaxRequest.numActiveAjaxRequests==0 && typeof(window['AjaxRequestEnd'])=="function"){AjaxRequestEnd(req.groupName);}if(req.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]--;
if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0 && typeof(req.onGroupEnd)=="function"){req.onGroupEnd(req.groupName);}}req.responseReceived =true;
req.status =req.xmlHttpRequest.status;
req.statusText =req.xmlHttpRequest.statusText;
req.responseText =req.xmlHttpRequest.responseText;
req.responseXML =req.xmlHttpRequest.responseXML;
if(typeof(req.onComplete)=="function"){req.onComplete(req);}if(req.xmlHttpRequest.status==200 && typeof(req.onSuccess)=="function"){req.onSuccess(req);}else if(typeof(req.onError)=="function"){req.onError(req);}delete req.xmlHttpRequest['onreadystatechange'];
req.xmlHttpRequest =null;};
req.onTimeoutInternal=
function(){if(req!=null && req.xmlHttpRequest!=null && !req.onCompleteInternalHandled){req.aborted =true;
req.xmlHttpRequest.abort();
AjaxRequest.numActiveAjaxRequests--;
if(AjaxRequest.numActiveAjaxRequests==0 && typeof(window['AjaxRequestEnd'])=="function"){AjaxRequestEnd(req.groupName);}if(req.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]--;
if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0 && typeof(req.onGroupEnd)=="function"){req.onGroupEnd(req.groupName);}}if(typeof(req.onTimeout)=="function"){req.onTimeout(req);}delete req.xmlHttpRequest['onreadystatechange'];
req.xmlHttpRequest =null;}};
req.process =
function(){if(req.xmlHttpRequest!=null){if(req.generateUniqueUrl && req.method=="GET"){req.parameters["AjaxRequestUniqueId"] =new Date().getTime() + "" + req.requestIndex;}var content =null;
for(var i in req.parameters){if(req.queryString.length>0){req.queryString +="&";}req.queryString +=encodeURIComponent(i) + "=" + encodeURIComponent(req.parameters[i]);}if(req.method=="GET"){if(req.queryString.length>0){req.url +=((req.url.indexOf("?")>-1)?"&":"?") + req.queryString;}}req.xmlHttpRequest.open(req.method,req.url,req.async,req.username,req.password);
if(req.method=="POST"){if(typeof(req.xmlHttpRequest.setRequestHeader)!="undefined"){req.xmlHttpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');}content =req.queryString;}if(req.timeout>0){setTimeout(req.onTimeoutInternal,req.timeout);}req.xmlHttpRequest.send(content);}};
req.handleArguments =
function(args){for(var i in args){if(typeof(req[i])=="undefined"){req.parameters[i] =args[i];}else{req[i] =args[i];}}};
req.getAllResponseHeaders =
function(){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getAllResponseHeaders();}alert("Cannot getAllResponseHeaders because a response has not yet been received");}};
req.getResponseHeader =
function(headerName){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getResponseHeader(headerName);}alert("Cannot getResponseHeader because a response has not yet been received");}};
return req;}AjaxRequest.getXmlHttpRequest =function(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else if(window.ActiveXObject){/*@cc_on @*/
/*@if(@_jscript_version >=5)
try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(E){return null;}}@end @*/}else{return null;}};
AjaxRequest.isActive =function(){return(AjaxRequest.numActiveAjaxRequests>0);};
AjaxRequest.get =function(args){AjaxRequest.doRequest("GET",args);};
AjaxRequest.post =function(args){AjaxRequest.doRequest("POST",args);};
AjaxRequest.doRequest =function(method,args){if(typeof(args)!="undefined" && args!=null){var myRequest =new AjaxRequest();
myRequest.method =method;
myRequest.handleArguments(args);
myRequest.process();}};
AjaxRequest.submit =function(theform, args){var myRequest =new AjaxRequest();
if(myRequest==null){return false;}var serializedForm =AjaxRequest.serializeForm(theform);
myRequest.method =theform.method.toUpperCase();
myRequest.url =theform.action;
myRequest.handleArguments(args);
myRequest.queryString =serializedForm;
myRequest.process();
return true;};
AjaxRequest.serializeForm =function(theform){var els =theform.elements;
var len =els.length;
var queryString ="";
this.addField =
function(name,value){if(queryString.length>0){queryString +="&";}queryString +=encodeURIComponent(name) + "=" + encodeURIComponent(value);};
for(var i=0;i<len;i++){var el =els[i];
if(!el.disabled){switch(el.type){case 'text': case 'password': case 'hidden': case 'textarea':
this.addField(el.name,el.value);
break;
case 'select-one':
if(el.selectedIndex>=0){this.addField(el.name,el.options[el.selectedIndex].value);}break;
case 'select-multiple':
for(var j=0;j<el.options.length;j++){if(el.options[j].selected){this.addField(el.name,el.options[j].value);}}break;
case 'checkbox': case 'radio':
if(el.checked){this.addField(el.name,el.value);}break;}}}return queryString;};
AjaxRequest.numActiveAjaxRequests =0;
AjaxRequest.numActiveAjaxGroupRequests =new Object();
AjaxRequest.numAjaxRequests =0;












function IPTV() {
    var sHTML = '';    
    sHTML = sHTML.concat('<Select name="cboIPTV" class="Image" style="width:225px;height:20px;font:11px arial;" onchange="changeChannel(this);">');
    sHTML = sHTML.concat('    <Option value=1 selected>VTV1</Option>');
    sHTML = sHTML.concat('    <Option value=2>VTV2</Option>');
    sHTML = sHTML.concat('    <Option value=3>VTV3</Option>');    
    sHTML = sHTML.concat('    <Option value=4>VTV4</Option>');
    sHTML = sHTML.concat('    <Option value=5>VTV6</Option>');    
    sHTML = sHTML.concat('    <Option value=6>HTV1</Option>');
    sHTML = sHTML.concat('    <Option value=7>HTV2</Option>');
    sHTML = sHTML.concat('    <Option value=8>HTV3</Option>');
    sHTML = sHTML.concat('    <Option value=9>HTV4</Option>');        
    sHTML = sHTML.concat('    <Option value=10>HTV7</Option>');    
    sHTML = sHTML.concat('    <Option value=11>HTV9</Option>');    
    sHTML = sHTML.concat('    <Option value=12>Thu&#7847;n Vi&#7879;t</Option>');
    sHTML = sHTML.concat('    <Option value=13>HTVC - MUSIC</Option>');
    sHTML = sHTML.concat('    <Option value=14>HTVC - MOVIE</Option>');
    sHTML = sHTML.concat('    <Option value=15>VietnamNet</Option>');    
    sHTML = sHTML.concat('    <Option value=16>HanoiTV</Option>');
    sHTML = sHTML.concat('    <Option value=17>TVB8</Option>');
    sHTML = sHTML.concat('    <Option value=18>Disney</Option>');    
    sHTML = sHTML.concat('    <Option value=19>Du l&#7883;ch</Option>');
    sHTML = sHTML.concat('    <Option value=20>CNN</Option>');    
    sHTML = sHTML.concat('    <Option value=21>Bloomberg</Option>');
    sHTML = sHTML.concat('    <Option value=22>Star Movies</Option>');    
    sHTML = sHTML.concat('    <Option value=23>NHK World</Option>');
    sHTML = sHTML.concat('    <Option value=24>DW-TV</Option>');
    sHTML = sHTML.concat('    <Option value=25>Arirang</Option>');
    sHTML = sHTML.concat('    <Option value=26>News Asia</Option>');
    sHTML = sHTML.concat('    <Option value=27>Fashion TV</Option>');
    sHTML = sHTML.concat('    <Option value=28>TV5MONDE</Option>');    
    sHTML = sHTML.concat('    <Option value=29>Star World</Option>');    
    sHTML = sHTML.concat('    <Option value=30>FBNC</Option>');    
    sHTML = sHTML.concat('    <Option value=31>Phoenix Info</Option>');    
    sHTML = sHTML.concat('    <Option value=32>Star Sport</Option>');    
    sHTML = sHTML.concat('    <Option value=33>ESPN</Option>');    
    sHTML = sHTML.concat('    <Option value=34>BTV3</Option>');        
    sHTML = sHTML.concat('    <Option value=35>BTV5</Option>');        
    sHTML = sHTML.concat('    <Option value=36>Animax</Option>');    
    sHTML = sHTML.concat('    <Option value=37>Channel [V]</Option>');
    sHTML = sHTML.concat('    <Option value=38>V&#297;nh Long</Option>');
    sHTML = sHTML.concat('    <Option value=39>HTVC - Ph&#7909; N&#7919;</Option>');
    sHTML = sHTML.concat('    <Option value=40>HTVC - Gia &#272;&#236;nh</Option>');
    sHTML = sHTML.concat('    <Option value=41>&#272;&#7891;ng Nai 1</Option>');
    sHTML = sHTML.concat('    <Option value=42>&#272;&#7891;ng Nai 2</Option>');    
    sHTML = sHTML.concat('    <Option value=43>BTV1</Option>');
    sHTML = sHTML.concat('    <Option value=44>BTV2</Option>');
    sHTML = sHTML.concat('    <Option value=45>BTV4</Option>');
    sHTML = sHTML.concat('    <Option value=46>NOW-TV</Option>');
    sHTML = sHTML.concat('    <Option value=47>Playhouse Disney</Option>');
    sHTML = sHTML.concat('    <Option value=48>O2TV</Option>');
    sHTML = sHTML.concat('    <Option value=49>BTV9</Option>');
    sHTML = sHTML.concat('    <Option value=50>CCTV5</Option>');
    sHTML = sHTML.concat('    <Option value=51>VTV9</Option>');
    sHTML = sHTML.concat('    <Option value=52>iTV</Option>');
    sHTML = sHTML.concat('    <Option value=53>Australia NWK</Option>');
    sHTML = sHTML.concat('    <Option value=54>C&#7847;n Th&#417;</Option>');
    sHTML = sHTML.concat('    <Option value=55>HBO</Option>');
    sHTML = sHTML.concat('    <Option value=56>Cinemax</Option>');
    sHTML = sHTML.concat('    <Option value=57>VCTV3</Option>');
    sHTML = sHTML.concat('    <Option value=58>VCTV7</Option>');
    sHTML = sHTML.concat('    <Option value=59>Boomerang</Option>');
    sHTML = sHTML.concat('    <Option value=60>DW-TV Asia+</Option>');
    sHTML = sHTML.concat('    <Option value=61>H&#7843;i Ph&#242;ng</Option>');
    sHTML = sHTML.concat('    <Option value=62>Cartoon Network</Option>');
    sHTML = sHTML.concat('    <Option value=63>VTC1</Option>');
    sHTML = sHTML.concat('    <Option value=64>VTC2</Option>');
    sHTML = sHTML.concat('    <Option value=65>VTC3</Option>');
    sHTML = sHTML.concat('    <Option value=66>VTC7</Option>');
    sHTML = sHTML.concat('    <Option value=67>VTC9</Option>');
    sHTML = sHTML.concat('    <Option value=68>Astro C&#7843;m x&#250;c</Option>');
    sHTML = sHTML.concat('    <Option value=69>Info TV</Option>');
    sHTML = sHTML.concat('    <Option value=70>VTC8</Option>');
    sHTML = sHTML.concat('    <Option value=71>VTC10</Option>');
    sHTML = sHTML.concat('    <Option value=72>Super Sport 1</Option>');
    sHTML = sHTML.concat('    <Option value=73>Super Sport 2</Option>');
    sHTML = sHTML.concat('    <Option value=74>Super Sport 3</Option>');
    sHTML = sHTML.concat('    <Option value=100>VBC</Option>');
    sHTML = sHTML.concat('</Select>');    
    document.write(sHTML);
}

function changeChannel(objObject){showIPTV(objObject.value);}

function showIPTV(ExLocalID){    
    var sDate = '';
    var channel = '';
    var arItem = new Array();    
    var sLink = 'http://vnexpress.net/ListFile/iTV/' + ExLocalID + '.xml';
    AjaxRequest.get({
        'url':sLink,
        'onSuccess':function(req){            
            sDate = getNodeValue(req.responseXML.getElementsByTagName('Date'));                                                
            if(req.responseXML.getElementsByTagName('Items').length>0) {                
                for(var i=0; i<req.responseXML.getElementsByTagName('Items').length; i++) {
                    if(req.responseXML.getElementsByTagName('Items')[i].getAttribute("ID")==ExLocalID){
                        channel = req.responseXML.getElementsByTagName('Items')[i].getAttribute("NAME");
                        var iCount=0;
                        for(var j=0; j<req.responseXML.getElementsByTagName('Items')[i].getElementsByTagName('Item').length; j++) {
                            arItem[iCount] = new Array(2);
                            arItem[iCount][0] = getNodeValue(req.responseXML.getElementsByTagName('Items')[i].getElementsByTagName('Item')[j].getElementsByTagName('TVTime'));
                            arItem[iCount][1] = getNodeValue(req.responseXML.getElementsByTagName('Items')[i].getElementsByTagName('Item')[j].getElementsByTagName('Desc'));                                
                            iCount++;
                        }
                        
                        break;
                    }
                }
            }
            gmobj("iptv-channel").innerHTML=getIPTV(ExLocalID,sDate, channel, arItem);
            gmobj("iptv-channel").scrollTop=0;
        },
        'onError':function(req){gmobj("iptv-channel").innerHTML=req.statusText;}
    })
}

function getIPTV(ExLocalID,sDate, channel, arItem){    
    var sHTML = '';
    
    sHTML = sHTML.concat('<table border=0 cellpadding=0 cellspacing=3 width=100%>');
    sHTML = sHTML.concat('<tr height=20><td colspan=2 class="Time" style="padding-left:3;font-size:11px"><b>').concat(channel).concat(' (').concat(sDate).concat(')</b></td></tr>');
    sHTML = sHTML.concat('<tr height=1><td colspan=2 bgcolor="#666666"></td></tr>');
    if(arItem.length > 0){
        for(var i=0; i<arItem.length; i++){
            sHTML = sHTML.concat('<tr>');
            sHTML = sHTML.concat('<td style="padding-left:3; padding-right:5;" valign=top width=15 align=center class="Image" style="font: 11px arial;"><b>').concat(arItem[i][0]).concat('</b></td>');
            sHTML = sHTML.concat('<td valign=top class="Image" width="100%"><font color="#06175D"  style="font:11px arial;">').concat(arItem[i][1]).concat('</font></td>');
            sHTML = sHTML.concat('</tr>');
        }
    }
    else{
        sHTML = sHTML.concat('<tr>');
        sHTML = sHTML.concat('<td colspan=2 style="padding-left:3; padding-right:5;" valign=top align=left class="Image" style="font-size:11px"><font color="#06175D">Ch&#432;a c&#243; l&#7883;ch</font></td>');
        sHTML = sHTML.concat('</tr>');    
    }
    sHTML = sHTML.concat('</table>');    
    return sHTML;
}

