/*
*
*  Performas blend transformation
*
*  @application Complete Menu Solution
*  @author Ilya Lebedev <ilya@lebedev.net>
*  @copyright (c) 2006, Ilya Lebedev
*  @license Free for non-commercial use
*  @package CompleteMenuSolution
*  @title Blend transformation
*/
CompleteMenuSolution.prototype.transition.blend={init:function(i){if(!i.transitions.blend.start)i.transitions.blend.start=0;if(!i.transitions.blend.end)i.transitions.blend.end=1;if(!i.transitions.blend.useIeBlendFix)i.transitions.blend.useIeBlendFix=false;i.transitions.blend.end=i.transitions.blend.end-i.transitions.blend.start;var I=document.body;i.transitions.blend.attr=(I.style.opacity==null)?((I.style.MozOpacity==null)?((I.style.KhtmlOpacity==null)?'KhtmlOpacity':'OOpacity'):'MozOpacity'):'opacity'},doBlend:function(i,I,l,o){var O=I.transitions.blend.attr;var Q=I.transitions.blend.start;var _=I.transitions.blend.end;i.style[O]=Q+_*o;if(i.filters){if(I.transitions.blend.useIeBlendFix)i.filters.item('alpha').opacity=Math.round(Q*100+I.transitions.blend.maxIeOpac*o);else i.filters.item('alpha').opacity=Math.round(Number(i.style[O])*100);}if(i[l['interval']].pg==100){return false}return true},'initOpen':function(i,I,l,o){if(i.filters){if(I.transitions.blend.useIeBlendFix){if(!I.transitions.blend.maxIeOpac)I.transitions.blend.maxIeOpac=i.filters.item('alpha').opacity}if(i.style.filter.indexOf("alpha(")<0){i.style.filter="alpha(opacity=0);"}}this.doBlend(i,I,o,i[o['interval']].pg_delta);},'playOpen':function(i,I,l,o){return this.doBlend(i,I,o,i[o['interval']].pg_delta);},'finishOpen':function(i,I){var l=I.transitions.blend.attr;var o=I.transitions.blend.end;if(i.filters)if(I.transitions.blend.useIeBlendFix){i.filters.item('alpha').opacity=I.transitions.blend.maxIeOpac}else{i.style.filter=''}i.style[l]=o},'initClose':function(i,I,l,o){if(i.filters){if(I.transitions.blend.useIeBlendFix){if(!I.transitions.blend.maxIeOpac)I.transitions.blend.maxIeOpac=i.filters.item('alpha').opacity}if(i.style.filter.indexOf("alpha(")<0){i.style.filter="alpha(opacity=100);"}}this.doBlend(i,I,o,1-i[o['interval']].pg_delta);},'playClose':function(i,I,l,o){return this.doBlend(i,I,o,1-i[o['interval']].pg_delta);},'finishClose':function(i,I){var l=I.transitions.blend.attr;var o=I.transitions.blend.start;if(i.filters)if(I.transitions.blend.useIeBlendFix){i.filters.item('alpha').opacity=I.transitions.blend.maxIeOpac}else{i.style.filter=''}i.style[l]=o}};
