[Patterns]
Name = "JS: Toggle Flash - Patch SWFObject 09.05.24 (ccw!) [sd] (d.1 l.2)"
Active = TRUE
URL = "$TYPE(js)(^$TST(keyword=*.(a_flash|i_level:1).*))"
Limit = 128
Match = ".parentNode.replaceChild\(("
"o,el\);(^(^}}}+ function createObjParam\(el,))$SET(1=o)$SET(2=el)$SET(4=beta)$SET(6=embedSWF)"
"|pExperienceElement, (pExperience)\2\)$SET(1=pExperienceElement)$SET(4=Brightcove)$SET(6=\4)"
"|([a-z][a-z]+)\1, ([a-z][a-z]+)\2\);"
"( ([a-z][a-z]+)\4=$TST(\1) ;+)\3(^(^ }( })+ return $TST(\4) ;+ }))$SET(6=embedSWF)"
")"
"$STOP("
"The 1st expression tests for SWFObject 2.0 Betas specifically."
"The 2nd expression tests for Brightcove Experience specifically."
"The 3rd expression does a fuzzy search for:"
"SWFObject 2.0 RC (o,el,r), 2.0 (s,t,p), 2.1 (u,v,q), and up."
")"
"&($TST(displayM=none)$SET(5=inline)|$SET(5=none))"
"&($TST(volat=*.log:2*)$ADDLST(Log-Main,[$DTM(d T)]\tWEB embedSWF\t\1,\2,\4 \t\u Ref: $GET(hOrigRef))|)"
"&((^$TST((\1,\2,\4)=o,el,r|s,t,p|u,v,q))"
"$TST(volat=*.log:[12]*)$ADDLST(Log-Rare,WEB embedSWF\t\1,\2,\4 \t\u Ref: $GET(hOrigRef))|)"
Replace = ".foo=null;var prxSo=document.createElement("span");"
"prxSo.className="ProxFlash";prxSo.style.display="$GET(displayM)";"
"var prxSp=document.createElement("span");"
"prxSp.className="ProxFlash ProxToggle";prxSp.style.display="\5";"
"prxSp.innerHTML="ToggleFlash ";"
"prxSo.appendChild(\1);\2.parentNode.replaceChild(prxSo,\2);"
"prxSo.parentNode.insertBefore(prxSp,prxSo);\3"