

function checkEvent(oEvt){
	oEvt=(oEvt) ? oEvt : ( (window.event) ? window.event : null );
	if(oEvt && oEvt.srcElement && !window.opera)
		oEvt.target=oEvt.srcElement;
	if(oEvt){
		if(oEvt.wheelDelta){
			oEvt.mouse_wheel_delta=oEvt.wheelDelta/120;
			if(window.opera)
	        	oEvt.mouse_wheel_delta*=-1;
		}
		else if(oEvt.detail){
	    	oEvt.mouse_wheel_delta = -oEvt.detail/3;
		}
	}
	return oEvt;
}
function CancelEvent(evt){
	if((evt=checkEvent(evt))){
		evt.cancelBubble=true;
		if(evt.cancelable){	evt.preventDefault();evt.stopPropagation();
		}
	}
	return false;
}
function addEvent(objElement, strEventType, ptrEventFunc) {
	if (objElement.addEventListener)
		objElement.addEventListener(strEventType, ptrEventFunc, false);
	else if (objElement.attachEvent)
		objElement.attachEvent('on' + strEventType, ptrEventFunc);
}
function removeEvent(objElement, strEventType, ptrEventFunc) {
	if (objElement.removeEventListener) objElement.removeEventListener(strEventType, ptrEventFunc, false);
		else if (objElement.detachEvent) objElement.detachEvent('on' + strEventType, ptrEventFunc);
}
function AllowMouseScroll(){return (document.body.clientHeight == elemContainer.offsetHeight);}
function MouseWheelCallback(evt){
	if((evt=checkEvent(evt)) /*&& AllowMouseScroll()*/){
		if(evt.mouse_wheel_delta > 0) {
			dedect_feedback();
		}
		else {
			dedect_foreword();
		}
	}
}
addEvent(document, 'mousewheel', MouseWheelCallback);
addEvent(document, 'DOMMouseScroll', MouseWheelCallback);




