

function _disableOption(disable) {
	var isIE/*@cc_on=1@*/;

	this.disabled = disable;

	if(isIE) {
		if(disable)
			this.style.color = 'gray';
		else
			this.style.color = '';
	}
}

var isIE/*@cc_on=1@*/;

if(!isIE)
	Option.prototype.disableOption = _disableOption;



_bcse_ready = function () {

	var allSelectsJQ = $('select');
	allSelectsJQ.each( function (index,element) {
		element.oldValueIndex = element.selectedIndex;
	
	});

	allSelectsJQ.change( function (event) {
		var selectObj = event.currentTarget;

		if(selectObj.options[selectObj.selectedIndex].disabled) {
			selectObj.selectedIndex = selectObj.oldValueIndex;
		} else {
			selectObj.oldValueIndex = selectObj.selectedIndex;
		}
	});


}

if(isIE) 
	window.attachEvent('onload',_bcse_ready);
else
	window.addEventListener('load',_bcse_ready,false);



