//  jwin Popup Library Extension 1.04a - Please don't erase this copyright notice.
//  Copyright Jason Anderson 2001. All rights reserved.
//  http://www.jwinlib.com/
//  http://groups.yahoo.com/group/jwin


function jw_displayProperties(popup){
     var s ='', ct = '', cs1 = '<tr><td>', cs2 = '<tr><td colspan="3">', er = '</td></tr>'
     var p = ''
     var p = window.open("",popup.id,"scrollbars=yes,width=440,height=300,left=0,top=100,toolbar=no,location=no,directories=no,status=no,resizable=yes,copyhistory=no,menubar=no,resize=yes") 

     var sP = new Array()


     for (var i = 0; i<propArr.length; i++)
          sP[i] = propArr[i]

     sP = sP.sort()
     

     s += '<html><head><title>Popup properties debug window</title></head><body bgcolor="#EEEEEE"><table border="1" width="450">'+ cs2 + '<font size="5" color="#993300">JWIN PROPERTIES</font>' + er

     for(p1 in jwin){
          var cp = jwin[p1]
          s += cs1 + '<b>'+ p1 + '</b></td><td><font color="#993300"><b>' + (typeof jwin[p1] == 'object' ? '&nbsp;' : typeof jwin[p1]) + '</b></font></td><td><font color="#993300"><b>' + (cp == '' ? '&nbsp;' : cp) + '</b></font>' + er
     }

     var jp = popup
     var showFunc = (jp.debug && jp.debug.toString() == '1' ? true : false)
     
     s += cs2+ '&nbsp;' + er + cs2 + '<font size="5" color="#993300"> JWIN POPUP ('+jp.id+') PROPERTIES</font>' + er

     for(i=0; i<sP.length; i++){
          var p1 = sP[i]
          p1 = (typeof jp[p1] == 'undefined') ? p1.toLowerCase() : p1  
          p1 = (p1 == 'function' ? 'Function' : p1)  
          var cp = jp[p1]

          if(p1 == 'code'){ 
               if(cp){                  
                    cp = cp.replace(/</g,'&lt;')
                    cp = cp.replace(/>/g,'&gt;')
                    s += cs2 + '<b>' + p1 + '</b>:' + er + cs2 + '<font color="#993300"><b>' + cp + '</b></font>' + er
               }else  
                    s += cs1 + '<b>' + p1 + '</b></td><td><font color="#993300"><b>None</b></font></td><td>&nbsp;' + er  
          }else if(typeof cp == 'function'){
               s += cs1 +'<b>' + p1 + '</b></td><td><font color="#993300"><b>Function</b></font></td><td>' + '&nbsp;' + er  
               if(showFunc){
                    var num = cp.toString().match(/\n/g)
                    num = (num ? ( nav.ie4up ? num.length : num.length - 1) : 2)
                    s += cs2 + '<form><textarea cols="45" rows="' + num + '" wrap="OFF">' + cp + '</textarea></form>' + er
               }
          }else{
               var w = '<b>' + cp + '</b>'              
               if(w=='<b></b>') w = '<b>&nbsp;</b>'
               s += cs1 + '<b>' + p1 + '</b></td><td><font color="#993300"><b>' + (typeof cp == 'object' ? (p1 == 'targetframe' ? (cp.name == '' ? '&nbsp;' : cp.name) : 'object') : typeof cp) + '</b></font></td><td><font color="#993300"><b>' + w + '</b></font>' + er  
          }
          if(p1 == 'y'){
               s += cs2 + '<b>The following items are internal properties that are <i>NOT</i> normally accessed via the command line.</b>' + er
          }
     }

     s += '</table><form><table width="100%"><tr><td colspan="2">&nbsp;</td></tr><tr><td align="CENTER"><input type="button" value="Close Window" onClick="self.close()">' + er +'</table></form></body></html>'

     d = p.document
     d.open()
     d.write(s)
     d.close()
}




function jw_setProperties(t){
   var l = 0, pr, ar = new Array, args = jw_setProperties.arguments, _jwp = null
   var p = cls_jwinpopup.prototype
   if(typeof t == 'object' && t.length){    // command array
      for(var j=0; j<t.length; j++){
         if(j%2==0)
            ar[l++] = (typeof t[j] == 'string' ? eval(t[j].toUpperCase()) : t[j])
         else
            ar[l++] = t[j]
      }
      _jwp = jw_parseIt(null,ar)
   }else{
      if(typeof t == 'number')
         _jwp = jw_parseIt(null, args)   //  overlib approach
      else if(typeof t == 'string')
         _jwp = jw_parsetable(t)         // jwin command line
   }
   if(_jwp)
     for(pr in _jwp){
        if(pr.charAt(0) == '_' || pr.indexOf('jwE') != -1 || typeof _jwp[pr] == 'function') continue;  // skip internal properties
        eval('p.' + pr + ' = _jwp[pr]')  // reset this property
     }
}

