var L = new Array; // on dom load
var R = new Array; // on window resize
var D = YAHOO.util.Dom;
var E = YAHOO.util.Event;

var Y = function (modules, cb) {
  var loader = new YAHOO.util.YUILoader ({
    require: modules,
    onSuccess: function () {
      for (var m in modules) Y.loaded[modules[m]] = true;
      if (cb) cb();
    },
    loadOptional: true,
    timeout: 10000,
    combine: true
  });
  loader.insert();
}
Y.loaded = {};

E.onDOMReady(function () { for (var i = 0; i < L.length; i++) L[i]() });

E.addListener(window, 'resize', function () {
  for (var i = 0; i < R.length; i++) R[i]()
});

L.push(function () {

	var adspot = document.getElementById('ad');
	if (! adspot) return true;

	adspot.parentNode.removeChild(adspot);
	return true;


	/*
	var goog;

	var s = document.getElementsByTagName('script');
	for (var i=0,S; S=s[i]; ++i) {
		if (S.src.match(/pagead2\.googlesyndication\.com\/pagead\/show_ads\.js/)) {
			goog = S;
			break;
		}
	}

	if (goog) adspot = goog;
	
	var p = document.createElement('p');

	var l = document.createElement('a');
	l.href = 'https://ssl.zoomshare.com/:6monthplus';
	
	var ad = new Image();
	ad.src = '/lib/img/templates/ad1.gif';
	ad.width = 468;
	ad.height = 60;
	ad.alt = 'ZS Cities';
	ad.border = 0;

	l.appendChild(ad);
	p.appendChild(l);

	adspot.parentNode.replaceChild(p, adspot);
	
	*/
	/*
	var frm = document.createElement("iframe");
	frm.setAttribute("src", "http://ads.zoomshare.com/ad.aspx");
	frm.setAttribute("frameborder", "0");
	frm.setAttribute("class", "test");
	frm.setAttribute("width", "470");
	frm.setAttribute("height", "62");
	frm.setAttribute("style", "display:block;margin-bottom:12px;overflow:hidden;border-width:0px;");
	frm.setAttribute("name", "adRotator");
	frm.setAttribute("id", "iFrameAdRotator");
	frm.setAttribute("scrolling", "no");
	frm.setAttribute("marginwidth", "0");
	frm.setAttribute("marginheight", "0");

	adspot.parentNode.replaceChild(frm, adspot);
	*/
});

