function initialisespecial() {

$$("div.dropdown").forEach(function(divEl) {
$(divEl).addEvent('mouseover', function(){$(this.parentNode.firstChild).addClass("hovered")});
$(divEl).addEvent('mouseout', function(){$(this.parentNode.firstChild).removeClass("hovered")});
});
}


function scalar(obj, str) {return obj.getElementsByTagName(str)[0].firstChild.nodeValue;}

var DataSet = new Class({
	cell: function(iRows, sCol) {
		return this.rows[iRows].get(sCol);
	},
	transform: function() {
		var arrRows = new Array();
		var dt = this.source.getElementsByTagName("Table");
		for (i=0; i<dt.length; i++) // rows
		{
			var hash = new Hash();
			for (j=0; j<dt[i].childNodes.length; j++)
			{
				if (dt[i].childNodes[j].nodeType != 3) // avoid whitespace (MOZ/SAF)
				{
				    try {
					    hash.set(dt[i].childNodes[j].nodeName, dt[i].childNodes[j].childNodes[0].nodeValue);
					} catch(e) {
					    hash.set(dt[i].childNodes[j].nodeName, "");
					}
				}
			}
			arrRows.push(hash);
		}
		
		return arrRows;
	},
	rowcount: function() {
		return this.rows.length;
	},
	initialize: function(oXml) {
		this.source = oXml;
		this.rows = this.transform();
	}
});

Element.extend({
	SelectedValue: function() { 
		if (this.nodeName.toLowerCase() == "select") {
			return this.options[this.selectedIndex].value;
		} else {
			return false;	
		}; 
	},
	SelectedLabel: function() {
		if (this.nodeName.toLowerCase() == "select") {
			return this.options[this.selectedIndex].text;
		} else {
			return false;	
		}; 
	},
	SelectedName: function() {
		if (this.nodeName.toLowerCase() == "select") {
			return this.options[this.selectedIndex].name;
		} else {
			return false;	
		}; 
	},
	SelectedId: function() {
		if (this.nodeName.toLowerCase() == "select") {
			return this.options[this.selectedIndex].id;
		} else {
			return false;	
		}; 
	},
	cleanWhitespace: function() {
        $A(this.childNodes).each(function(node){
            if ($type(node) == 'whitespace') {
                this.removeChild(node);
            }
        }, this);
        return this;
    }
});



//window.attachEvent("onbeforeunload", OnClose);

//function OnClose()
//{
//	event.returnValue = "Are you sure you want to close this window?";
//}
function filterInput(input){
	var filteredInput=input.replace(/&/g,'*amp*');
		filteredInput=filteredInput.replace(/\\/g,'\\\\\\\\');
		
	return filteredInput;	
	
}

function ec(value){
	var filtered=value.replace(/&/g,'@amp@');
		filtered=filtered.replace(/\\/g,'\\\\\\\\');
		filtered=filtered.replace(/\+/g,'@plus@');
	return filtered;
}
function dc(val){
	if (val != null) {
		var decode=val.replace(/@amp@/g, '&');
			decode=decode.replace(/@plus@/g, '+');
		return decode;
	}
}

