home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / akce / website / wsx5_sm_en_uni.exe / RESFiles.001 / x5engine.js < prev   
Text File  |  2007-02-18  |  12KB  |  291 lines

  1. // Incomedia WebSite X5 2007. All rights reserved.
  2. var imBrw_op=window.opera;
  3. var imBrw_ie=document.all && !imBrw_op;
  4. var imBrw_ns=document.getElementById && !imBrw_ie;
  5. var imEffectEnabled = /MSIE [678]/.test(navigator.userAgent) && navigator.platform == "Win32";
  6. var imHoverToEnable = /MSIE (5\.5)|[6]/.test(navigator.userAgent) && navigator.platform == "Win32";
  7. var mbTipOk = false;
  8. function imGetLayer(sName) {return document.all?document.all[sName]:document.getElementById?document.getElementById(sName) : "";}
  9. function imIEBody(){return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}
  10. function imOpenLocation(sNewLocation){
  11. document.location = sNewLocation;
  12. }
  13. function imGetParameter(sParamName) {
  14. var sQueryString = "";
  15. var iStart = 0;
  16. var iEnd = 0;
  17. if (window.top.location.search != 0)
  18. sQueryString = unescape(window.top.location.search);
  19. sParamName = sParamName + "=";
  20. if (sQueryString.length > 0) {
  21. iStart = sQueryString.indexOf(sParamName);
  22. if ( iStart != -1 ) {
  23. iStart += sParamName.length;
  24. iEnd = sQueryString.indexOf("&",iStart);
  25. if (iEnd == -1)
  26. iEnd = sQueryString.length;
  27. return sQueryString.substring(iStart,iEnd);
  28. }
  29. return null;
  30. }
  31. }
  32. function imOnload() {
  33. if (document.getElementById("imMnMn") != null) {
  34. if (document.getElementsByTagName) {
  35. if (imHoverToEnable) {
  36. var oList = document.getElementById("imMnMn").getElementsByTagName("LI");
  37. for (var i=0; i<oList.length; i++) {
  38. oList[i].onmouseover=function() {this.className+=" iehover";}
  39. oList[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" iehover\\b"), "");}
  40. }
  41. }
  42. }
  43. }
  44. }
  45. if (window.attachEvent) window.attachEvent("onload", imOnload);
  46. function imPreloadImages(sImgNames) {
  47. sNames = sImgNames.split(",");
  48. for(iList = 0 ; iList < sNames.length ; iList++) {
  49. var oImg = new Image();
  50. oImg.src = sNames[iList];
  51. }
  52. }
  53. function imFormatInt(i) {
  54. if (i<10) i='0'+i;
  55. return i;
  56. }
  57. function imShowHour() {
  58. var now=new Date();
  59. imGetLayer("imHour").innerHTML = now.getHours()+':'+imFormatInt(now.getMinutes())+':'+imFormatInt(now.getSeconds())+' ';
  60. setTimeout(imShowHour,1000);
  61. }
  62. function imShowDate(sDay,sMonth,iMode) {
  63. var now=new Date();
  64. if (iMode == 0)
  65. document.write(sDay.substr(now.getDay()*3,3)+' '+now.getDate()+' '+sMonth.substr(now.getMonth()*3,3)+', '+now.getFullYear());
  66. else
  67. document.write(sDay.substr(now.getDay()*3,3)+', '+sMonth.substr(now.getMonth()*3,3)+' '+now.getDate()+' '+now.getFullYear());
  68. }
  69. function imPopUpWin(sUrl,w,h,cb,sb){
  70. if (cb=='yes')
  71. sProp='';
  72. else {
  73. if ((w==-1) || (h==-1)) {
  74. sProp= 'width='+screen.width+',height='+screen.height+',top=0,left=0,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
  75. } else {
  76. l=(screen.width)?(screen.width-w)/2:100;
  77. t=(screen.height)?(screen.height-h)/2:100;
  78. sProp='width='+ w +',height='+ h +',top='+ t +',left='+ l +',scrollbars='+ sb +',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
  79. }
  80. }
  81. oWin=window.open(sUrl,'',sProp);
  82. oWin.focus();
  83. }
  84. var msSSTrans = new Array(50);
  85. msSSTrans[0] = "BasicImage(grayscale=0, xray=0, mirror=0, invert=0, opacity=1, rotation=0)";
  86. msSSTrans[1] = "rnd";
  87. msSSTrans[2] = "Barn(motion='out',orientation='vertical')";
  88. msSSTrans[3] = "Barn(motion='out',orientation='horizontal')";
  89. msSSTrans[4] = "Barn(motion='in',orientation='vertical')";
  90. msSSTrans[5] = "Barn(motion='in',orientation='horizontal')";
  91. msSSTrans[6] = "Blinds(Bands=2,direction='up')";
  92. msSSTrans[7] = "Blinds(Bands=2,direction='down')";
  93. msSSTrans[8] = "Blinds(Bands=2,direction='left')";
  94. msSSTrans[9] = "Blinds(Bands=2,direction='right')";
  95. msSSTrans[10] = "Blinds(Bands=15,direction='up')";
  96. msSSTrans[11] = "Blinds(Bands=15,direction='down')";
  97. msSSTrans[12] = "Blinds(Bands=15,direction='left')";
  98. msSSTrans[13] = "Blinds(Bands=15,direction='right')";
  99. msSSTrans[14] = "Checkerboard(Direction='up',SquaresX=4,SquaresY=4)";
  100. msSSTrans[15] = "Checkerboard(Direction='down',SquaresX=4,SquaresY=4)";
  101. msSSTrans[16] = "Checkerboard(Direction='left',SquaresX=4,SquaresY=4)";
  102. msSSTrans[17] = "Checkerboard(Direction='right',SquaresX=4,SquaresY=4)";
  103. msSSTrans[18] = "Checkerboard(Direction='up',SquaresX=50,SquaresY=12)";
  104. msSSTrans[19] = "Checkerboard(Direction='down',SquaresX=50,SquaresY=12)";
  105. msSSTrans[20] = "Checkerboard(Direction='left',SquaresX=50,SquaresY=12)";
  106. msSSTrans[21] = "Checkerboard(Direction='right',SquaresX=50,SquaresY=12)";
  107. msSSTrans[22] = "Fade(Overlap=1.00)";
  108. msSSTrans[23] = "Fade(Overlap=0.00)";
  109. msSSTrans[24] = "GradientWipe(GradientSize=0.00,wipestyle=0,motion='forward')";
  110. msSSTrans[25] = "GradientWipe(GradientSize=0.00,wipestyle=0,motion='reverse')";
  111. msSSTrans[26] = "GradientWipe(GradientSize=0.00,wipestyle=1,motion='forward')";
  112. msSSTrans[27] = "GradientWipe(GradientSize=0.00,wipestyle=1,motion='reverse')";
  113. msSSTrans[28] = "GradientWipe(GradientSize=0.75,wipestyle=0,motion='forward')";
  114. msSSTrans[29] = "GradientWipe(GradientSize=0.75,wipestyle=0,motion='reverse')";
  115. msSSTrans[30] = "GradientWipe(GradientSize=0.75,wipestyle=1,motion='forward')";
  116. msSSTrans[31] = "GradientWipe(GradientSize=0.75,wipestyle=1,motion='reverse')";
  117. msSSTrans[32] = "Iris(irisstyle='PLUS',motion='out')";
  118. msSSTrans[33] = "Iris(irisstyle='PLUS',motion='in')";
  119. msSSTrans[34] = "Iris(irisstyle='DIAMOND',motion='out')";
  120. msSSTrans[35] = "Iris(irisstyle='DIAMOND',motion='in')";
  121. msSSTrans[36] = "Iris(irisstyle='CIRCLE',motion='out')";
  122. msSSTrans[37] = "Iris(irisstyle='CIRCLE',motion='in')";
  123. msSSTrans[38] = "Iris(irisstyle='CROSS',motion='out')";
  124. msSSTrans[39] = "Iris(irisstyle='CROSS',motion='in')";
  125. msSSTrans[40] = "Iris(irisstyle='SQUARE',motion='out')";
  126. msSSTrans[41] = "Iris(irisstyle='SQUARE',motion='in')";
  127. msSSTrans[42] = "Iris(irisstyle='STAR',motion='out')";
  128. msSSTrans[43] = "Iris(irisstyle='STAR',motion='in')";
  129. msSSTrans[44] = "RadialWipe(wipestyle='CLOCK')";
  130. msSSTrans[45] = "RadialWipe(wipestyle='WEDGE')";
  131. msSSTrans[46] = "RadialWipe(wipestyle='RADIAL')";
  132. msSSTrans[47] = "Wheel(spokes=2)";
  133. msSSTrans[48] = "Wheel(spokes=4)";
  134. msSSTrans[49] = "Wheel(spokes=10)";
  135. msSSTrans[50] = "RandomBars(orientation='horizontal')";
  136. msSSTrans[51] = "RandomBars(orientation='vertical')";
  137. msSSTrans[52] = "RandomDissolve(duration=1)";
  138. msSSTrans[53] = "Slide(slidestyle='HIDE',Bands=1)";
  139. msSSTrans[54] = "Slide(slidestyle='SWAP',Bands=1)";
  140. msSSTrans[55] = "Slide(slidestyle='PUSH',Bands=1)";
  141. msSSTrans[56] = "Slide(slidestyle='HIDE',Bands=2)";
  142. msSSTrans[57] = "Slide(slidestyle='SWAP',Bands=2)";
  143. msSSTrans[58] = "Slide(slidestyle='PUSH',Bands=2)";
  144. msSSTrans[59] = "Slide(slidestyle='HIDE',Bands=10)";
  145. msSSTrans[60] = "Slide(slidestyle='SWAP',Bands=10)";
  146. msSSTrans[61] = "Slide(slidestyle='PUSH',Bands=10)";
  147. msSSTrans[62] = "Spiral(GridSizeX=8,GridSizeY=8)";
  148. msSSTrans[63] = "Spiral(GridSizeX=16,GridSizeY=16)";
  149. msSSTrans[64] = "Zigzag(GridSizeX=6,GridSizeY=6)";
  150. msSSTrans[65] = "Zigzag(GridSizeX=12,GridSizeY=12)";
  151. msSSTrans[66] = "Stretch(stretchstyle='HIDE')";
  152. msSSTrans[67] = "Stretch(stretchstyle='PUSH')";
  153. msSSTrans[68] = "Stretch(stretchstyle='SPIN')";
  154. msSSTrans[69] = "Strips(motion='rightdown')";
  155. msSSTrans[70] = "Strips(motion='leftdown')";
  156. msSSTrans[71] = "Strips(motion='rightup')";
  157. msSSTrans[72] = "Strips(motion='leftup')";
  158. msSSTrans[73] = "Pixelate(MaxSquare=5)";
  159. msSSTrans[74] = "Pixelate(MaxSquare=50)";
  160. msSSTrans[75] = "Inset()";
  161. var msImgList = new Array();
  162. var miImgW = new Array();
  163. var miImgH = new Array();
  164. var miSSDelay = new Array();
  165. var miSSEffect = new Array();
  166. var msSSDescr = new Array();
  167. var msSSLink = new Array();
  168. var miSSCount = new Array();
  169. var moSSTime = new Array();
  170. function imSSLoad(iID,oImgData) {
  171. msImgList[iID] = new Array();
  172. miImgW[iID] = new Array();
  173. miImgH[iID] = new Array();
  174. miSSEffect[iID] = new Array();
  175. miSSDelay[iID] = new Array();
  176. msSSDescr[iID] = new Array();
  177. msSSLink[iID] = new Array();
  178. for(i=0;i<oImgData.length;i++){
  179. msImgList[iID][i+1] = "slideshow/"+oImgData[i][0];
  180. miImgW[iID][i+1] = oImgData[i][1];
  181. miImgH[iID][i+1] = oImgData[i][2];
  182. miSSDelay[iID][i+1] = oImgData[i][3]*1000;
  183. miSSEffect[iID][i+1] = oImgData[i][4];
  184. msSSDescr[iID][i+1] = oImgData[i][5];
  185. msSSLink[iID][i+1] = oImgData[i][6];
  186. }
  187. if(!miSSCount[iID]) miSSCount[iID]=1;
  188. }
  189. function imDoTrans(iID,iStep) {
  190. iLast = msImgList[iID].length-1;
  191. miSSCount[iID]=(miSSCount[iID]+iStep);
  192. if (miSSCount[iID] == iLast + 1) miSSCount[iID] = 1;
  193. if (miSSCount[iID] == 0) miSSCount[iID] = iLast;
  194. var div_Descr=imGetLayer("imSSDescr_"+iID);
  195. var div_Main=imGetLayer("imSSBackg_"+iID);
  196. var div_Image=imGetLayer("imSSImage_"+iID);
  197. if (imEffectEnabled) {
  198. if (miSSEffect[iID][miSSCount[iID]] == 1)
  199. iSSEffectType = Math.floor(Math.random()*73) + 2;
  200. else
  201. iSSEffectType = miSSEffect[iID][miSSCount[iID]];
  202. div_Main.style.filter="progid:DXImageTransform.Microsoft."+msSSTrans[iSSEffectType];
  203. div_Main.filters.item(0).Apply();
  204. }
  205. div_Descr.innerHTML=msSSDescr[iID][miSSCount[iID]];
  206. div_Image.src = msImgList[iID][miSSCount[iID]];
  207. iHeight=parseInt(msSSDescr[iID][miSSCount[iID]]==''?0:div_Descr.offsetHeight);
  208. iTop=parseInt((div_Main.offsetHeight-miImgH[iID][miSSCount[iID]]-iHeight)/2);
  209. div_Image.style.top=iTop+'px';
  210. div_Descr.style.top=iTop+miImgH[iID][miSSCount[iID]]+'px';
  211. div_Image.style.left=parseInt((div_Main.offsetWidth-miImgW[iID][miSSCount[iID]])/2)+'px';
  212. if (imEffectEnabled) div_Main.filters.item(0).Play();
  213. if(msSSLink[iID][miSSCount[iID]] != "#")
  214. div_Image.style.cursor = 'pointer';
  215. else
  216. div_Image.style.cursor = 'default';
  217. iNext = miSSCount[iID]+1
  218. if (iNext <= iLast) {
  219. oImg = new Image();
  220. oImg.src = msImgList[iID][iNext];
  221. }
  222. }
  223. function imLink(iID){
  224. if(msSSLink[iID][miSSCount[iID]] != "#")
  225. location = msSSLink[iID][miSSCount[iID]];
  226. }
  227. function imDoAuto(iID) {
  228. imDoTrans(iID,1);
  229. iAutoDelay=miSSDelay[iID][miSSCount[iID]];
  230. moSSTime[iID]=setTimeout("imDoAuto("+iID+")", iAutoDelay);
  231. }
  232. function imSSPlay(iID,Auto,iBtnType) {
  233. if (Auto == 1) {
  234. miSSCount[iID]=1;
  235. iAutoDelay=miSSDelay[iID][miSSCount[iID]];
  236. moSSTime[iID]=setTimeout("imDoAuto("+iID+")", iAutoDelay);
  237. }
  238. else {
  239. cmd_Auto = imGetLayer('imssPlay_' + iID);
  240. if (cmd_Auto.alt == 'Pause') {
  241. cmd_Auto.alt='Play';
  242. cmd_Auto.src='res/ss_play'+iBtnType+'.gif';
  243. clearTimeout(moSSTime[iID]);
  244. }
  245. else {
  246. cmd_Auto.alt='Pause';
  247. cmd_Auto.src='res/ss_pause'+iBtnType+'.gif';
  248. imDoTrans(iID, 1);
  249. iAutoDelay=miSSDelay[iID][miSSCount[iID]];
  250. moSSTime[iID]=setTimeout("imDoAuto("+iID+")", iAutoDelay);
  251. }
  252. }
  253. }
  254. function imZIZoom(sImage,iHeight,iWidth,sDescr) {
  255. var imZIdiv_Backg = imGetLayer("imZIBackg");
  256. var imZIdiv_Image = imGetLayer("imZIImage");
  257. var imZIyScroll;
  258. var imZIwindowHeight;
  259. if (window.innerHeight && window.scrollMaxY)
  260. imZIyScroll = window.innerHeight + window.scrollMaxY;
  261. else if (document.body.scrollHeight > document.body.offsetHeight)
  262. imZIyScroll = document.body.scrollHeight;
  263. else
  264. imZIyScroll = document.body.offsetHeight;
  265. if (self.innerHeight)
  266. imZIwindowHeight = self.innerHeight;
  267. else if (document.documentElement && document.documentElement.clientHeight)
  268. imZIwindowHeight = document.documentElement.clientHeight;
  269. else if (document.body)
  270. imZIwindowHeight = document.body.clientHeight;
  271. imZIpageHeight = imZIyScroll < imZIwindowHeight ? imZIwindowHeight : imZIyScroll;
  272. if (self.pageYOffset)
  273. imZIyScroll = self.pageYOffset;
  274. else if (document.documentElement && document.documentElement.scrollTop)
  275. imZIyScroll = document.documentElement.scrollTop;
  276. else if (document.body)
  277. imZIyScroll = document.body.scrollTop;
  278. imZIdiv_Backg.style.top = '0px';
  279. imZIdiv_Backg.style.height = (imZIpageHeight + 'px');
  280. imZIdiv_Backg.style.zIndex = '2000';
  281. var imZIImageTop = imZIyScroll + ((imZIwindowHeight - 35 - iHeight) / 2);
  282. var div_Descr = "";
  283. if (sDescr!="") div_Descr = "<div id=\"imZICaption\">" + sDescr + "</div>";
  284. imZIdiv_Backg.innerHTML = "<div id=\"imZIImage\" style=\"margin-top:" + ((imZIImageTop < 0) ? "0px" : imZIImageTop) + "px" + "; width: " + (iWidth + 14) + "px\"><img src=\"" + sImage + "\" width=\"" + iWidth + "\" height=\"" + iHeight + "\" />" + div_Descr + "</div>";
  285. imZIdiv_Backg.style.display = "block";
  286. }
  287. function imZIHide(){
  288. imGetLayer("imZIBackg").style.display = "none";
  289. imGetLayer("imZIImage").innerHtml = "";
  290. }
  291.