⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 template1.js

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 JS
字号:
function ObjectAD() {
  this.ADID        = 0;
  this.ADType      = 0;
  this.ADName      = "";
  this.ADFileURL   = "";
  this.ADWidth     = 0;
  this.ADHeight    = 0;
  this.LinkURL     = "";
  this.LinkTitle   = "";
  this.OpenType    = 0;
  this.FlashWmode  = true;
  this.ADRight     = 0;
}

function PopZoneAD(_id) {
  this.ID          = _id;
  this.ZoneID      = 0;
  this.ZoneName    = "";
  this.ZoneWidth   = 0;
  this.ZoneHeight  = 0;
  this.ShowType    = 0;
  this.DivName     = "";
  this.Div         = null;

  this.PopType     = 0;
  this.Left        = 0;
  this.Top         = 0;

  this.AllAD       = new Array();
  this.ShowAD      = null;

  this.AddAD       = PopZoneAD_AddAD;
  this.GetShowAD   = PopZoneAD_GetShowAD;
  this.CookieCheck = PopZoneAD_CookieCheck;
  this.Show        = PopZoneAD_Show;
  this.Struct      = PopZoneAD_Struct;
  this.Window      = PopZoneAD_Window;

}

function PopZoneAD_AddAD(_AD) {
  this.AllAD[this.AllAD.length] = _AD;
}

function PopZoneAD_GetShowAD() {
  if(this.AllAD.length <= 0) { return; }
  if (this.ShowType > 0) {
    this.ShowAD = this.AllAD[0];
    return;
  }
  
  var arrRnd = new Array();
  for (var i = 0; i < this.AllAD.length; i++) {
    for(var j = 0; j < this.AllAD[i].ADRight; j++){
	  arrRnd[arrRnd.length] = this.AllAD[i];
	}	
  }
  var sum = arrRnd.length;
  var rndNum = parseInt(Math.random() * sum);  
  this.ShowAD = arrRnd[rndNum];
}

function PopZoneAD_Show() {
  if (!this.AllAD) { return; }  
  this.GetShowAD();

  if (this.ShowAD == null) return false;
  if (!this.CookieCheck()) return false;
  this.DivName = "PopZoneAD_Div" + this.ZoneID;
  if (ADDir == "") ADDir = "AD";
  var OK = this.Struct();
  if (OK) OK.document.write(this.Window());
}

function PopZoneAD_Struct() {
  var winwidth  = parseInt((this.ShowAD.ADWidth) ? this.ShowAD.ADWidth : this.ZoneWidth) - 4;
  var winheight = parseInt((this.ShowAD.ADHeight) ? this.ShowAD.ADHeight : this.ZoneHeight) - 4;
  var winleft   = this.Left;
  var wintop    = this.Top;
  return window.open("about:blank", "","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,width=" + winwidth + "px,height=" + winheight + "px,top=" + wintop + "px,left=" + winleft +"px");
}

function PopZoneAD_Window() {
  var strWin;
  strWin = "<html><head><meta http-equiv='content-type' content='text/html; charset=gb2312'><title>";
  strWin += "POPAD";
  strWin += "</title>";
  strWin += "</head><body scroll=no style='margin:0;border:none;text-align:center;vertical-align:center;'>";
  strWin += AD_Content(this.ShowAD);
  strWin += "</body></html>";
  return strWin;
}

function PopZoneAD_CookieCheck() {
  var Now = new Date();
  var strToday = String(Now.getYear()) + String(Now.getMonth() + 1) + String(Now.getDate());
  var ADCookie = "AD_Cookie_" + this.ZoneID
  if(this.PopType == 0){
	  return true;
  }else if(this.PopType == 1){
	  if(GetCookie(ADCookie) == strToday){
	      return false;
	  }else{
		  AD_SetCookie(ADCookie, strToday);
          return true;
	  }
  }else{
	  if(GetCookie(ADCookie) != ""){
	      return false;
	  }else{
		  AD_SetCookie(ADCookie, strToday);
          return true;
	  }
  }
}

function GetCookie(name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return GetCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

function GetCookieVal(offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function AD_SetCookie(name, value)
{
    var argv = AD_SetCookie.arguments;
    var argc = AD_SetCookie.arguments.length;
    var expires = (argc > 2) ? argv[2]: null;
    var path = (argc > 3) ? argv[3]: null;
    var domain = (argc > 4) ? argv[4]: null;
    var secure = (argc > 5) ? argv[5]: false;
    document.cookie = name + "=" + escape(value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");
}

function AD_Content(o) {
  var str = "";
  var str = "";
  if (o.ADType == 0 || o.ADType == 1) {
    o.ADFileURL = o.ADFileURL.toLowerCase()
    if (o.ADFileURL.indexOf(".swf") !=  - 1) {
      str = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0'";
      str += " name='AD_" + o.ADID + "' id='AD_" + o.ADID + "'";
      str += " width='" + o.ADWidth + "'";
      str += " height='" + o.ADHeight + "'";
      if (o.style) str += " style='" + o.style + "'";
      if (o.extfunc) str += " " + o.extfunc + " ";
      str += ">";
      str += "<param name='movie' value='" + o.ADFileURL + "'>";
      if (o.FlashWmode) str += "<param name='wmode' value='Transparent'>";
      if (o.play) str += "<param name='play' value='" + o.play + "'>";
      if (typeof(o.loop) != "undefined") str += "<param name='loop' value='" + o.loop + "'>";
      str += "<param name='quality' value='autohigh'></object>";
      str = "<embed ";
      str += " name='AD_" + o.ADID + "' id='AD_" + o.ADID + "'";
      str += " width='" + o.ADWidth + "'";
      str += " height='" + o.ADHeight + "'";
      if (o.style) str += " style='" + o.style + "'";
      if (o.extfunc) str += " " + o.extfunc + " ";
      str += " src='" + o.ADFileURL + "'";
      if (o.FlashWmode) str += " wmode='Transparent'";
      if (o.play) str += " play='" + o.play + "'";
      if (typeof(o.loop) != "undefined") str += " loop='" + o.loop + "'";
      str += " quality='autohigh'"
      str += " pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed>";
      str += "</object>";
    } else if (o.ADFileURL.indexOf(".gif") !=  - 1 || o.ADFileURL.indexOf(".jpg") !=  - 1 || o.ADFileURL.indexOf(".jpeg") !=  - 1 || o.ADFileURL.indexOf(".bmp") !=  - 1 || o.ADFileURL.indexOf(".png") !=  - 1) {
      if (o.LinkURL) {
        o.LinkURL = InstallDir + ADDir + "/ADCount.asp?Action=Click&ADID=" + o.ADID
        str += "<a href='" + o.LinkURL + "' target='" + ((o.OpenType == 0) ? "_self" : "_blank") + "' title='" + o.LinkTitle + "'>";
      }
      str += "<img ";
      str += " name='AD_" + o.ADID + "' id='AD_" + o.ADID + "'";
      if (o.style) str += " style='" + o.style + "'";
      if (o.extfunc) str += " " + o.extfunc + " ";
      str += " src='" + o.ADFileURL + "'";
      if (o.ADWidth) str += " width='" + o.ADWidth + "'";
      if (o.ADHeight) str += " height='" + o.ADHeight + "'";
      str += " border='0'>";
      if (o.LinkURL) str += "</a>";
    }
  }
  return str;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -