home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 December / Australian PC User - December 2003 (CD2).iso / software / apps / files / dwmx2k4.exe / Disk1 / data1.cab / Configuration_En / Objects / Head / Base.js < prev    next >
Encoding:
JavaScript  |  2003-09-05  |  1.6 KB  |  54 lines

  1. // Copyright 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  2.  
  3.  
  4. //---------------   GLOBAL VARIABLES   ---------------
  5.  
  6. var helpDoc = MM.HELP_objBase;
  7.  
  8.  
  9. //---------------     API FUNCTIONS    ---------------
  10.  
  11. function isDOMRequired() { 
  12.     // Return false, indicating that this object is available in code view.
  13.     return false;
  14. }
  15.  
  16. function objectTag(){
  17.   var Form=document.forms[0];
  18.   var Attributes='';
  19.   var href=Form.hrefFileName.value;
  20.   var frameTarget=Form.frameTarget.selectedIndex;
  21.   Attributes+='href="' + href + '" ';
  22.   if (frameTarget!=-1)
  23.     Attributes+='target="' + Form.frameTarget.options[frameTarget].text + '"';
  24.     
  25.   if (Attributes.charAt(Attributes.length-1)==' ') {//if there is an extra space, kill it
  26.     Attributes = Attributes.substring(0,Attributes.length-2);    
  27.   }
  28.             
  29.   return '<base ' + Attributes + '>';
  30. }
  31.  
  32. //---------------    LOCAL FUNCTIONS   ---------------
  33.  
  34. function browseFile(){
  35.   var fileName = browseForFileURL();  //returns a local filename
  36.   if (fileName) document.forms[0].hrefFileName.value = fileName;
  37. }
  38.  
  39. function initializeUI(){
  40.   var frameName,counter,frameList;
  41.   var counter=5;
  42.   frameList=getObjectRefs("NS 4.0","parent","frame"); //get list of frames
  43.   if (frameList && frameList.length>0) { //if frames
  44.     for (i=0; i<frameList.length; i++) {
  45.       if (frameList[i].indexOf('unnamed') == -1){
  46.         frameName=frameList[i].substring(frameList[i].indexOf("['") + 2,frameList[i].indexOf("']"));
  47.         document.forms[0].frameTarget.options[counter++] = new Option(frameName); 
  48.       }
  49.     }
  50.   }
  51. }
  52.  
  53.  
  54.