[ Index ]

PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12)

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      return false;
  50  }
  51  
  52  var ie4 = document.all ? 1 : 0;
  53  var ns4 = document.layers ? 1 : 0;
  54  var ns6 = window.netscape ? 1 : 0;
  55  function addText(id,text) {
  56      
  57      menuobj = (ie4) ? document.all[id] : (ns6 ? document.getElementById(id) : (ns4 ? document.layers[id] : ''));
  58      
  59      if(ie4 || ns6) {
  60          menuobj.innerHTML=text;
  61      } else {
  62          menuobj.document.open();
  63          menuobj.document.write(text);
  64          menuobj.document.close();
  65      }
  66      
  67  }
  68  
  69  function MM_displayStatusMsg(msgStr) { //v1.0
  70    status=msgStr;
  71    document.MM_returnValue = true;
  72  }
  73  
  74  var clickZoomImage;
  75  function clickZoom(url,imgname,windowstatus) {
  76      clickZoomImage=window.open(url,imgname,windowstatus);
  77      if (window.focus) {
  78          clickZoomImage.focus();
  79      }
  80  }
  81  function checkClickZoom() {
  82      if (clickZoomImage) {
  83          clickZoomImage.close();
  84      }
  85  }
  86  
  87  var layerDisplayStatus = new Array;
  88  // switch layer visibility
  89  function toggleLayerDisplay(whichLayer, status) {
  90      // store current layer status
  91      layerDisplayStatus[whichLayer] = status;
  92      // status: 'none', 'block'    
  93      if (document.getElementById) {
  94          // this is the way the standards work
  95          document.getElementById(whichLayer).style.display = status;
  96      }
  97      else if (document.all) {
  98          // this is the way old msie versions work
  99          document.all[whichLayer].style.display = status;
 100      }
 101      else if (document.layers) {
 102          // this is the way nn4 works
 103          document.layers[whichLayer].display = status;
 104      }
 105  }
 106  
 107  function toggleClassName(whichLayer, newClassName) {
 108      if (document.getElementById) {
 109          // this is the way the standards work
 110          document.getElementById(whichLayer).className = newClassName;
 111      }
 112      else if (document.all) {
 113          // this is the way old msie versions work
 114          document.all[whichLayer].className = newClassName;
 115      }
 116      else if (document.layers) {
 117          // this is the way nn4 works
 118          document.layers[whichLayer].className = newClassName;
 119      }
 120  }
 121  
 122  function mailtoLink(part1, part2) {    
 123      if(part1 && part2) {
 124          window.location.href="mailto:"+part1+"@"+part2;
 125          return true;
 126      }
 127      return false;        
 128  }
 129  
 130  function addLoadEvent(func) {
 131      var oldonload = window.onload;
 132      if (typeof window.onload != 'function') {
 133          window.onload = func;
 134      } else {
 135          window.onload = function() {
 136              oldonload();
 137              func();
 138          }
 139      }
 140  }
 141  
 142  function getObjectById(fld) {
 143      if (document.getElementById && document.getElementById(fld) != null) {
 144          return document.getElementById(fld);
 145      } else if (document.layers && document.layers[fld] != null) {
 146          return document.layers[fld];
 147      } else if (document.all) {
 148          return document.all(fld);
 149      } else {
 150          return false;
 151      }
 152  }


Generated: Sun Jan 29 16:31:14 2012 Cross-referenced by PHPXref 0.7.1