1 2// BANNER OBJECT 3function Banner(objName){ 4 this.obj = objName; 5 this.aNodes = []; 6 this.currentBanner = 0; 7 8}; 9 10// ADD NEW BANNER 11Banner.prototype.add = function(bannerType, bannerPath, bannerDuration, height, width, hyperlink) { 12 this.aNodes[this.aNodes.length] = new Node(this.obj +"_"+ this.aNodes.length, bannerType, bannerPath, bannerDuration, height, width, hyperlink); 13}; 14 15// Node object 16function Node(name, bannerType, bannerPath, bannerDuration, height, width, hyperlink) { 17 this.name = name; 18 this.bannerType = bannerType; 19 this.bannerPath = bannerPath; 20 this.bannerDuration = bannerDuration; 21 this.height = height 22 this.width = width; 23 this.hyperlink= hyperlink; 24// alert (name +"|" + bannerType +"|" + bannerPath +"|" + bannerDuration +"|" + height +"|" + width + "|" + hyperlink); 25}; 26 27// Outputs the banner to the page 28Banner.prototype.toString = function() { 29 var str = "" 30 for (var iCtr=0; iCtr < this.aNodes.length; iCtr++){ 31 str = str + '<span name="'+this.aNodes[iCtr].name+'" ' 32 str = str + 'id="'+this.aNodes[iCtr].name+'" '; 33 str = str + 'class="m_banner_hide" '; 34 str = str + 'bgcolor="#FFFCDA" '; // CHANGE BANNER COLOR HERE 35 str = str + 'align="center" '; 36 str = str + 'valign="top" >\n'; 37 if (this.aNodes[iCtr].hyperlink != ""){ 38 str = str + '<a href="'+this.aNodes[iCtr].hyperlink+'">'; 39 } 40 41 if ( this.aNodes[iCtr].bannerType == "FLASH" ){ 42 str = str + '<OBJECT ' 43 str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' 44 str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ' 45 str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" ' 46 str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" ' 47 str = str + 'id="bnr_'+this.aNodes[iCtr].name+'" ' 48 str = str + 'ALIGN="" ' 49 str = str + 'VIEWASTEXT>' 50 str = str + '<PARAM NAME=movie VALUE="'+ this.aNodes[iCtr].bannerPath + '">' 51 str = str + '<PARAM NAME=quality VALUE=high>' 52 str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>' 53 str = str + '<EMBED '; 54 str = str + 'src="'+this.aNodes[iCtr].bannerPath+'" ' 55 str = str + 'quality=high ' 56// str = str + 'bgcolor=#FFFCDA ' 57 str = str + 'WIDTH="'+this.aNodes[iCtr].width+'" ' 58 str = str + 'HEIGHT="'+this.aNodes[iCtr].height+'" ' 59 str = str + 'NAME="bnr_'+this.aNodes[iCtr].name+'" ' 60 str = str + 'ALIGN="center" ' 61 str = str + 'TYPE="application/x-shockwave-flash" ' 62 str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">' 63 str = str + '</EMBED>' 64 str = str + '</OBJECT>' 65 }else if ( this.aNodes[iCtr].bannerType == "IMAGE" ){ 66 str = str + '<img src="'+this.aNodes[iCtr].bannerPath+'" '; 67 str = str + 'border="0" '; 68 str = str + 'height="'+this.aNodes[iCtr].height+'" '; 69 str = str + 'width="'+this.aNodes[iCtr].width+'">'; 70 } 71 72 if (this.aNodes[iCtr].hyperlink != ""){ 73 str = str + '</a>'; 74 } 75 76 str += '</span>'; 77 } 78 return str; 79}; 80 81// START THE BANNER ROTATION 82Banner.prototype.start = function(){ 83 this.changeBanner(); 84 var thisBannerObj = this.obj; 85 // CURRENT BANNER IS ALREADY INCREMENTED IN cahngeBanner() FUNCTION 86 setTimeout(thisBannerObj+".start()", this.aNodes[this.currentBanner].bannerDuration * 1000); 87} 88 89// CHANGE BANNER 90Banner.prototype.changeBanner = function(){ 91 var thisBanner; 92 var prevBanner = -1; 93 if (this.currentBanner < this.aNodes.length ){ 94 thisBanner = this.currentBanner; 95 if (this.aNodes.length > 1){ 96 if ( thisBanner > 0 ){ 97 prevBanner = thisBanner - 1; 98 }else{ 99 prevBanner = this.aNodes.length-1; 100 } 101 } 102 if (this.currentBanner < this.aNodes.length - 1){ 103 this.currentBanner = this.currentBanner + 1; 104 }else{ 105 this.currentBanner = 0; 106 } 107 } 108 109 110 if (prevBanner >= 0){ 111 document.getElementById(this.aNodes[prevBanner].name).className = "m_banner_hide"; 112 } 113 document.getElementById(this.aNodes[thisBanner].name).className = "m_banner_show"; 114} 115
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.