Forum Moderators: not2easy

Message Too Old, No Replies

CSS Genius to Glance my CSS Simple Query

It might be as simple as apple pie...?

         

stealth_eos

8:20 am on Jan 15, 2004 (gmt 0)

10+ Year Member



I need a CSS Genius to give me a hint of what the following code means in easy terms...I don't know how it appeared on my site but it originated with Adobe Go Live...Site works well but this is still a mystery...I don't know how complex it is to figure out or easy so I apologize in advance...I'm learning everything from scratch on my own. And this is on every page..?
Should I delete it or not worry...

?

<csscriptdict>
<script type="text/javascript"><!--
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 CSURLPopupShow(formName, popupName, target) {
var form = (!IsIE()&&CSBVers>=5)?document.forms[formName]:CSFindElement(formName);
var popup = form.elements[popupName];
window.open(popup.options[popup.selectedIndex].value, target);
popup.selectedIndex = 0;
}

// --></script>

benihana

9:35 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



it might be worth heading over to the javascript forum [webmasterworld.com] to get a good insight into the function of this script.

ben

piskie

9:51 am on Jan 15, 2004 (gmt 0)

10+ Year Member



I am no CSS expert but on the face of it 'Adobe Go Live' has made it so that CSS will not function on a site with Javascript dissabled.

mep00

10:06 am on Jan 15, 2004 (gmt 0)

10+ Year Member



While I'm no CSS genius (maybe by next week ;)), what you have there isn't CSS. What you seem to have--and hard to follow, espcialy without the call--is a routine which opens a popup window base on which popup was selected by the user to open in a particular form. Most of the mess seems to be for the case of a pre version 5 browser which isn't MSIE.

In other words, your "apple pie" is really a hamburger.

This reminds me of one of those challanges where you're given some crypictic c or apl code and you need to figure out what it does. So, do I win a prise? :D

stealth_eos

6:55 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



Thanks for all your help...
I don't know what it means but I hate pop-ups
and if it might trigger something like that...
I'd rather delete it...and see what happens...
It was worth a try.

It's also made a folder names "Generated Items"
and since I didn't know what it was I also uploaded
that to the ftp site...hmmm......DELETE...hehe

mep00

9:17 pm on Jan 15, 2004 (gmt 0)

10+ Year Member



...I hate pop-ups and if it might trigger....
It looks--though I can't tell without seeing the more of the source--like a user requested popup, which is very different from automatic popups. One adds functionality, the other reduces functionality.