<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Filters and Transitions Interactive Demo</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>IMG {
BORDER-RIGHT: black 2px solid; BORDER-TOP: black 2px solid; BORDER-LEFT: black 2px solid; BORDER-BOTTOM: black 2px solid
}
BODY {
FONT-SIZE: 80%; BACKGROUND: white; MARGIN: 0px; FONT-FAMILY: verdana
}
.bar {
BORDER-TOP: #99ccff 1px solid; BACKGROUND: #336699; WIDTH: 100%; BORDER-BOTTOM: #000000 1px solid; HEIGHT: 30px
}
.desbar {
PADDING-RIGHT: 10px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 10px; FONT-SIZE: 8pt; BACKGROUND: #ffffff; PADDING-BOTTOM: 10px; WIDTH: 100%; COLOR: black; PADDING-TOP: 10px; BORDER-BOTTOM: #000000 1px solid
}
.title {
PADDING-LEFT: 10px; FONT-SIZE: 15pt; COLOR: white
}
PRE {
MARGIN: 0px
}
A:link {
COLOR: white; TEXT-DECORATION: none
}
A:visited {
COLOR: white; TEXT-DECORATION: none
}
A:active {
COLOR: white; TEXT-DECORATION: none
}
A:hover {
COLOR: yellow; TEXT-DECORATION: none
}
SELECT {
BORDER-RIGHT: 2px; BORDER-TOP: 2px; FONT-SIZE: 9pt; BORDER-LEFT: 2px; BORDER-BOTTOM: 2px
}
</STYLE>
<SCRIPT language=javascript>
var browserCapable = true; // Prevents errors on downlevel browsers
var startImage = "fruit.gif"; // /workshop/graphics/
var endImage = "mouse.gif";
var featuresHeader = "<B>Features:</B><BR>"
var sSinQut ="'";
var sRandomBarsOrientationText="";
function copy2Clipboard()
{
// Copy displayed code to user's clipboard.
var textRange = document.body.createTextRange();
textRange.moveToElementText(oCodeSpan);
textRange.execCommand("Copy");
}
function highlightText(whatToHighlight) {
var oRng = document.body.createTextRange();
oRng.moveToElementText(oCodePre);
oRng.execCommand("RemoveFormat");
var oHL = document.body.createTextRange();
oHL.moveToElementText(oCodePre);
oHL.findText(whatToHighlight);
oHL.execCommand("Bold");
}
function switchContent(obj) {
oContentHolder.innerHTML=obj.innerHTML;
oImg.src=startImage;
if (obj==filterSection){
changeFilter();
updateFilterCode();
}
else {
imgObjText.innerHTML = "<BR><b>First Page</b><BR><BR>Using the <B>apply</B> method prepares this SPAN element for content changes.";
changeTrans();
updateTransCode();
}
}
function getControlObject(controlName) {
var obj=null;
for (x=0; x < document.all(controlName).length; x++) {
objTemp = document.all(controlName,x);
if (objTemp.parentElement.isSource==null) {
obj=objTemp;
}
}
return(obj);
}
function disableControlObject(controlName) {
for (x=0; x < document.all(controlName).length; x++) {
document.all(controlName,x).disabled=true;
}
}
function enableControlObject(controlName) {
for (x=0; x < document.all(controlName).length; x++) {
document.all(controlName,x).disabled=false;
}
}
function changeFilter() {
var selectObject = getControlObject("oSelect");
var selectedValue = selectObject.options[selectObject.selectedIndex].value;
var transitionAsFilter = selectObject.options[selectObject.selectedIndex].TRANS;
imgObjText.innerHTML = "<BR>The image, dark red text, and sky blue background make up the content of the filtered SPAN.";
imgObj.style.backgroundColor='skyblue';
imgObj.style.color='darkred';
if (selectedValue != "empty") {
if (selectedValue.indexOf('AlphaImageLoader')!=-1) {
oControlsSpan.innerHTML = oAlphaImageLoaderControls.innerHTML;
alphaImageLoaderFilterChange();
}
else if (selectedValue.indexOf('Alpha')!=-1) {
oControlsSpan.innerHTML = oAlphaControls.innerHTML;
alphaFilterChange();
}
else if (selectedValue.indexOf('Emboss')!=-1) {
oControlsSpan.innerHTML = "";
embossFilterChange();
}
else if (selectedValue.indexOf('Engrave')!=-1) {
oControlsSpan.innerHTML = "";
engraveFilterChange();
}
else if (selectedValue.indexOf('Pixelate')!=-1) {
oControlsSpan.innerHTML = oPixelateFilterControls.innerHTML;
pixelateFilterChange();
}
else if (selectedValue.indexOf('DropShadow')!=-1) {
imgObj.style.backgroundColor='';
imgObjText.innerHTML = "<BR>The image, dark red text, and sky blue background make up the content of the filtered SPAN.";
oControlsSpan.innerHTML = oDropShadowControls.innerHTML;
dropShadowFilterChange();
}
else if (selectedValue.indexOf('Chroma')!=-1) {
oControlsSpan.innerHTML = oChromaControls.innerHTML;
chromaFilterChange();
}
else if (selectedValue.indexOf('BasicImage')!=-1) {
oControlsSpan.innerHTML = oBasicImageControls.innerHTML;
basicImageFilterChange();
}
else if (selectedValue.indexOf('Gradient')!=-1) {
oControlsSpan.innerHTML = oGradientControls.innerHTML;
gradientFilterChange();
}
else if (selectedValue.indexOf('Glow')!=-1) {
oControlsSpan.innerHTML = oGlowControls.innerHTML;
glowFilterChange();
}
else if (selectedValue.indexOf('MotionBlur')!=-1) {
oControlsSpan.innerHTML = oMotionBlurControls.innerHTML;
motionBlurFilterChange();
}
else if (selectedValue.indexOf('Shadow')!=-1) {
oControlsSpan.innerHTML = oShadowControls.innerHTML;
shadowFilterChange();
}
else if (selectedValue.indexOf('Wave')!=-1) {
oControlsSpan.innerHTML = oWaveControls.innerHTML;
waveFilterChange();
}
else if (selectedValue.indexOf('Blur')!=-1) {
imgObj.style.backgroundColor='';
imgObjText.innerHTML = "<BR>The image, dark red text, and sky blue background make up the content of the filtered SPAN.";
oControlsSpan.innerHTML = oBlurControls.innerHTML;
blurFilterChange();
}
else {
imgObj.style.filter=selectedValue;
oControlsSpan.innerHTML = '';
}
if (oControlsSpan.innerHTML!='') {
oControlsSpan.innerHTML = featuresHeader + oControlsSpan.innerHTML;
}
if (transitionAsFilter == "TRUE") {
oControlsSpan.innerHTML = oControlsSpan.innerHTML + oGlobalControls.innerHTML;
progressChange();
}
}
else {
imgObj.style.filter='';
oControlsSpan.innerHTML = featuresHeader + 'No filter is currently selected.';
}
updateFilterCode();
}
function updateFilterCode() {
oCodePre.innerText=imgObj.outerHTML;
}
function waveFilterChange(){
var cmd;
var controlObject = getControlObject("WaveFreqList");
var freq = controlObject.options[controlObject.selectedIndex].value;
controlObject = getControlObject("WaveLightStrengthList");
var lightStrength = controlObject.options[controlObject.selectedIndex].value;
controlObject = getControlObject("WavePhaseList");
var phase = controlObject.options[controlObject.selectedIndex].value;
controlObject = getControlObject("WaveStrengthList");
var strength = controlObject.options[controlObject.selectedIndex].value;
cmd = "imgObj.style.filter='progid:DXImageTransform.Microsoft.Wave(" ;
cmd = cmd + "freq=" + freq;
cmd = cmd + ",LightStrength=" + lightStrength;
cmd = cmd + ",Phase=" + phase;
cmd = cmd + ",Strength=" + strength;
cmd = cmd + ")'";
eval(cmd);
updateFilterCode();
highlightText(cmd);
}
function shadowFilterChange(){
var cmd;
var controlObject = getControlObjec