var httpRequestS;
var specials = new Array();

function onLoad() {
	var pTags = document.getElementsByTagName('P');
	if (pTags) {
		for (i = 0; i < pTags.length; i++) {
			if (pTags[i].getAttribute('class') == 'special') {
				for (var j = 0; j < pTags[i].childNodes.length; j++) {
					var element = pTags[i].childNodes[j];
					if (element.tagName == 'A') {
						var href = element.getAttribute('href').split('#');
						specials.push(new deszt(pTags[i], href[1]));
					}
				}
			}
		}
	}
	if (specials) {
		getSpecials();
	}
}

function deszt(obj, desztkey) {
	this.obj      = obj;
	this.desztkey = desztkey;
}


function getSpecials() {
	httpRequestS = createXmlHttp();
	if (httpRequestS) {
		httpRequestS.open('get', 'specials.php', true);
		httpRequestS.onreadystatechange = httpGetSpecials;
		httpRequestS.send(null);
	}
}

function httpGetSpecials() {
	if (httpRequestS.readyState == 4) {
		var responseText = httpRequestS.responseText.replace(/\r/g, '');
		responseText     = responseText.replace(/\n$/, '');
		var specialList = responseText.split('\n');
		for (var i = 0; i < specialList.length; i++) {
			for (var j = 0; j < specials.length; j++) {
				if (specials[j].desztkey == specialList[i]) {
					specials[j].obj.style.visibility = 'visible';
					break;
				}
			}
		}
	}
}

