home *** CD-ROM | disk | FTP | other *** search
/ Chip 2009 November / Chip_2009.11_CD.iso / Chip_WPI / WPIScripts / tips.js < prev    next >
Encoding:
JavaScript  |  2006-06-26  |  8.6 KB  |  397 lines

  1. //
  2. // Date Last Modified: Mar. 27, 2006
  3. //
  4. // Modified By: Mark Ritter (mritter)
  5. //
  6.  
  7.  
  8. function SetupTips()
  9. {
  10.     position="tips.js";
  11.     whatfunc="SetupTips()";
  12.  
  13.     mig_clay();
  14. }
  15.  
  16.  
  17. function qdh(t, d, s) 
  18. {
  19.     position="main.js";
  20.     whatfunc="qdh()";
  21.  
  22.     if (d==null) 
  23.         return;
  24.     else
  25.         stm([t,d],s);
  26. }
  27.  
  28.  
  29. function mig_dNav()
  30. {
  31.     position="tips.js";
  32.     whatfunc="mig_dNav()";
  33.  
  34. }
  35.  
  36.  
  37. function mig_hand()
  38. {
  39.     position="tips.js";
  40.     whatfunc="mig_hand()";
  41.  
  42.     if (MI_sNav)
  43.     {
  44.         window.onresize=mig_re;
  45.         document.onmousemove=mig_mo;
  46.         if (MI_NN4) 
  47.             document.captureEvents(Event.MOUSEMOVE);
  48.     }
  49. }
  50.  
  51.  
  52. function mig_cssf()
  53. {
  54.     position="tips.js";
  55.     whatfunc="mig_cssf()";
  56.  
  57.     if (MI_IE >= 5.5 && UseTransitions)
  58.     {
  59.         fl=1;
  60.  
  61.         var d=" progid:DXImageTransform.Microsoft.";
  62.  
  63.         mig_layCss().filter="revealTrans()"+d+"Fade(Overlap=1.00 enabled=0)"+d+"Inset(enabled=0)"+d+"Iris(irisstyle=PLUS,motion=in enabled=0)"+d+"Iris(irisstyle=PLUS,motion=out enabled=0)"+d+"Iris(irisstyle=DIAMOND,motion=in enabled=0)"+d+"Iris(irisstyle=DIAMOND,motion=out enabled=0)"+d+"Iris(irisstyle=CROSS,motion=in enabled=0)"+d+"Iris(irisstyle=CROSS,motion=out enabled=0)"+d+"Iris(irisstyle=STAR,motion=in enabled=0)"+d+"Iris(irisstyle=STAR,motion=out enabled=0)"+d+"RadialWipe(wipestyle=CLOCK enabled=0)"+d+"RadialWipe(wipestyle=WEDGE enabled=0)"+d+"RadialWipe(wipestyle=RADIAL enabled=0)"+d+"Pixelate(MaxSquare=35,enabled=0)"+d+"Slide(slidestyle=HIDE,Bands=25 enabled=0)"+d+"Slide(slidestyle=PUSH,Bands=25 enabled=0)"+d+"Slide(slidestyle=SWAP,Bands=25 enabled=0)"+d+"Spiral(GridSizeX=16,GridSizeY=16 enabled=0)"+d+"Stretch(stretchstyle=HIDE enabled=0)"+d+"Stretch(stretchstyle=PUSH enabled=0)"+d+"Stretch(stretchstyle=SPIN enabled=0)"+d+"Wheel(spokes=16 enabled=0)"+d+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=forward enabled=0)"+d+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=reverse enabled=0)"+d+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=forward enabled=0)"+d+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=reverse enabled=0)"+d+"Zigzag(GridSizeX=8,GridSizeY=8 enabled=0)"+d+"Alpha(enabled=0)"+d+"Dropshadow(OffX=3,OffY=3,Positive=true,enabled=0)"+d+"Shadow(strength=3,direction=135,enabled=0)";
  64.     }
  65. }
  66.  
  67.  
  68. function stm(t,s)
  69. {
  70.     position="tips.js";
  71.     whatfunc="stm()";
  72.  
  73.     if (!ShowToolTips)
  74.         return;
  75.  
  76.     if (MI_sNav && isOK)
  77.     {    
  78.         if (document.onmousemove != mig_mo || window.onresize != mig_re) 
  79.             mig_hand();
  80.         if (fl && s[17]>-1 && s[18]>0)
  81.             mig_layCss().visibility="hidden";
  82.  
  83.         var ab="", ap="";
  84.         var titCol=s[0] ? "COLOR='"+s[0]+"'" : "";
  85.         var titBgCol=s[1] && !s[2] ? "BGCOLOR='"+s[1]+"'" : "";
  86.         var titBgImg=s[2] ? "BACKGROUND='"+s[2]+"'" : "";
  87.         var titTxtAli=s[3] ? "ALIGN='"+s[3]+"'" : "";
  88.         var txtCol=s[6] ? "COLOR='"+s[6]+"'" : "";
  89.         var txtBgCol=s[7] && !s[8] ? "BGCOLOR='"+s[7]+"'" : "";
  90.         var txtBgImg=s[8] ? "BACKGROUND='"+s[8]+"'" : "";
  91.         var txtTxtAli=s[9] ? "ALIGN='"+s[9]+"'" : "";
  92.         var tipHeight=s[13] ? "HEIGHT='"+s[13]+"'" : "";
  93.         var brdCol=s[15] ? "BGCOLOR='"+s[15]+"'" : "";
  94.  
  95.         if (!s[4])
  96.             s[4]="Arial,Helvetica,Verdana";
  97.         if (!s[5])
  98.             s[5]=1;
  99.         if (!s[10])
  100.             s[10]="Arial,Helvetica,Verdana";
  101.         if (!s[11])
  102.             s[11]=1;
  103.         if (!s[12])
  104.             s[12]=200;
  105.         if (!s[14])
  106.             s[14]=0;
  107.         if (!s[16])
  108.             s[16]=0;
  109.         if (!s[24])
  110.             s[24]=10;
  111.         if (!s[25])
  112.             s[25]=10;
  113.         hs=s[22];
  114.         if (MI_pSub==20001108)
  115.         {
  116.             if (s[14])
  117.                 ab="STYLE='border:"+s[14]+"px solid"+" "+s[15]+"'";
  118.             ap="STYLE='padding:"+s[16]+"px "+s[16]+"px "+s[16]+"px "+s[16]+"px'";
  119.         }
  120.  
  121.         var closeLink=hs==3 ? "<TD ALIGN='right'><FONT SIZE='"+s[5]+"' FACE='"+s[4]+"'><A HREF='javascript:void(0)' ONCLICK='mig_hide(0)' STYLE='text-decoration:none;color:"+s[0]+"'><B>Close</B></A></FONT></TD>" : "";
  122.         var title=t[0] || hs==3 ? "<TABLE WIDTH='100%' BORDER='0' CELLPADDING='0' CELLSPACING='0' "+titBgCol+" "+titBgImg+"><TR><TD "+titTxtAli+"><FONT SIZE='"+s[5]+"' FACE='"+s[4]+"' "+titCol+"><B>"+t[0]+"</B></FONT></TD>"+closeLink+"</TR></TABLE>" : "";
  123.         var txt="<TABLE "+ab+" WIDTH='"+s[12]+"' BORDER='0' CELLSPACING='0' CELLPADDING='"+s[14]+"' "+brdCol+"><TR><TD>"+title+"<TABLE WIDTH='100%' "+tipHeight+" BORDER='0' CELLPADDING='"+s[16]+"' CELLSPACING='0' "+txtBgCol+" "+txtBgImg+"><TR><TD "+txtTxtAli+" "+ap+" VALIGN='top'><FONT SIZE='"+s[11]+"' FACE='"+s[10]+"' "+txtCol +">"+t[1]+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
  124.  
  125.         mig_wlay(txt);
  126.         tb=
  127.         {
  128.             trans:s[17],
  129.             dur:s[18],
  130.             opac:s[19],
  131.             st:s[20],
  132.             sc:s[21],
  133.             pos:s[23],
  134.             xpos:s[24],
  135.             ypos:s[25]
  136.         };
  137.         if (MI_IE4)
  138.             mig_layCss().width=s[12];
  139.         e_d=mig_ed();
  140.         Count=0;
  141.         move=1;
  142.     }
  143. }
  144.  
  145.  
  146. function htm()
  147. {
  148.     position="tips.js";
  149.     whatfunc="htm()";
  150.  
  151.     if (MI_sNav && isOK)
  152.     {
  153.         if (hs != 4)
  154.         {
  155.             move=0;
  156.             if (hs != 3 && hs != 2)
  157.                 mig_hide(1);
  158.         }
  159.     }
  160. }
  161.  
  162.  
  163. function mig_mo(e)
  164. {
  165.     position="tips.js";
  166.     whatfunc="mig_mo()";
  167.  
  168.     if (move)
  169.     {
  170.         var X=0, Y=0, s_d=mig_scd(), w_d=mig_wd();
  171.         var mx=MI_NN ? e.pageX : MI_IE4 ? event.x : event.x+s_d[0];
  172.         var my=MI_NN ? e.pageY : MI_IE4 ? event.y : event.y+s_d[1];
  173.  
  174.         if (MI_IE4)
  175.             e_d=mig_ed();
  176.         switch(tb.pos)
  177.         {
  178.             case 1:
  179.                 X=mx-e_d[0]-tb.xpos+6;
  180.                 Y=my+tb.ypos;
  181.                 break;
  182.  
  183.             case 2:
  184.                 X=mx-(e_d[0]/2);
  185.                 Y=my+tb.ypos;
  186.                 break;
  187.  
  188.             case 3:
  189.                 X=tb.xpos+s_d[0];
  190.                 Y=tb.ypos+s_d[1];
  191.                 break;
  192.  
  193.             case 4:
  194.                 X=tb.xpos;
  195.                 Y=tb.ypos;
  196.                 break;
  197.                 
  198.             default:
  199.                 X=mx+tb.xpos;
  200.                 Y=my+tb.ypos;
  201.                 break;
  202.         }
  203.         if (w_d[0]+s_d[0]<e_d[0]+X+sbw)
  204.             X=w_d[0]+s_d[0]-e_d[0]-sbw;
  205.         if (w_d[1]+s_d[1]<e_d[1]+Y+sbw)
  206.         {
  207.             if (tb.pos>2)
  208.                 Y=w_d[1]+s_d[1]-e_d[1]-sbw;
  209.             else 
  210.                 Y=my-e_d[1];
  211.         }
  212.         if (X<s_d[0])
  213.             X=s_d[0];
  214.         with(mig_layCss())
  215.         {
  216.             left=X+PX;
  217.             top=Y+PX;
  218.         }
  219.         mig_dis();
  220.     }
  221. }
  222.  
  223.  
  224. function mig_dis()
  225. {
  226.     position="tips.js";
  227.     whatfunc="mig_dis()";
  228.  
  229.     Count++;
  230.     if (Count==1)
  231.     {
  232.         if (fl)
  233.         {    
  234.             if (tb.trans==51)
  235.                 tb.trans=parseInt(Math.random()*50);
  236.  
  237.             var at=tb.trans>-1 && tb.trans<24 && tb.dur>0; 
  238.             var af=tb.trans>23 && tb.trans<51 && tb.dur>0;
  239.             var t=mig_lay().filters[af ? tb.trans-23 : 0];
  240.  
  241.             for(var p=28; p<31; p++)
  242.             {
  243.                 mig_lay().filters[p].enabled=0;
  244.             }
  245.             for(var s=0; s<28; s++)
  246.             {
  247.                 if (mig_lay().filters[s].status)
  248.                     mig_lay().filters[s].stop();
  249.             }
  250.             for(var e=1; e<3; e++)
  251.             {
  252.                 if (tb.sc && tb.st==e)
  253.                 {
  254.                     with(mig_lay().filters[28+e])
  255.                     {
  256.                         enabled=1;
  257.                         color=tb.sc;
  258.                     }
  259.                 }
  260.             }
  261.             if (tb.opac>0 && tb.opac<100)
  262.             {
  263.                 with(mig_lay().filters[28])
  264.                 {
  265.                     enabled=1;
  266.                     opacity=tb.opac;
  267.                 }
  268.             }
  269.             if (at || af)
  270.             {
  271.                 if (at)
  272.                     mig_lay().filters[0].transition=tb.trans;
  273.                 t.duration=tb.dur;
  274.                 t.apply();
  275.             }
  276.         }
  277.         mig_layCss().visibility=MI_NN4 ? "show" : "visible";
  278.         if (fl && (at || af))
  279.             t.play();
  280.         if (hs>0 && hs<4)
  281.             move=0;
  282.     }
  283. }
  284.  
  285.  
  286. function mig_layCss()
  287. {
  288.     position="tips.js";
  289.     whatfunc="mig_layCss()";
  290.  
  291.     return MI_NN4 ? mig_lay() : mig_lay().style;
  292. }
  293.  
  294.  
  295. function mig_lay()
  296. {
  297.     position="tips.js";
  298.     whatfunc="mig_lay()";
  299.  
  300.     with(document)
  301.         return MI_NN4 ? layers[TipId] : MI_IE4 ? all[TipId] : getElementById(TipId);
  302. }
  303.  
  304.  
  305. function mig_wlay(txt)
  306. {
  307.     position="tips.js";
  308.     whatfunc="mig_wlay()";
  309.  
  310.     if (MI_NN4)
  311.     {
  312.         with(mig_lay().document)
  313.         {
  314.             open();
  315.             write(txt);
  316.             close();
  317.         }
  318.     }
  319.     else 
  320.         mig_lay().innerHTML=txt;
  321. }
  322.  
  323.  
  324. function mig_hide(C)
  325. {
  326.     position="tips.js";
  327.     whatfunc="mig_hide()";
  328.  
  329.     if (!MI_NN4 || MI_NN4 && C)
  330.         mig_wlay("");
  331.     with(mig_layCss())
  332.     {
  333.         visibility=MI_NN4 ? "hide" : "hidden";
  334.         left=0;
  335.         top=-800;
  336.     }
  337. }
  338.  
  339.  
  340. function mig_scd()
  341. {
  342.     position="tips.js";
  343.     whatfunc="mig_scd()";
  344.  
  345.     return [parseInt(MI_IE ? eval(d_r).scrollLeft : window.pageXOffset),parseInt(MI_IE ? eval(d_r).scrollTop : window.pageYOffset)];
  346. }
  347.  
  348.  
  349. function mig_re()
  350. {
  351.     position="tips.js";
  352.     whatfunc="mig_re()";
  353.  
  354.     var w_d=mig_wd();
  355.     
  356.     if (MI_NN4 && (w_d[0]-ww || w_d[1]-wh))
  357.         location.reload();
  358.     else if (hs==3 || hs==2) 
  359.         mig_hide(1);
  360. }
  361.  
  362.  
  363. function mig_wd()
  364. {
  365.     position="tips.js";
  366.     whatfunc="mig_wd()";
  367.  
  368.     return [parseInt(MI_ONN ? window.innerWidth : eval(d_r).clientWidth),parseInt(MI_ONN ? window.innerHeight : eval(d_r).clientHeight)];
  369. }
  370.  
  371.  
  372. function mig_ed()
  373. {
  374.     position="tips.js";
  375.     whatfunc="mig_ed()";
  376.  
  377.     return [parseInt(MI_NN4 ? mig_lay().clip.width : mig_lay().offsetWidth)+3,parseInt(MI_NN4 ? mig_lay().clip.height : mig_lay().offsetHeight)+5];
  378. }
  379.  
  380.  
  381. function mig_clay()
  382. {
  383.     position="tips.js";
  384.     whatfunc="mig_clay()";
  385.  
  386.     if (!mig_lay())
  387.     {
  388.         isOK=0;  
  389.         alert("DHTML TIP MESSAGE VERSION 1.5 ERROR NOTICE.\n<DIV ID=\""+TipId+"\"></DIV> tag missing or its ID has been altered");
  390.     } 
  391.     else
  392.     {
  393.         mig_hand();
  394.         mig_cssf();
  395.     }
  396. }
  397.