function checkEvent(oEvt){
	oEvt=(oEvt) ? oEvt : ( (window.event) ? window.event : null );
	if(oEvt && oEvt.srcElement && !window.opera)
		oEvt.target=oEvt.srcElement;
	return oEvt;
}


function cancelEvent(evt){
	if((evt=checkEvent(evt))){
		evt.cancelBubble=true;
		if(evt.cancelable){
			evt.preventDefault();
			evt.stopPropagation();
		}
	}
	return false;
}

function getAbsolutePos(oElem){
	var _x=0;
	var _y=0;
	if(oElem){
		do{
			_x+=oElem.offsetLeft;
			_y+=oElem.offsetTop;
		}while( (oElem=oElem.offsetParent) )
	}
	
	return {x: _x, y: _y};
}

function getDescendantByClassName(oElem, sTagName, sClassName) {
	for (var iDivIdx = 0; (oDiv = oElem.getElementsByTagName(sTagName)[iDivIdx]); iDivIdx++)
		if (cmnMatch_class(oDiv, sClassName)) return oDiv;
	return null;
}


var id = new Date().getTime();

// *** proxy ***
var flash_proxy = new SWFObject("/flash/point/proxy.swf", "proxy_obj", "1", "1", 8, "#FFFFFF");
flash_proxy.addParam("allowScriptAccess", "always");
flash_proxy.addVariable("flashvars_id", id);

// Отправить команду флешу
function SendCommandToFlash(sProxy, sArgs){
	if(window.flash_proxy){
		flash_proxy.addVariable("flashvars_args", sArgs);
		flash_proxy.write("flash_proxy_" + sProxy);
	}
}