home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / Chip_2002-02_cd1.bin / firmy / Language / AFGHAN1_files / main.js < prev    next >
Text File  |  2001-10-09  |  4KB  |  144 lines

  1. var color = "";
  2.  
  3. function changeCellColor(obj,color) {
  4.   if (document.all) {
  5.     obj.style.backgroundColor=color;
  6.   }
  7. }
  8.  
  9. function newImage(arg) {
  10.     if (document.images) {
  11.         rslt = new Image();
  12.         rslt.src = arg;
  13.         return rslt;
  14.     }
  15. }
  16.  
  17. function changeImages() {
  18.     if (document.images && (preloadFlag == true)) {
  19.         for (var i=0; i<changeImages.arguments.length; i+=2) {
  20.             document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
  21.         }
  22.     }
  23. }
  24.  
  25. var preloadFlag = false;
  26. function preloadImages() {
  27.     if (document.images) {
  28.         community_on = newImage("/media/Onsection/on_community_btn_on.gif");
  29.         audio_on = newImage("/media/Onsection/on_audio_btn_on.gif");
  30.         video_on = newImage("/media/Onsection/on_video_btn_on.gif");
  31.         webcast_on = newImage("/media/Onsection/on_webcast_btn_on.gif");
  32.         turbo_on = newImage("/media/Onsection/on_turbo_btn_on.gif");
  33.         vote_on = newImage("/media/Onsection/on_vote_btn_on.gif");
  34.         wire_on = newImage("/media/Onsection/on_wire_btn_on.gif");
  35.         
  36.         community_title_on = newImage("/media/Onsection/on_community_title.gif");
  37.         audio_title_on = newImage("/media/Onsection/on_audio_title.gif");
  38.         video_title_on = newImage("/media/Onsection/on_video_title.gif");
  39.         turbo_title_on = newImage("/media/Onsection/on_turbo_title.gif");
  40.         webcast_title_on = newImage("/media/Onsection/on_webcast_title.gif");
  41.         vote_title_on = newImage("/media/Onsection/on_vote_title.gif");
  42.         wire_title_on = newImage("/media/Onsection/on_wire_title.gif");
  43.  
  44.         preloadFlag = true;
  45.     }
  46. }
  47.  
  48. function ShowText(Item)
  49.     {
  50.         for (j=1; j<=7; j++) 
  51.         {
  52.         if (document.all)
  53.            eval("Text"+j+".style.visibility='hidden'");
  54.         else
  55.            document.eval("Text"+j).visibility ="hide";
  56.         }        
  57.         if (document.all)
  58.            eval("Text"+Item+".style.visibility='visible'");
  59.         else
  60.            document.eval("Text"+Item).visibility  = "show";
  61.           
  62.     }
  63.     
  64.  
  65.     
  66. function ShowOff()
  67.     {
  68.         changeImages('community','/media/Onsection/on_community_btn_off.gif');
  69.         changeImages('audio','/media/Onsection/on_audio_btn_off.gif');
  70.         changeImages('video','/media/Onsection/on_video_btn_off.gif');
  71.         changeImages('webcast','/media/Onsection/on_webcast_btn_off.gif');
  72.         changeImages('turbo','/media/Onsection/on_turbo_btn_off.gif');
  73.         changeImages('vote','/media/Onsection/on_vote_btn_off.gif');
  74.         changeImages('wire','/media/Onsection/on_wire_btn_off.gif');
  75.         
  76.     }        
  77.     
  78. function PgLoad(textnum, imagename)
  79.     {
  80.         changeImages('ontitle', '/media/Onsection/on_'+imagename+'_title.gif');
  81.         changeImages( imagename, '/media/Onsection/on_'+imagename+'_btn_on.gif');
  82.         ShowText(textnum)
  83.     }        
  84.     
  85.     
  86. // code for GOTO drop box     
  87. function goTo(pagename) {
  88.         
  89.         if ((-1 < pagename.selectedIndex) && (pagename.options[pagename.selectedIndex].value != 'nil')) {
  90.                 val = pagename.options[pagename.selectedIndex].value;
  91.                 if(val!="NoValue") {
  92.                         location.href=val;
  93.                         return true;
  94.                 }
  95.         }
  96. }    
  97.  
  98. // end of GOTO code
  99.  
  100.  
  101. // jscript for KEYWORD SEARCH top & bottom
  102.  
  103.  
  104. function search() {
  105.     if(document.seeklight.rq.selectedIndex == 1) {
  106.         document.seeklight.action = "http://my.abcnews.go.com/keyword/lookup";
  107.     }
  108. }
  109.  
  110.  
  111. function searchBottom() {
  112.     if(document.seeklightBottom.rq.selectedIndex == 1) {
  113.         document.seeklightBottom.action = "http://my.abcnews.go.com/keyword/lookup";
  114.     }
  115. }
  116.  
  117. function searchChrome() {
  118.     if(document.seeklightChrome.rq.selectedIndex == 2) {
  119.         document.seeklightChrome.action = "http://my.abcnews.go.com/keyword/lookup";
  120.     }
  121. }
  122.  
  123.  
  124. // jscript for news plus
  125.  
  126.  
  127. function go_nav(){
  128.     if (document.navselect.sys.options[0].selected) parent.location.href = "http://abcnews.go.com/sections/techjobs/DailyNews/techjobs_index.html";
  129.     if (document.navselect.sys.options[1].selected) parent.location.href = "http://abcnews.go.com/sections/auto/DailyNews/AUTO_INDEX.html";
  130.     if (document.navselect.sys.options[2].selected) parent.location.href = "http://abcnews.go.com/ad/specialservices/shopping_guide/index.html";
  131. }
  132.  
  133.  
  134. // LaunchURL main function
  135.  
  136. function launchURL(url,name,x,y) {
  137.     window.name = "_newshome";
  138.     var ItsTheWindow;
  139.     ItsTheWindow = window.open(url, name,
  140.     "status=no,height="+y+",width="+x+",scrollbars=no,resizable=no,toolbar=no");
  141. }
  142.  
  143. // end of KEYWORD search code 
  144.