//************************************************ ****************************************
//& Author: Wow Fish
//& Date: December 31, 2004
//& Website: http://www.13smile.com/
//& Blog: http://blog.csdn.net/ bpfish
//& Name: [Couplet Advertisement] JS Script Class
//& Function: Display the couplet advertisement on the page
//& Method:
//& SmileAdver.setLeftPos(10); //Set the position of the left couplet from the left side of the page (PX)
//& SmileAdver.setLeftTop(150); //Set the position of the left couplet from the top of the page (PX)
//& SmileAdver.setRightPos (10); // Set the position on the right side of the right side of the right side (PX)
// & Smileadver.setRighttop (150); // Set the position of the right pair of pairing distance (px)
// & SmileAdver.addLeftImage(link, image address, link target, image tip); //Add the image of the left couplet ad
//& SmileAdver.addRightImage(link, image address, link target, image tip); //Add The picture of the couplet advertisement on the right
//& SmileAdver.scroll(); . *************************************************** *********************
function SmileAdver_Class(){
var leftImageArray = new Array(); //Save the left advertising image array
var rightImageArray = new Array(); //Save the right ad image array
var leftPos,rightPos; )
var leftTop,rightTop; //leftTop = The position of the left ad from the top sidebar (px) rightTop = The position of the right ad from the top sidebar (px)
var lastScrollY=0;
leftPos = rightPos = 10; //The default is 10
leftTop = rightTop = 150; /If it is not a number, the default is 10
leftPos = value;
}
this.setRightPos = function(value){
if(isNaN(value)){value = 10;} //Non-number The default is 10
rightPos = value;
}
this.setLeftTop = function(value){
if(isNaN(value)){value = 150;} //The default is for non-numbers 150
leftTop = value;
}
this.setRightTop = function(value){
if(isNaN(value)){value = 150;} //Non-number, the default is 150
rightTop = value;
}
//Add the image advertisement on the left addLeftImage (link, image address, link target, image prompt)
this.addLeftImage = function(href, image, target, title){
var imageArray = getImageArray(href,image,target,title);
if(imageArray != null){
leftImageArray[leftImageArray.length] = imageArray;
}
}
//Add the image advertisement on the right addRightImage (link, image address, link target, image prompt)
this.addRightImage = function(href,image,target,title){
var imageArray = getImageArray(href,image ,target,title);
if(imageArray != null){
rightImageArray[rightImageArray.length] = imageArray;
}
}
//Add advertising images internally, if not Image address, returns a null value, otherwise returns an array
function getImageArray(href,image,target,title){
if(image == undefined){return null;} Add
if(target == undefined || target == ""){target == "_blank"}; //The default is _blank opening method
target =" target="" target """;
if(title == undefined){ //Advertising image title prompt
title = "";
}else{
title = "title="" title """;
}
//If the link starts with www., it will automatically add http:// (otherwise, the link will be wrong)
if(href.toLowerCase().substring(0,4) == "www."){
href = "http://"; href;
}
if(image. toLowerCase().substring(0,4) == "www."){
image = "http://"; image;
}
return new Array(href,image,target,title ; Variable)
function showImageDiv(div,pos,posPX,topPx,imageArray){
var j;
document.write("
");
for(j=0; j document.write("
"); if(j != imageArray.length-1){document.write(" ");}
}