/    Sign up×
Community /Pin to ProfileBookmark

Help with stopping script by browser type

I am in a deadline crunch. I have a page with three flyout windows that were created in GoLive using hidden layers and javascript. All work well. My goal is to stop the script from running on any browser except ie6 for windows. I have created a very simple copy of the page with just one layer, and of course the code. I am to new at this and get overwhelmed by the huge amount of code and would be grateful for someone to provide the code so I can insert it into the real script file.
Thanks
Here is the code

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

<html>

<head>
<meta http-equiv=”content-type” content=”text/html;charset=iso-8859-1″>
<meta name=”generator” content=”Adobe GoLive”>
<title>Untitled Page</title>
<style type=”text/css” media=”screen”><!–

#layer1 { visibility: visible; position: absolute; top: 18px; left: 18px; width: 100px; height: 100px }
–></style>
<csactions>
<csaction name=”BFCE22FC1″ class=”ShowHide” type=”onevent” val0=”layer1″ val1=”1″></csaction>
</csactions>
<csscriptdict>
<script type=”text/javascript”><!–
CSStopExecution=false;
function CSAction(array) {return CSAction2(CSAct, array);}
function CSAction2(fct, array) {
var result;
for (var i=0;i<array.length;i++) {
if(CSStopExecution) return false;
var aa = fct[array[i]];
if (aa == null) return false;
var ta = new Array;
for(var j=1;j<aa.length;j++) {
if((aa[j]!=null)&&(typeof(aa[j])==”object”)&&(aa[j].length==2)){
if(aa[j][0]==”VAR”){ta[j]=CSStateArray[aa[j][1]];}
else{if(aa[j][0]==”ACT”){ta[j]=CSAction(new Array(new String(aa[j][1])));}
else ta[j]=aa[j];}
} else ta[j]=aa[j];
}
result=aa[0](ta);
}
return result;
}
CSAct = new Object;
CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf(“/”)+1),10);
CSIsW3CDOM = ((document.getElementById) && !(IsIE()&&CSBVers<6)) ? true : false;
function IsIE() { return CSAg.indexOf(“MSIE”) > 0;}
function CSIEStyl(s) { return document.all.tags(“div”)[s].style; }
function CSNSStyl(s) { if (CSIsW3CDOM) return document.getElementById(s).style; else return CSFindElement(s,0); }
CSIImg=false;
function CSInitImgID() {if (!CSIImg && document.images) { for (var i=0; i<document.images.length; i++) { if (!document.images[i].id) document.images[i].id=document.images[i].name; } CSIImg = true;}}
function CSFindElement(n,ly) { if (CSBVers<4) return document[n];
if (CSIsW3CDOM) {CSInitImgID();return(document.getElementById(n));}
var curDoc = ly?ly.document:document; var elem = curDoc[n];
if (!elem) {for (var i=0;i<curDoc.layers.length;i++) {elem=CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
return elem;
}
function CSGetImage(n) {if(document.images) {return ((!IsIE()&&CSBVers<5)?CSFindElement(n,0):document.images[n]);} else {return null;}}
CSDInit=false;
function CSIDOM() { if (CSDInit)return; CSDInit=true; if(document.getElementsByTagName) {var n = document.getElementsByTagName(‘DIV’); for (var i=0;i<n.length;i++) {CSICSS2Prop(n[i].id);}}}
function CSICSS2Prop(id) { var n = document.getElementsByTagName(‘STYLE’);for (var i=0;i<n.length;i++) { var cn = n[i].childNodes; for (var j=0;j<cn.length;j++) { CSSetCSS2Props(CSFetchStyle(cn[j].data, id),id); }}}
function CSFetchStyle(sc, id) {
var s=sc; while(s.indexOf(“#”)!=-1) { s=s.substring(s.indexOf(“#”)+1,sc.length); if (s.substring(0,s.indexOf(“{“)).toUpperCase().indexOf(id.toUpperCase())!=-1) return(s.substring(s.indexOf(“{“)+1,s.indexOf(“}”)));}
return “”;
}
function CSGetStyleAttrValue (si, id) {
var s=si.toUpperCase();
var myID=id.toUpperCase()+”:”;
var id1=s.indexOf(myID);
if (id1==-1) return “”;
s=s.substring(id1+myID.length+1,si.length);
var id2=s.indexOf(“;”);
return ((id2==-1)?s:s.substring(0,id2));
}
function CSSetCSS2Props(si, id) {
var el=document.getElementById(id);
if (el==null) return;
var style=document.getElementById(id).style;
if (style) {
if (style.left==””) style.left=CSGetStyleAttrValue(si,”left”);
if (style.top==””) style.top=CSGetStyleAttrValue(si,”top”);
if (style.width==””) style.width=CSGetStyleAttrValue(si,”width”);
if (style.height==””) style.height=CSGetStyleAttrValue(si,”height”);
if (style.visibility==””) style.visibility=CSGetStyleAttrValue(si,”visibility”);
if (style.zIndex==””) style.zIndex=CSGetStyleAttrValue(si,”z-index”);
}
}
function CSSetStyleVis(s,v) {
if (CSIsW3CDOM){CSIDOM();document.getElementById(s).style.visibility=(v==0)?”hidden”:”visible”;}
else if(IsIE())CSIEStyl(s).visibility=(v==0)?”hidden”:”visible”;
else CSNSStyl(s).visibility=(v==0)?’hide’:’show’;
}
function CSGetStyleVis(s) {
if (CSIsW3CDOM) {CSIDOM();return(document.getElementById(s).style.visibility==”hidden”)?0:1;}
else if(IsIE())return(CSIEStyl(s).visibility==”hidden”)?0:1;
else return(CSNSStyl(s).visibility==’hide’)?0:1;
}
function CSShowHide(action) {
if (action[1] == ”) return;
var type=action[2];
if(type==0) CSSetStyleVis(action[1],0);
else if(type==1) CSSetStyleVis(action[1],1);
else if(type==2) {
if (CSGetStyleVis(action[1]) == 0) CSSetStyleVis(action[1],1);
else CSSetStyleVis(action[1],0);
}
}

// –></script>
</csscriptdict>
<csactiondict>
<script type=”text/javascript”><!–
CSAct[/*CMP*/ ‘BFCE22FC1’] = new Array(CSShowHide,/*CMP*/ ‘layer1’,1);

// –></script>
</csactiondict>
</head>

<body bgcolor=”#ffffff”>
<div id=”layer1″ onmouseover=”CSAction(new Array(/*CMP*/’BFCE22FC1′));return true;” csover=”BFCE22FC1″></div>
<table width=”201″ border=”0″ cellspacing=”0″ cellpadding=”0″ cool gridx=”16″ gridy=”16″ height=”201″ showgridx showgridy usegridx usegridy>
<tr height=”200″>
<td width=”200″ height=”200″></td>
<td width=”1″ height=”200″><spacer type=”block” width=”1″ height=”200″></td>
</tr>
<tr height=”1″ cntrlrow>
<td width=”200″ height=”1″><spacer type=”block” width=”200″ height=”1″></td>
<td width=”1″ height=”1″></td>
</tr>
</table>
<p></p>
</body>

</html>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangDec 21.2005 — Place the script within [URL=http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp]conditional comments[/URL] &lt;!--[if IE 6]&gt;
&lt;script type="text/javascript"&gt;
// all relevant IE6 JavaScript here
&lt;/script&gt;
&lt;![endif]--&gt;
Copy linkTweet thisAlerts:
@OombongoDec 21.2005 — I always wonder that why JavaScript is not standarized. MS has their own functions, Netscape have their own. And we developers are in the middle.
×

Success!

Help @prs2 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...