PDA

View Full Version : Interesting Website Code I Found



grichards
12-09-2003, 07:15 AM
Hi all,

I'm new to search engine optimisation, but I came across a site the other day and looked in the source code to see why they had such a high ranking. This was in the source code on the page - any ideas what this script does? I think I've seen it from Adobe GoLive, but I'm just making sure.

It looks as if it could be something todo with gotoast.com but I don't know too much about javascript, so any insights on this code would be great.

They also use a <noscript> further down the page which contains about four paragraphs of writing with intermittent keywords placed within the paragraphs and bold highlighted. They don't even make sense within the paragraphs. Shouldn't they be penalised for this tactic.

Plus they use a bgcolor of 000099 and then in the <noscript> section they use the color: 03039B which is the same colour as 000099. So the text is hidden. Doesn't google pick up on this?

Sorry if I'm asking so many questions, I'm new to optimisation but have learnt a lot from this websitepublisher - this site is incredible Chris! Thanks for all the hard work.

The code I found is below:

<csscriptdict>
<script><!--
CSInit = new Array;
function CSScriptInit() {
if(typeof(skipPage) != "undefined") { if(skipPage) return; }
idxArray = new Array;
for(var i=0;i<CSInit.length;i++)
idxArray[i] = i;
CSAction2(CSInit, idxArray);}
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 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
}

function CSButtonReturn () {
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 false; // follow link
else return true; // follow link
}

CSIm = new Object();
function CSIShow(n,i) {
if (document.images) {
if (CSIm[n]) {
var img = (!IsIE()) ? CSFindElement(n,0) : document[n];
if (img && typeof(CSIm[n][i].src) != "undefined") {img.src = CSIm[n][i].src;}
if(i != 0)
self.status = CSIm[n][3];
else
self.status = " ";
return true;
}
}
return false;
}
function CSILoad(action) {
im = action[1];
if (document.images) {
CSIm[im] = new Object();
for (var i=2;i<5;i++) {
if (action[i] != '') { CSIm[im][i-2] = new Image(); CSIm[im][i-2].src = action[i]; }
else CSIm[im][i-2] = 0;
}
CSIm[im][3] = action[5];
}
}
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;


// --></script>
</csscriptdict>
<csactiondict>
<script><!--
CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'button',/*URL*/images/enter.gif',/*URL*/'images/enter_o.gif',/*URL*/'','Enter here');

// --></script>
</csactiondict>
<script language="javascript" src="http://roi.gotoast.com/roi/track.asp?ROIID=3433342"></script>
<script language="javascript">
<!--
if (typeof(ROIID) + '' != 'undefined')
{
TrackEvent('LandingPage', 0);
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" link="blue" onload="CSScriptInit();MM_preloadImages('images/enter_o.gif')" bgcolor="#000099">

Westech
12-09-2003, 08:32 AM
I'm not sure about the javascript, but it looks like it's used for navigation.

If the site is hiding keywords in <noscript> tags and hiding text by making it match the background then you should report them to google and google will penalize them.

grichards
12-10-2003, 09:02 AM
Thanks for your reply Westech.

The interesting thing about the code is the fact the site has no navigation menu?

Can't google detect hidden text even if its just done in a different colour i.e they have background #000099 and text colour is the same blue but using different code #03039B - which makes the text invisible?

I just thought that Google had the ability to detect this.

Thanks,

Greg