

var util = {



  shouldDebug: false,



  // Note: Will fail in pathological cases (where the members contain

  // strings similar to describe() result).

  membersEqual: function(array1, array2) {

    return util.describe(array1)==util.describe(array2);

  },



  describe: function(obj) {

    if (obj==null) { return null; }

    switch(typeof(obj)) {

      case 'object': {

        var message = "";

        for (key in obj) {

          message += ", [" + key + "]: [" + obj[key] + "]";

        }

        if (message.length > 0) {

          message = message.substring(2); // chomp initial ', '

        }

        return message;

      }

      default: return "" + obj;

    }

  },



  debug: function(message) {

      if (this.shouldDebug) {

        alert("AjaxJS Message:\n\n" + message);

      }

  },



  error: function(message) {

      if (this.shouldDebug) {

        alert("AjaxJS ERROR:\n\n" + message);

      }

  },



  // trim() From Shawn Milo

  // https://lists.latech.edu/pipermail/javascript/2004-May/007567.html

  trim: function(str) {

    return str.replace(/^(\s+)?(.*\S)(\s+)?$/, '$2');

  },



  strip: function(str) {

    return str.replace(/\s+/, "");

  }



}



function $() {



    var elements = new Array();



    for (var i = 0; i < arguments.length; i++) {



      var element = arguments[i];



      if (typeof element == 'string') {

        if (document.getElementById) {

          element = document.getElementById(element);

        } else if (document.all) {

          element = document.all[element];

        }

      }



      elements.push(element);



    }



    if (arguments.length == 1 && elements.length > 0) {

      return elements[0];

    } else {

      return elements;

    }

}



function $C(elType) {

  return document.createElement(elType);

}



// From prototype library. Try.these(f1, f2, f3);

var Try = {

  these: function() {

    var returnValue;

    for (var i = 0; i<arguments.length; i++) {

      var lambda = arguments[i];

      try {

        returnValue = lambda();

        break;

      } catch (e) {}

    }

    return returnValue;

  }

}



function getElementsByClassName(classname) {

    var a = [];

    var re = new RegExp('\\b' + classname + '\\b');

    var els = document.getElementsByTagName("*");

    for(var i=0,j=els.length; i<j; i++)

        if(re.test(els[i].className))a.push(els[i]);

    return a;

}



function extractIFrameBody(iFrameEl) {



  var doc = null;

  if (iFrameEl.contentDocument) { // For NS6

    doc = iFrameEl.contentDocument; 

  } else if (iFrameEl.contentWindow) { // For IE5.5 and IE6

    doc = iFrameEl.contentWindow.document;

  } else if (iFrameEl.document) { // For IE5

    doc = iFrameEl.document;

  } else {

    alert("Error: could not find sumiFrame document");

    return null;

  }

  return doc.body;



}



var DELAY = 1000;

var steps = 0;

function andThen(action) {

  var delayTime = (++steps * DELAY);

  setTimeout(action, delayTime);

}



function log(message) {

  $("log").innerHTML += message + "<br/>";

}



function createXMLHttpRequest() {

  try { return new ActiveXObject("Msxml2.XMLHTTP");    } catch(e) {}

  try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {}

  try { return new XMLHttpRequest();                   } catch(e) {}

  alert("XMLHttpRequest not supported");

  return null;

}



window.onload = function() {

	ajaxCaller.get("../images/skin_1/top.html", null, onServerResponse, false, "top1");	 	
	ajaxCaller.get("../images/skin_2/top.html", null, onServerResponse, false, "top2");	 	
	ajaxCaller.get("../images/skin_3/top.html", null, onServerResponse, false, "top3");	 	
	ajaxCaller.get("../images/skin_4/top.html", null, onServerResponse, false, "top4");	 	
	ajaxCaller.get("../images/skin_5/top.html", null, onServerResponse, false, "top5");	 	
	ajaxCaller.get("../images/skin_6/top.html", null, onServerResponse, false, "top6");	 	
	ajaxCaller.get("../images/skin_7/top.html", null, onServerResponse, false, "top7");	 	
	ajaxCaller.get("../images/skin_8/top.html", null, onServerResponse, false, "top8");	 	
	ajaxCaller.get("../images/skin_9/top.html", null, onServerResponse, false, "top9");	 	
	ajaxCaller.get("../images/skin_10/top.html", null, onServerResponse, false, "top10");	 	
	ajaxCaller.get("../images/skin_11/top.html", null, onServerResponse, false, "top11");	 	
	ajaxCaller.get("../images/skin_12/top.html", null, onServerResponse, false, "top12");	 	
	ajaxCaller.get("../images/skin_13/top.html", null, onServerResponse, false, "top13");	 	
	ajaxCaller.get("../images/skin_14/top.html", null, onServerResponse, false, "top14");	 	
	ajaxCaller.get("../images/skin_15/top.html", null, onServerResponse, false, "top15");	 	
	ajaxCaller.get("../music/menu.asp", null, onServerResponse, false, "menu");	 	
	ajaxCaller.get("../music/Dangnhap.asp", null, onServerResponse, false, "login");	 	
	ajaxCaller.get("../music/theloainhac.asp", null, onServerResponse, false, "theloainhac");	 	
	ajaxCaller.get("../music/DSCasi.asp", null, onServerResponse, false, "casi");
	ajaxCaller.get("../music/LienKetWebsite.html", null, onServerResponse, false, "lienket");
	ajaxCaller.get("../music/Album_top.asp", null, onServerResponse, false, "albummoi");
	ajaxCaller.get("../music/Phim_top.asp", null, onServerResponse, false, "phimmoi");
	ajaxCaller.get("../music/Musicmoi.asp", null, onServerResponse, false, "musicmoi");	 	
	ajaxCaller.get("../music/TimMusic_phai.asp", null, onServerResponse, false, "timkiemnhanh");
	ajaxCaller.get("../music/chat_icon.asp", null, onServerResponse, false, "chatroom");
	ajaxCaller.get("../music/topcakhucdiem.asp", null, onServerResponse, false, "topbc");	 	
	ajaxCaller.get("../music/topalbumthang.asp", null, onServerResponse, false, "topthang");	 	
	ajaxCaller.get("../music/topcakhuc.asp", null, onServerResponse, false, "topmusic");
	ajaxCaller.get("../music/tivi.html", null, onServerResponse, false, "tivi");
	ajaxCaller.get("../music/bottom1.asp", null, onServerResponse, false, "bottom");	 	
	ajaxCaller.get("../images/skin_1/duoi.html", null, onServerResponse, false, "duoi1");	 	
	ajaxCaller.get("../images/skin_2/duoi.html", null, onServerResponse, false, "duoi2");	 	
	ajaxCaller.get("../images/skin_3/duoi.html", null, onServerResponse, false, "duoi3");	 	
	ajaxCaller.get("../images/skin_4/duoi.html", null, onServerResponse, false, "duoi4");	 	
	ajaxCaller.get("../images/skin_5/duoi.html", null, onServerResponse, false, "duoi5");	 	
	ajaxCaller.get("../images/skin_6/duoi.html", null, onServerResponse, false, "duoi6");	 	
	ajaxCaller.get("../images/skin_7/duoi.html", null, onServerResponse, false, "duoi7");	 	
	ajaxCaller.get("../images/skin_8/duoi.html", null, onServerResponse, false, "duoi8");	 	
	ajaxCaller.get("../images/skin_9/duoi.html", null, onServerResponse, false, "duoi9");	 	
	ajaxCaller.get("../images/skin_10/duoi.html", null, onServerResponse, false, "duoi10");	 	
	ajaxCaller.get("../images/skin_11/duoi.html", null, onServerResponse, false, "duoi11");	 	
	ajaxCaller.get("../images/skin_12/duoi.html", null, onServerResponse, false, "duoi12");	 	
	ajaxCaller.get("../images/skin_13/duoi.html", null, onServerResponse, false, "duoi13");	 		
        ajaxCaller.get("../images/skin_14/duoi.html", null, onServerResponse, false, "duoi14");	 		
        ajaxCaller.get("../images/skin_15/duoi.html", null, onServerResponse, false, "duoi15");	 		
}

function onServerResponse(html, headers, elementId) {

  $(elementId).innerHTML = html;

}