| 25 | |
| 26 | var Book_Image_Sources = new Array(); |
| 27 | var Book_Image_Width=200; |
| 28 | var Book_Image_Height=280; |
| 29 | var Book_Border=true; |
| 30 | var Book_Border_Color="gray"; |
| 31 | var Book_Speed=15; |
| 32 | var Book_NextPage_Delay=1500; //1 second=1000 |
| 33 | var Book_Vertical_Turn=0; |
| 34 | |
| 35 | var B_LI,B_MI,B_RI,B_TI,B_Angle=0,B_CrImg=6,B_MaxW,B_Direction=1; |
| 36 | var B_MSz,B_Stppd=false;B_Pre_Img=new Array(); |
| 37 | |
| 38 | function ImageBook() |
| 39 | { |
| 40 | if(document.getElementById) |
| 41 | { |
| 42 | for(i=0;i<Book_Image_Sources.length;i+=1) |
| 43 | { |
| 44 | B_Pre_Img[i]=new Image(); |
| 45 | B_Pre_Img[i].src=Book_Image_Sources[i]; |
| 46 | } |
| 47 | |
| 48 | Book_Div=document.getElementById("Book"); |
| 49 | B_LI=document.createElement("img");Book_Div.appendChild(B_LI); |
| 50 | B_RI=document.createElement("img");Book_Div.appendChild(B_RI); |
| 51 | B_MI=document.createElement("img");Book_Div.appendChild(B_MI); |
| 52 | |
| 53 | B_LI.style.position = B_MI.style.position = B_RI.style.position = "absolute"; |
| 54 | |
| 55 | B_LI.style.zIndex=B_RI.style.zIndex=0;B_MI.style.zIndex=1; |
| 56 | |
| 57 | B_LI.style.top=(Book_Vertical_Turn?Book_Image_Height+1:-Book_Image_Height/3)+"px"; |
| 58 | B_LI.style.left=0+"px"; |
| 59 | B_MI.style.top=-Book_Image_Height/3+"px"; |
| 60 | B_MI.style.left=(Book_Vertical_Turn?0:Book_Image_Width+1)+"px"; |
| 61 | B_RI.style.top=-Book_Image_Height/3+"px"; |
| 62 | B_RI.style.left=(Book_Vertical_Turn?0:Book_Image_Width+1)+"px"; |
| 63 | |
| 64 | B_LI.style.height=Book_Image_Height+"px"; |
| 65 | B_MI.style.height=Book_Image_Height+"px"; |
| 66 | B_RI.style.height=Book_Image_Height+"px"; |
| 67 | B_LI.style.width=Book_Image_Width+"px"; |
| 68 | B_MI.style.width=Book_Image_Width+"px"; |
| 69 | B_RI.style.width=Book_Image_Width+"px"; |
| 70 | |
| 71 | if(Book_Border) |
| 72 | { |
| 73 | B_LI.style.borderStyle=B_MI.style.borderStyle=B_RI.style.borderStyle="solid"; |
| 74 | B_LI.style.borderWidth=1+"px"; |
| 75 | B_MI.style.borderWidth=1+"px"; |
| 76 | B_RI.style.borderWidth=1+"px"; |
| 77 | B_LI.style.borderColor=B_MI.style.borderColor=B_RI.style.borderColor=Book_Border_Color |
| 78 | } |
| 79 | |
| 80 | B_LI.src=B_Pre_Img[0].src; |
| 81 | B_LI.lnk=Book_Image_Sources[1]; |
| 82 | B_MI.src=B_Pre_Img[2].src; |
| 83 | B_MI.lnk=Book_Image_Sources[3]; |
| 84 | B_RI.src=B_Pre_Img[4].src; |
| 85 | B_RI.lnk=Book_Image_Sources[5]; |
| 86 | B_LI.onclick=B_MI.onclick=B_RI.onclick=B_LdLnk; |
| 87 | B_LI.onmouseover=B_MI.onmouseover=B_RI.onmouseover=B_Stp; |
| 88 | B_LI.onmouseout=B_MI.onmouseout=B_RI.onmouseout=B_Rstrt; |
| 89 | BookImages() |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | function BookImages(){ |
| 94 | if(!B_Stppd) |
| 95 | { |
| 96 | if(Book_Vertical_Turn) |
| 97 | { |
| 98 | B_MSz=Math.abs(Math.round(Math.cos(B_Angle)*Book_Image_Height)); |
| 99 | MidOffset=!B_Direction?Book_Image_Height+1:Book_Image_Height-B_MSz; |
| 100 | B_MI.style.top=MidOffset+"px"; |
| 101 | B_MI.style.height=B_MSz+"px" |
| 102 | } |
| 103 | else |
| 104 | { |
| 105 | B_MSz=Math.abs(Math.round(Math.cos(B_Angle)*Book_Image_Width)); |
| 106 | MidOffset=B_Direction?Book_Image_Width+1:Book_Image_Width-B_MSz; |
| 107 | B_MI.style.left=MidOffset+"px"; |
| 108 | B_MI.style.width=B_MSz+"px" |
| 109 | } |
| 110 | B_Angle+=Book_Speed/720*Math.PI; |
| 111 | if(B_Angle>=Math.PI/2&&B_Direction) |
| 112 | { |
| 113 | B_Direction=0; |
| 114 | if(B_CrImg==Book_Image_Sources.length)B_CrImg=0; |
| 115 | B_MI.src=B_Pre_Img[B_CrImg].src; |
| 116 | B_MI.lnk=Book_Image_Sources[B_CrImg]; |
| 117 | B_CrImg+=1 |
| 118 | } |
| 119 | if(B_Angle>=Math.PI) |
| 120 | { |
| 121 | B_Direction=1; |
| 122 | B_TI=B_LI; |
| 123 | B_LI=B_MI; |
| 124 | B_MI=B_TI; |
| 125 | if(Book_Vertical_Turn)B_MI.style.top=0+"px"; |
| 126 | else B_MI.style.left=Book_Image_Width+1+"px"; |
| 127 | B_MI.src=B_RI.src; |
| 128 | B_MI.lnk=B_RI.lnk; |
| 129 | |
| 130 | setTimeout("Book_Next_Delay()",Book_NextPage_Delay) |
| 131 | } |
| 132 | else |
| 133 | { |
| 134 | setTimeout("BookImages()",50) |
| 135 | } |
| 136 | } |
| 137 | else |
| 138 | { |
| 139 | setTimeout("BookImages()",50) |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | function Book_Next_Delay() |
| 144 | { |
| 145 | if(B_CrImg==Book_Image_Sources.length) |
| 146 | { |
| 147 | B_CrImg=0; |
| 148 | } |
| 149 | |
| 150 | B_RI.src=B_Pre_Img[B_CrImg].src; |
| 151 | B_RI.lnk=Book_Image_Sources[B_CrImg]; |
| 152 | B_MI.style.zIndex=2; |
| 153 | B_LI.style.zIndex=1; |
| 154 | B_Angle=0; |
| 155 | B_CrImg+=1; |
| 156 | |
| 157 | setTimeout("BookImages()",50) |
| 158 | } |
| 159 | |
| 160 | function B_LdLnk() |
| 161 | { |
| 162 | if(this.lnk) |
| 163 | { |
| 164 | window.location.href=this.lnk |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | function B_Stp() |
| 169 | { |
| 170 | B_Stppd=true; |
| 171 | this.style.cursor=this.lnk?"pointer":"default" |
| 172 | } |
| 173 | |
| 174 | function B_Rstrt() |
| 175 | { |
| 176 | B_Stppd=false |
| 177 | } |
| 178 | |