function AlterImageItem(image,link,text){ this.image=image; this.link=link; this.text=text; } function AlterImage(size){ this.size={}; var p=['width','imageHeight','textHeight']; for(var i=0,n=p.length;i0){ this.size[s]=size[s]; }else{ this.size[s]=-1; } } if(this.size.textHeight==-1){ this.size.textHeight=18; } this.showText=1; this.items=[]; this.string=''; } AlterImage.prototype={ add:function(item){ this.items[this.items.length]=item; } , _render:function(){ if(!this.showText){ this.size.textHeight=0; } this.size.textHeight=0; var images=[],links=[],texts=[]; for(var i=0,n=this.items.length;i'; objs+=''; objs+=''; objs+=''; objs+=''; objs+=''; return objs; } , getString:function(){ if(!this.string){ this.string=this._render(); } return this.string; } , bind:function(el){ // var o=null; // if(typeof el=='string'){ // o=document.getElementById(el); // } else{ // o=el; // } // o.innerHTML=this.getString(); document.write(this.getString()); } , fill:function(el){ this.bind(el); } } function loadAlterImage(){ var alterImage=new AlterImage({width:364,imageHeight:162}); alterImage.showText=1; var item1=new AlterImageItem(); item1.image='user/../photo/upload/2008-05/20085142046411701.jpg'; item1.link='http://www.love2128.com/love.asp?page=114'; item1.text=''; alterImage.add(item1); var item2=new AlterImageItem(); item2.image='user/../photo/upload/2008-05/20085142045134496.jpg'; item2.link='http://www.love2128.com/emotional-magazine.asp'; item2.text=''; alterImage.add(item2); var item3=new AlterImageItem(); item3.image='user/../photo/upload/2008-05/20085142044517793.jpg'; item3.link='http://www.love2128.com/CreateUser.asp'; item3.text=''; alterImage.add(item3); var item4=new AlterImageItem(); item4.image='user/../photo/upload/2008-05/20085142044189126.jpg'; item4.link='http://www.love2128.com/dating-activities.asp'; item4.text=''; alterImage.add(item4); var item5=new AlterImageItem(); item5.image='user/../photo/upload/2008-05/20085142043321297.jpg'; item5.link='http://www.love2128.com/service.asp'; item5.text=''; alterImage.add(item5); alterImage.fill('sx6781'); } loadAlterImage();