<!--

var ajaxPG = false; // global ajax object
var ajaxPH = false; 

if (top.location != self.location) { top.location.replace(self.location); }
window.onload=function(){ initpage(); }


function initpage() {
// Attach javascript functions in first form
var n,p;
	p = getID("link0");                                            
	if (p) p.onclick=function(){ loadpage('http://dnsasia.com'); return false; };

	if (javaloader) for (n = 1; n < 50; n++) {
		s = "link"+n;
		p = getID(s);                                            
		if (p) p.onclick=function(){ loadpage(this); return false; };
		}

	if (typeof preloading == 'function') preloading();
}


function popularX (x,df,hno) {
var n = df;
var p = getID("popular");
if (p) n = Math.round((p.clientWidth / x));
if (n <= df) return false;
var r = getID("PHtxt").innerHTML;
var h = getID("PHhno").title;
var url="ajaxpopular.php";
url=url+"?x="+n;
url=url+"&r="+r;
url=url+"&h="+h + ',' + hno;
url=url+"&sid="+Math.random();
ajaxPH=GetXmlHttpObject(); if (ajaxPH==null) { alert("AJAX required!"); return; }
ajaxPH.onreadystatechange=ajax_popular;
ajaxPH.open("GET",url,true);
ajaxPH.send(null);
}

function ajax_popular() 
{ 
if (ajaxPH.readyState==4 || ajaxPH.readyState=="complete")
   {
   if (ajaxPH.status != 200) { alert(ajaxPH.status + '  ' + ajaxPH.statusText); return false; }
//  var xmldoc = ajaxMX.responseXML.documentElement;
//  var xmlobj = xmldoc.getElementsByTagName('errtext')[0].firstChild;
//  getID("emresult").innerHTML = xmlobj.data;
    getID("popular").innerHTML = ajaxPH.responseText;
   }
} 


function img_over(imgID, img_src) { 
	var p = document.getElementById(imgID);
	if (p) p.src = img_src; 
} 


function showloc (sid) {
var i,p;
	for (i=0; i < locmap.length; i++) {
		p = document.getElementById(locmap[i]);
		if (p) p.className = 'hidden'; 
	}
	p = document.getElementById(sid);
	if (p) p.className = 'shown'; 
	return false;
}

function showinfobox (sid) {
var i,p;
	for (i=0; i < infobox.length; i++) {
		p = document.getElementById(infobox[i]);
		if (p) p.className = 'taboff'; 
		p = document.getElementById(infobox[i]+'box');
		if (p) p.className = 'hidden'; 
	}
	p = document.getElementById(sid);
	if (p) p.className = 'tabon'; 
	p = document.getElementById(sid+'box');
	if (p) p.className = 'shown'; 
	return false;
}

function showpanels (sid,arr) {
var i,p;
	for (i=0; i < arr.length; i++) {
		p = document.getElementById(arr[i]);
		if (p) p.className = 'taboff'; 
		p = document.getElementById(arr[i]+'box');
		if (p) p.className = 'hidden'; 
	}
	p = document.getElementById(sid);
	if (p) p.className = 'tabon'; 
	p = document.getElementById(sid+'box');
	if (p) p.className = 'shown'; 
	return false;
}

var defFont = 10;
function txtFont (mode) {
var p,f;
var p = document.getElementById('thepage');
	if (mode == 1 && defFont < 20) defFont = defFont + 1;
	if (mode > 1) defFont = mode;
	if (mode == -1 && defFont > 6) defFont = defFont - 1;
	if (p) p.style.fontSize = defFont + "pt"; 
	return true;
}

function R24feature (region, n, height) {
	var pp = document.getElementById('PHPon');
	var ss = '<iframe id="R24" src="http://th.th66.com/R24feature.php?r=' + region + '&amp;l=' + n + '" frameborder="0" marginheight="0" marginwidth="0" name="R24" scrolling="no" style="border-style: none; height: ' + height + ';" width="125"></iframe>';
	var p = document.getElementById('right');
	if (p && !pp) p.innerHTML = ss; 
}

function loadpage(link)
{
// alert(link);
if (link.length==0) return; 
var p = getID("thepage");
if (!p) return;
p.innerHTML = "<br>Loading page...<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";
var url="ajaxloader.php";
url=url+"?url="+encodeURIComponent(link);
url=url+"&sid="+Math.random();
ajaxPG=GetXmlHttpObject(); if (ajaxPG==null) { alert("AJAX required!"); return; }
ajaxPG.onreadystatechange=ajax_loaded;
ajaxPG.open("GET",url,true);
ajaxPG.send(null);
}

function ajax_loaded() 
{ 
if (ajaxPG.readyState==4 || ajaxPG.readyState=="complete")
   {
   if (ajaxPG.status != 200) { alert(ajaxPG.status + '  ' + ajaxPG.statusText); return false; }
//  var xmldoc = ajaxMX.responseXML.documentElement;
//  var xmlobj = xmldoc.getElementsByTagName('errtext')[0].firstChild;
//  getID("emresult").innerHTML = xmlobj.data;
    getID("thepage").innerHTML = ajaxPG.responseText;
   }
} 


// ========================== create the AJAX-Object
function GetXmlHttpObject() {
 var crossxhr = false;
 if (window.XMLHttpRequest) {         // Firefox, Opera 8.0+, Safari
    crossxhr = new XMLHttpRequest();
    if (crossxhr.overrideMimeType) { crossxhr.overrideMimeType('text/xml'); }
 } else if (window.ActiveXObject) {   // Internet Explorer 
  try {
   crossxhr = new ActiveXObject('Msxml2.XMLHTTP');
  } catch(e) {
   try {
    crossxhr = new ActiveXObject('Microsoft.XMLHTTP');
   } catch(e) {
    crossxhr = false;
   }
  }
 }
 return crossxhr;
}


// ========================== 
function getID(divID) {
    if( document.getElementById ) { //DOM; IE5, NS6, Mozilla, Opera
        return document.getElementById(divID); }
    if( document.all ) { //Proprietary DOM; IE4
        return document.all[divID]; }
    if( document.layers ) { //Netscape layers
        return document.layers[divID]; }
    if( document[divID] ) { //Netscape alternative
        return document[divID]; }
    return false;
}


function rounding(rnum,dec) {
	var rlength = dec;  // The number of decimal places to round to
	if (rnum > 8191 && rnum < 10485) {
		rnum = rnum-5000;
		var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
		newnumber = newnumber+5000;
	} else {
		var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
	}
	return newnumber;
}

//-->
