Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can anyone tell me what function this piece of code performs?

    I don't know anything about Javascript. My brother-in-law wanted me to update some pictures on his website. I found a piece of javascript code and am curious as to what it's function would be. Could someone please tell me what this piece of code is doing / what it's being used for. Thanks in advance.

    Here's the code:

    Code:
    
    		<csscriptdict>
    			<script><!--
    function CSClickReturn () {
    	var bAgent = window.navigator.userAgent; 
    	var bAppName = window.navigator.appName;
    	if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
    		return true; // dont follow link
    	else return false; // dont follow link
    }
    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 actArray = fct[array[i]];
    		if(actArray == null) return false; 
    
    		var tempArray = new Array;
    		for(var j=1;j<actArray.length;j++) {
    			if((actArray[j] != null) && (typeof(actArray[j]) == "object") && (actArray[j].length == 2)) {
    				if(actArray[j][0] == "VAR") {
    					tempArray[j] = CSStateArray[actArray[j][1]];
    				}
    				else {
    					if(actArray[j][0] == "ACT") {
    						tempArray[j] = CSAction(new Array(new String(actArray[j][1])));
    					}
    				else
    					tempArray[j] = actArray[j];
    				}
    			}
    			else
    				tempArray[j] = actArray[j];
    		}			
    		result = actArray[0](tempArray);
    	}
    	return result;
    }
    CSAct = new Object;
    CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
    function IsIE() { return CSAg.indexOf("MSIE") > 0;}
    function CSIEStyl(s) { return document.all.tags("div")[s].style; }
    function CSNSStyl(s) { return CSFindElement(s,0); }
    function CSFindElement(n,ly) { if (CSBVers < 4) return document[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 CSSetImageURL(action) {
    	var img = null;
    	if (document.images) {
    		if (!IsIE()) img = CSFindElement(action[1],0);
    		else img = document.images[action[1]];
    		if (img) img.src = action[2];
    	}
    }function CSGotoLink(action) {
    	if (action[2].length) {
    		var hasFrame=false;
    		for(i=0;i<parent.frames.length;i++) { if (parent.frames[i].name==action[2]) { hasFrame=true; break;}}
    		if (hasFrame==true)
    			parent.frames[action[2]].location = action[1];
    		else
    			window.open (action[1],action[2],"");
    	}
    	else location = action[1];
    }
    // --></script>
    		</csscriptdict>
    		<csactiondict>
    			<script><!--
    CSAct[/*CMP*/ 'B52BCE950'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/geebee.jpg');
    CSAct[/*CMP*/ 'B527CA9F3'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/cutline.gif');
    CSAct[/*CMP*/ 'B527CAD04'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/f-4.jpg');
    CSAct[/*CMP*/ 'B527CAE85'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/cutline.gif');
    CSAct[/*CMP*/ 'B527CBCF6'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/boeing-314.jpg');
    CSAct[/*CMP*/ 'B527CBEF7'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/cutline.gif');
    CSAct[/*CMP*/ 'B527CC588'] = new Array(CSGotoLink,/*URL*/ 'goldenage.htm','');
    CSAct[/*CMP*/ 'B527CD869'] = new Array(CSGotoLink,/*URL*/ 'aboutus.html','');
    CSAct[/*CMP*/ 'B527D7110'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/HE-111.jpg');
    CSAct[/*CMP*/ 'B527D7281'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/cutline.gif');
    CSAct[/*CMP*/ 'B527D73B2'] = new Array(CSGotoLink,/*URL*/ 'wwiiidmodels.htm','');
    CSAct[/*CMP*/ 'B527D75D3'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/lancaster.jpg');
    CSAct[/*CMP*/ 'B527D77E4'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/cutline.gif');
    CSAct[/*CMP*/ 'B527D7895'] = new Array(CSGotoLink,/*URL*/ 'wwiiexpert.htm','');
    CSAct[/*CMP*/ 'B527D9120'] = new Array(CSGotoLink,/*URL*/ 'modeler.html','');
    CSAct[/*CMP*/ 'B527D9291'] = new Array(CSGotoLink,/*URL*/ 'faq.html','');
    CSAct[/*CMP*/ 'B527D9372'] = new Array(CSGotoLink,/*URL*/ 'contact.html','');
    CSAct[/*CMP*/ 'B527D94A3'] = new Array(CSGotoLink,/*URL*/ 'custom.htm','');
    CSAct[/*CMP*/ 'B527D96E5'] = new Array(CSGotoLink,/*URL*/ 'seaplanes.htm','');
    CSAct[/*CMP*/ 'B52D133826'] = new Array(CSGotoLink,/*URL*/ 'postwarmodels.htm','');
    CSAct[/*CMP*/ 'B530F9380'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/F-104.jpg');
    CSAct[/*CMP*/ 'B530F9501'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/cutline.gif');
    
    // --></script>
    
    		</csactiondict>
    Here's the website that it's on: http://www.aircraftmodels.com/index.htm

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    A glance at Google (always the first stop when researching anything) suggests it's associated with Adobe GoLive. No idea what that is. It looks like there's some browser detection code in there, though.
    Are you a Help Vampire?

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    By looking at the site each entry
    Code:
    CSAct[/*CMP*/ 'B52BCE950'] = new Array(CSSetImageURL,/*CMP*/ 'cac logo',/*URL*/ 'Images/components/geebee.jpg');
    represents a different image with it's own link etc.

  • #4
    New Coder
    Join Date
    Jan 2009
    Posts
    56
    Thanks
    4
    Thanked 9 Times in 9 Posts
    removed due to rethink
    Last edited by Damo; 10-22-2009 at 01:35 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •