home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 February
/
CMCD0205.ISO
/
Software
/
Freeware
/
Comunicatii
/
slimbrow
/
sbsetup.exe
/
ScriptFilter.js
< prev
next >
Wrap
Text File
|
2003-12-16
|
2KB
|
84 lines
//AllFrames
function ScriptFilter(bFlash,bMovingObj,bBanner,bHideOnly)
{
mdoc=document;
var badobjs=new Array(3);
if (bFlash)
{
for(var i=0;i<mdoc.embeds.length;i++)
{
var obj=mdoc.embeds[i];
if (obj.attributes["type"].nodeValue.toLowerCase()=="application/x-shockwave-flash")
{
badobjs.push(obj);
}
}
}
var objs=document.all;
var l=objs.length;
for (i=0;i<l;i++)
{
var obj=objs[i];
try
{
if (bFlash && obj.tagName=="OBJECT" && obj.classid=="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000")
{
badobjs.push(obj);
}
}
catch(e)
{
}
try
{
if (bBanner && (obj.tagName=="IMG" || obj.tagName=="IFRAME"))
{
if (obj.width==468 && obj.height==60 ||
obj.width==728 && obj.height==90 ||
obj.width==234 && obj.height==60 ||
obj.width==88 && obj.height==31 ||
obj.width==120 && obj.height==90 ||
obj.width==120 && obj.height==60 ||
obj.width==125 && obj.height==125 ||
obj.width==120 && obj.height==240 ||
obj.width==180 && obj.height==150 ||
obj.width==300 && obj.height==250 ||
obj.width==336 && obj.height==280 ||
obj.width==240 && obj.height==400 ||
obj.width==250 && obj.height==250 ||
obj.width==120 && obj.height==600 ||
obj.width==160 && obj.height==600)
{
badobjs.push(obj);
}
}
}
catch(e)
{
}
try
{
if (bMovingObj && obj.style.position=="absolute" && obj.clientHeight<250 && obj.clientWidth<250)
{
badobjs.push(obj);
}
}
catch(e)
{
}
}
for (i=0;i<badobjs.length;i++)
{
try
{
if (bHideOnly) badobjs[i].style.visibility="hidden";
else badobjs[i].outerHTML="";
}
catch(e)
{
}
}
}