[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/template/inc_js/ -> frontend.js (source)

   1  function MM_swapImgRestore() { //v3.0
   2    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
   3  }
   4  
   5  function MM_findObj(n, d) { //v4.01
   6    var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
   7      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
   8    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
   9    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  10    if(!x && d.getElementById) x=d.getElementById(n); return x;
  11  }
  12  
  13  function MM_swapImage() { //v3.0
  14    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  15     if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  16  }
  17  
  18  function clearText(thefield){
  19  if (thefield.defaultValue==thefield.value) thefield.value = "";
  20  }
  21  
  22  function MM_showHideLayers() { //v6.0
  23    var i,p,v,obj,args=MM_showHideLayers.arguments;
  24    for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
  25      if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
  26      obj.visibility=v; }
  27  }
  28  
  29  function int_only(value) {
  30      value = parseInt(value);
  31      if(value<0) value = value * -1;
  32      return (value) ? value+"" : "";
  33  }
  34  
  35  
  36  
  37  
  38  function BookMark_Page(alerttext) {
  39      var title = document.title;
  40      var url = this.location;
  41      if (window.sidebar) { // Mozilla Firefox Bookmark
  42          window.sidebar.addPanel(title, url,"");
  43      } else if( window.external ) { // IE Favorite
  44          window.external.AddFavorite( url, title);
  45      } else {
  46          if(!alerttext) alerttext = "To bookmark this page use [Ctrl+D]";
  47          alert(alerttext);    
  48      }
  49  }
  50  
  51  var ie4 = document.all ? 1 : 0;
  52  var ns4 = document.layers ? 1 : 0;
  53  var ns6 = window.netscape ? 1 : 0;
  54  function addText(id,text) {
  55      
  56      menuobj = (ie4) ? document.all[id] : (ns6 ? document.getElementById(id) : (ns4 ? document.layers[id] : ''));
  57      
  58      if(ie4 || ns6) {
  59          menuobj.innerHTML=text;
  60      } else {
  61          menuobj.document.open();
  62          menuobj.document.write(text);
  63          menuobj.document.close();
  64      }
  65      
  66  }
  67  
  68  function MM_displayStatusMsg(msgStr) { //v1.0
  69    status=msgStr;
  70    document.MM_returnValue = true;
  71  }
  72  
  73  var clickZoomImage;
  74  function clickZoom(url,imgname,windowstatus) {
  75      clickZoomImage=window.open(url,imgname,windowstatus);
  76      if (window.focus) {
  77          clickZoomImage.focus();
  78      }
  79  }
  80  function checkClickZoom() {
  81      if (clickZoomImage) {
  82          clickZoomImage.close();
  83      }
  84  }
  85  
  86  var layerDisplayStatus = new Array;
  87  // switch layer visibility
  88  function toggleLayerDisplay(whichLayer, status) {
  89      // store current layer status
  90      layerDisplayStatus[whichLayer] = status;
  91      // status: 'none', 'block'    
  92      if (document.getElementById) {
  93          // this is the way the standards work
  94          document.getElementById(whichLayer).style.display = status;
  95      }
  96      else if (document.all) {
  97          // this is the way old msie versions work
  98          document.all[whichLayer].style.display = status;
  99      }
 100      else if (document.layers) {
 101          // this is the way nn4 works
 102          document.layers[whichLayer].display = status;
 103      }
 104  }
 105  
 106  function toggleClassName(whichLayer, newClassName) {
 107      if (document.getElementById) {
 108          // this is the way the standards work
 109          document.getElementById(whichLayer).className = newClassName;
 110      }
 111      else if (document.all) {
 112          // this is the way old msie versions work
 113          document.all[whichLayer].className = newClassName;
 114      }
 115      else if (document.layers) {
 116          // this is the way nn4 works
 117          document.layers[whichLayer].className = newClassName;
 118      }
 119  }
 120  
 121  function mailtoLink(part1, part2) {    
 122      if(part1 && part2) {
 123          window.location.href="mailto:"+part1+"@"+part2;
 124          return true;
 125      }
 126      return false;        
 127  }
 128  
 129  function addLoadEvent(func) {
 130      var oldonload = window.onload;
 131      if (typeof window.onload != 'function') {
 132          window.onload = func;
 133      } else {
 134          window.onload = function() {
 135              oldonload();
 136              func();
 137          }
 138      }
 139  }
 140  
 141  function getObjectById(fld) {
 142      if (document.getElementById && document.getElementById(fld) != null) {
 143          return document.getElementById(fld);
 144      } else if (document.layers && document.layers[fld] != null) {
 145          return document.layers[fld];
 146      } else if (document.all) {
 147          return document.all(fld);
 148      } else {
 149          return false;
 150      }
 151  }


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7